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

Docker restart while project is running results in port errors on ddev start due to macOS docker bug #2981

Closed
rfay opened this issue Apr 30, 2021 · 4 comments

Comments

@rfay
Copy link
Member

rfay commented Apr 30, 2021

Symptom: Failed to start d9: Unable to listen on required ports, port 443 is already in use, Troubleshooting suggestions at https://ddev.readthedocs.io/en/stable/users/troubleshooting/#unable-listen

Run a Diagnostic and Paste Link Here

test_ddev.sh output: https://gist.github.com/rfay/f29c71dcde73c59cefd5257b51b37225

Describe the bug

If you leave at least one project running (which leaves ddev-router running) in v1.17+, and restart docker or restart the computer, then start a project (the same one or a different one), you get

ERROR: for ddev-router  Cannot start service ddev-router: Ports are not available: port is already allocated.

This appears to be a docker bug with restarting ddev-router.

Update: This is in fact a newer bug in Docker Desktop for Mac, docker/for-mac#5649

To Reproduce

  1. Start a project
  2. Restart docker
  3. Start the project again.

In my experience this can always be fixed with ddev poweroff and (often) a docker restart. It's also easily prevented by a ddev poweroff before computer shutdown or docker restart.

Expected behavior

It should just start the project.

Version and configuration information (please complete the following information):

  • Host computer OS and Version: macOS M1 Big Sur
  • Docker Desktop version: 3.3.1
  • ddev version information : v1.17.2

Additional Context

This seems to be mostly caused by a related Docker Desktop problem on macOS amd64 and arm64: docker/for-mac#5649

A perhaps related failure was reported in TYPO3 #ddev slack

https://gist.github.com/rfay/cb0228078eb928c00560e9b133bf352c

@rfay rfay added 1.17.3 and removed 1.17.3 labels May 2, 2021
@rfay rfay added this to the v1.17.3 milestone May 2, 2021
rfay added a commit to rfay/ddev that referenced this issue May 2, 2021
@rfay rfay closed this as completed in 7f965ea May 3, 2021
@rfay
Copy link
Member Author

rfay commented May 3, 2021

Reopening this, because the real problem is upstream, and we want people to be able to find it.

@rfay rfay reopened this May 3, 2021
@rfay rfay removed this from the v1.17.3 milestone May 3, 2021
@rfay rfay changed the title Docker restart or system reboot while project is running results in port errors on ddev start Docker restart or system reboot while project is running results in port errors on ddev start due to macOS docker bug May 3, 2021
@rfay
Copy link
Member Author

rfay commented May 5, 2021

To prevent this docker problem, avoid rebooting or powering off or restarting docker while any ddev project is running.

To fix things when you have this problem:
ddev poweroff and then restart docker.

@rfay rfay pinned this issue May 5, 2021
@rfay rfay changed the title Docker restart or system reboot while project is running results in port errors on ddev start due to macOS docker bug Docker restart while project is running results in port errors on ddev start due to macOS docker bug May 5, 2021
@rfay
Copy link
Member Author

rfay commented Jun 9, 2021

I'm hoping this got fixed in today's Docker Desktop 3.4.0 but don't see it in the release notes

@rfay rfay closed this as completed Jun 9, 2021
@rfay rfay unpinned this issue Jun 10, 2021
@JMartinRootStack
Copy link

If you are facing this issue, consider enabling the option "Allow the default Docker socket to be used (requires password)" under "Advanced" in the "Settings" screen. First, poweroff ddev, change config, and explicitly select "restart" option from the dropdown menú of docker desktop. Do not just rely on it's "restart" after the configuration has been updated.

After I reproduced these steps, I stopped having the issue. I have Docker Desktop 4.20.1 and Ddev 1.21.6

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

No branches or pull requests

2 participants