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

Chapter 17, CRITICAL Listen failure: Couldn't listen on any:b'/code/educa/daphne.sock': Cannot acquire lock. #54

Open
jmpmcmanus opened this issue Oct 3, 2023 · 4 comments

Comments

@jmpmcmanus
Copy link

In chapter 17 I'm getting the following error related to daphne:

CRITICAL Listen failure: Couldn't listen on any:b'/code/educa/daphne.sock': Cannot acquire lock.

I tried stoping the docker-compose deleting the daphne.sock and restarting docker-compose and get the same error. A daphne.sock.lock file is also created, which is actually link to: daphne.sock.lock --> 1. I remove that as well before starting docker-compose again.

Jim

@alfonsomiralles
Copy link

I have the same problem

@mojoelogic
Copy link

I'm trying to finish this book before new years(so today) and I'm stuck on the same problem.

@jmpmcmanus and @alfonsomiralles did either of you get it sorted?

@zenx
Copy link
Collaborator

zenx commented Mar 9, 2024

There seems to be an issue with Daphne related to UNIX sockets. You can run Daphne via host/port instead of UNIX socket:

docker-compose.yml

daphne:
  command: ["../wait-for-it.sh", "db:5432", "--",
            "daphne", "-b", "0.0.0.0", "-p", "9001",
            "educa.asgi:application"]
# ...

Nginx config:

upstream daphne {
    server daphne:9001;
}

@AlexNeo68
Copy link

There seems to be an issue with Daphne related to UNIX sockets. You can run Daphne via host/port instead of UNIX socket:

docker-compose.yml

daphne:
  command: ["../wait-for-it.sh", "db:5432", "--",
            "daphne", "-b", "0.0.0.0", "-p", "9001",
            "educa.asgi:application"]
# ...

Nginx config:

upstream daphne {
    server daphne:9001;
}

It is working! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants