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

Solve problem with unreachable sites due to ddev-router config fail, fixes #2648 #2663

Merged
merged 2 commits into from Nov 27, 2020

Conversation

rfay
Copy link
Member

@rfay rfay commented Nov 25, 2020

The Problem/Issue/Bug:

#2648 : In ddev v1.16.0 and v1.16.1, a ddev start might result in a site that was unreachable; the newly started site would get "503: No ddev back-end site available."

503__No_ddev_back-end_site_available

How this PR Solves The Problem:

It turns out that this was timing related, but more importantly,

  • the listener (-watch) docker-gen process creates a script which is then run to create the nginx configuration
  • However, the script is not recreated if docker-gen does not see that it changed
  • However, the generated script had hostnames in it (container names) but it did not include the ports from HTTP_EXPOSE or HTTPS_EXPOSE. So if those came through in separate events, docker-gen would read the later events but decide that because the generated script did not change, it did not need to be recreated (and the script didn't get run... so the nginx configuration was not updated)

This also

  • Improves the healthcheck to detect whether the /etc/nginx/conf.d/default.conf has been properly generated
  • Cleans up the healthcheck in general
  • Provides a default.conf that is more appropriate than the one put there by the nginx package (and includes healthcheck)

Manual Testing Instructions:

  • If you do not have the ddev binary build with this PR, then add this file as ~/.ddev/router-compose.nginx.yaml (router-compose.nginx.yaml in your global .ddev directory, the one in your home directory), then ddev poweroff and do the normal testing that was earlier able to create the problem:
version: '3.6'
services:
  ddev-router:
    image: drud/ddev-router:20201124_router_fails_to_expose

Automated Testing Overview:

This seems to be timing related and dependent on docker's state somehow and difficult to test.

Related Issue Link(s):

#2648

Release/Deployment notes:

@rfay
Copy link
Member Author

rfay commented Nov 26, 2020

I note that when I use the varnish 3rd party service with this PR the healthcheck stanza does not get generated in the ddev-router nginx config (default.conf).

Oddly, it's not a problem with the solr service.

@rfay
Copy link
Member Author

rfay commented Nov 27, 2020

I tried the script from #2648 and ran it repeatedly with this ddev version and was no longer able to demonstrate the problem.

@rfay rfay merged commit 4778dc4 into ddev:master Nov 27, 2020
@rfay rfay deleted the 20201124_router_fails_to_expose branch November 27, 2020 17:59
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

Successfully merging this pull request may close these issues.

Can't access more than 2 ddev sites at the same time (after updating to v1.16.0, MacOS)
1 participant