Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error establishing client to placement service #82

Closed
Annonator opened this issue Mar 29, 2020 · 5 comments · Fixed by #95
Closed

error establishing client to placement service #82

Annonator opened this issue Mar 29, 2020 · 5 comments · Fixed by #95
Assignees
Labels
bug Something isn't working P2 Moderate priority
Milestone

Comments

@Annonator
Copy link

Hi all,

i recently played around with Dapr and the vscode plugin, i installed the most recent runtime / CLI https:/dapr/dapr/releases/tag/v0.5.0
https:/dapr/dapr/releases/tag/v0.5.1

My sample application runs without any major problems if I manually user daprd, dapr and attach the debugger. However, after installing the extension I did "scaffold dapr tasks" and i do run in the following error when executing the task:

> Executing task: daprd-debug <

> Executing command: daprd --app-id "GamedevFabric" --app-port "3000" --placement-address "localhost:50005" <

time="2020-03-29T22:08:36.1516971+02:00" level=info msg="starting Dapr Runtime -- version 0.5.1 -- commit v0.3.0-rc.0-160-g514f806-dirty" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:36.1516971+02:00" level=info msg="log level set to: info" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:36.1516971+02:00" level=info msg="metrics server started on :9090/" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.metrics type=log ver=0.5.1
time="2020-03-29T22:08:36.1516971+02:00" level=info msg="standalone mode configured" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:36.1516971+02:00" level=info msg="dapr id: GamedevFabric" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:36.1516971+02:00" level=info msg="mTLS is disabled. Skipping certificate request and tls validation" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:36.1556975+02:00" level=info msg="found component statestore (state.redis)" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:36.1556975+02:00" level=info msg="found component messagebus (pubsub.redis)" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:36.1556975+02:00" level=info msg="application protocol: http. waiting on port 3000" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:37.2586963+02:00" level=info msg="application discovered on port 3000" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:37.3036962+02:00" level=info msg="application configuration loaded" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
2020-03-29 22:08:37.303696 I | redis: connecting to localhost:6379
2020-03-29 22:08:37.305698 I | redis: connected to localhost:6379 (localAddr: [::1]:63717, remAddr: [::1]:6379)
time="2020-03-29T22:08:37.3166978+02:00" level=info msg="App is subscribed to the following topics: []" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:37.3166978+02:00" level=info msg="Initialized service discovery to standalone" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:37.3166978+02:00" level=info msg="actor runtime started. actor idle timeout: 1h0m0s. actor scan interval: 30s" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime.actor type=log ver=0.5.1
time="2020-03-29T22:08:37.3166978+02:00" level=info msg="starting connection attempt to placement service at localhost:50005" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime.actor type=log ver=0.5.1
time="2020-03-29T22:08:37.3166978+02:00" level=info msg="enabled metrics grpc middleware" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime.grpc type=log ver=0.5.1
time="2020-03-29T22:08:37.3166978+02:00" level=info msg="gRPC server is running on port 50001" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:37.3166978+02:00" level=info msg="enabled cors http middleware" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime.http type=log ver=0.5.1
time="2020-03-29T22:08:37.3166978+02:00" level=info msg="enabled proxy http middleware" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime.http type=log ver=0.5.1
time="2020-03-29T22:08:37.3166978+02:00" level=info msg="enabled metrics http middleware" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime.http type=log ver=0.5.1
time="2020-03-29T22:08:37.3166978+02:00" level=info msg="http server is running on port 3500" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:37.3166978+02:00" level=info msg="local service entry announced" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:37.3166978+02:00" level=info msg="dapr initialized. Status: Running. Init Elapsed 1165.0007ms" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime type=log ver=0.5.1
time="2020-03-29T22:08:39.6246965+02:00" level=warning msg="error establishing client to placement service: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial tcp [::1]:50005: connectex: No connection could be made because the target machine actively refused it.\"" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime.actor type=log ver=0.5.1
time="2020-03-29T22:08:42.182696+02:00" level=warning msg="error establishing client to placement service: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial tcp [::1]:50005: connectex: No connection could be made because the target machine actively refused it.\"" app_id=GamedevFabric instance=Andreas-Desktop scope=dapr.runtime.actor type=log ver=0.5.1

As a note here, if I start daprd, dapr manually i only use the following:

daprd --app-id "GamedevFabric" --app-port "3000"
dapr run --port 3501 --app-id GamedevFabric --app-port 3000 dotnet run

and I can attach my debugger to it without any problems. The main difference here is that i do not define a placement service address which is done automatically when i use the extension.

This problem might be very well related to my setup, what I'm struggling with is the amount of control i have to fix this through the plugin as I could not find a way to not set a placement-address through configuration (which might be just missing knowledge)

My launch.json:

{
        "name": "Custom Run with Dapr",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "daprd-debug",
        "program": "${workspaceFolder}/GamedevFabric/PlayerService/PlayerActor/bin/Debug/netcoreapp3.1/PlayerActor.dll",
        "args": [],
        "cwd": "${workspaceFolder}/GamedevFabric/PlayerService/PlayerActor",
        "console": "internalConsole",
        "stopAtEntry": false,
        "postDebugTask": "daprd-down"
    }

and my tasks.json

{
            "appId": "GamedevFabric",
            "appPort": 3000,
            "label": "daprd-debug",
            "type": "daprd",
            "dependsOn": "build"
        },
        {
            "appId": "GamedevFabric",
            "label": "daprd-down",
            "type": "daprd-down"
        }
@philliphoff
Copy link
Collaborator

@Annonator Are you on Windows, by chance? Looking into this, I think I may have found an issue where the default placement address is supposed to be different on Windows vs. other platforms but, for whatever reason, the issue wasn't apparent in prior versions.

In any case, if you're on Windows, try setting the placementAddress property in your daprd-debug task to localhost:6050 and see if that resolves the issue.

@philliphoff philliphoff added bug Something isn't working P2 Moderate priority labels Mar 31, 2020
@philliphoff philliphoff added this to the 0.3.0 milestone Mar 31, 2020
@Annonator
Copy link
Author

Annonator commented Apr 2, 2020

Yes I'm running on windows :)

Added the property and i can confirm that it works now.

@ElanHasson
Copy link

ElanHasson commented May 25, 2020

This gets really tricky when you are running windows, but using dev containers on WSL2, with native docker :)

I can confirm this also works in my configuration:

 {
            "appId": "core-tenant",
            "appPort": 5000,
            "label": "daprd-debug",
            "type": "daprd",
            "placementAddress": "dapr_placement_dapr-dev-container:50005"
        },

@philliphoff
Copy link
Collaborator

@ElanHasson Glad the workaround works. Yes, WSL2 might make things interesting. How are you running the Dapr extension, "locally" (i.e. in Windows) or "remotely" from WSL2?

@ElanHasson
Copy link

Remotely, from Dev containers via in WSL2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 Moderate priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants