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

daprd crashes if port already in use, breaking dapr cli #1441

Open
withinboredom opened this issue Aug 13, 2024 · 3 comments
Open

daprd crashes if port already in use, breaking dapr cli #1441

withinboredom opened this issue Aug 13, 2024 · 3 comments
Labels
kind/bug Something isn't working

Comments

@withinboredom
Copy link

In what area(s)?

/area runtime

/area operator

/area placement

/area docs

/area test-and-release

What version of Dapr?

latest

Expected Behavior

dapr cli to gracefully exit or restart

Actual Behavior

dapr run -- ./cli
ℹ️  The scheduler is only compatible with dapr runtime 1.14 onwards.
ℹ️  Starting Dapr with id hisserplume-hyena. HTTP Port: 60807. gRPC Port: 60725
ℹ️  Checking if Dapr sidecar is listening on HTTP port 60807
Flag --components-path has been deprecated, use --resources-path
INFO[0000] Starting Dapr Runtime -- version 1.13.5 -- commit e490e58f62110ecdc430d2f39d57428729a487ea  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] Log level set to: info                        app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
WARN[0000] mTLS is disabled. Skipping certificate request and tls validation  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.security type=log ver=1.13.5
WARN[0000] The default value for 'spec.metric.http.increasedCardinality' will change to 'false' in Dapr 1.14  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] metrics server started on :60761/             app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] standalone mode configured                    app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] app id: hisserplume-hyena                     app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] Dapr trace sampler initialized: DaprTraceSampler(P=1.000000)  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] local service entry announced: hisserplume-hyena -> 192.168.50.104:60725  app_id=hisserplume-hyena component="nr (mdns/v1)" instance=Legion scope=dapr.contrib type=log ver=1.13.5
INFO[0000] Initialized name resolution to mdns           app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] Loading components…                           app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] Component loaded: pubsub (pubsub.redis/v1)    app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.processor type=log ver=1.13.5
INFO[0000] Waiting for all outstanding components to be processed…  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] Using 'statestore' as actor state store       app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.processor.state type=log ver=1.13.5
INFO[0000] Component loaded: statestore (state.redis/v1)  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.processor type=log ver=1.13.5
INFO[0000] All outstanding components processed          app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] Loading endpoints…                            app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] Waiting for all outstanding http endpoints to be processed…  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] All outstanding http endpoints processed      app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
WARN[0000] App channel is not initialized. Did you configure an app-port?  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.channels type=log ver=1.13.5
INFO[0000] gRPC server listening on TCP address: :60725  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.grpc.api type=log ver=1.13.5
INFO[0000] Enabled gRPC tracing middleware               app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.grpc.api type=log ver=1.13.5
INFO[0000] Enabled gRPC metrics middleware               app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.grpc.api type=log ver=1.13.5
INFO[0000] Registering workflow engine for gRPC endpoint: [::]:60725  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.grpc.api type=log ver=1.13.5
INFO[0000] API gRPC server is running on port 60725      app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] Enabled max body size HTTP middleware with size 4 MB  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.http type=log ver=1.13.5
INFO[0000] Enabled tracing HTTP middleware               app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.http type=log ver=1.13.5
INFO[0000] Enabled metrics HTTP middleware               app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.http type=log ver=1.13.5
INFO[0000] HTTP server listening on TCP address: :60807  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.http type=log ver=1.13.5
INFO[0000] HTTP server is running on port 60807          app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] The request body size parameter is: 4         app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
ERRO[0000] Failed to listen for gRPC server on TCP address :60725 with error: listen tcp :60725: bind: address already in use  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.grpc.internal type=log ver=1.13.5
INFO[0000] Dapr is shutting down                         app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] Shutting down component statestore (state.redis/v1)  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] Shutting down component pubsub (pubsub.redis/v1)  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] stopping mDNS server for app id: hisserplume-hyena  app_id=hisserplume-hyena component="nr (mdns/v1)" instance=Legion scope=dapr.contrib type=log ver=1.13.5
INFO[0000] Shutting down workflow engine                 app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] Dapr runtime stopped                          app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
INFO[0000] Closing HTTP server [::]:60807…               app_id=hisserplume-hyena instance=Legion scope=dapr.runtime.http type=log ver=1.13.5
FATA[0000] Fatal error from runtime: failed to start internal gRPC server: could not listen on any endpoint  app_id=hisserplume-hyena instance=Legion scope=dapr.runtime type=log ver=1.13.5
❌  The daprd process exited with error code: exit status 1

HANG for several minutes

Dapr sidecar is not listening on HTTP port: dial tcp 127.0.0.1:60807: connect: connection refused
ℹ️  Checking if Dapr sidecar is listening on GRPC port 60725
⚠  Dapr sidecar is not listening on GRPC port: dial tcp 127.0.0.1:60725: connect: connection refused
⚠  Dapr sidecar might not be responding.
❌  The App process exited with error code: exit status 1
⚠  Could not update sidecar metadata for cliPID: PUT http://127.0.0.1:60807/v1.0/metadata/cliPID giving up after 5 attempt(s): Put "http://127.0.0.1:60807/v1.0/metadata/cliPID": dial tcp 127.0.0.1:60807: connect: connection refused
ℹ️  Updating metadata for appPID: 27462
⚠  Could not update sidecar metadata for appPID: PUT http://127.0.0.1:60807/v1.0/metadata/appPID giving up after 5 attempt(s): Put "http://127.0.0.1:60807/v1.0/metadata/appPID": dial tcp 127.0.0.1:60807: connect: connection refused
ℹ️  Updating metadata for app command: ./cli
⚠  Could not update sidecar metadata for appCommand: PUT http://127.0.0.1:60807/v1.0/metadata/appCommand giving up after 5 attempt(s): Put "http://127.0.0.1:60807/v1.0/metadata/appCommand": dial tcp 127.0.0.1:60807: connect: connection refused

Steps to Reproduce the Problem

Have daprd accidentally pick an in-use port.

Release Note

RELEASE NOTE:

@withinboredom withinboredom added the kind/bug Something isn't working label Aug 13, 2024
@deepak04112002
Copy link

We can use proxy server here

@yaron2 yaron2 transferred this issue from dapr/dapr Aug 14, 2024
@yaron2
Copy link
Member

yaron2 commented Aug 14, 2024

Moved to the CLI repo

@dapr-bot
Copy link
Collaborator

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

@dapr-bot dapr-bot added stale and removed stale labels Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants