Restore from a server image that contain discourse, but rebuild error

AI-generated summary

Users are encountering a DNS resolution error when rebuilding Discourse after restoring from a server image. The error fatal: unable to access 'https://github.com/discourse/pups.git/': Could not resolve host: github.com occurs despite the host machine having working network access to GitHub. Falco suggests the issue lies within Docker’s network, specifically DNS resolution, and recommends setting a public DNS like 8.8.8.8 inside Docker. CornerDoor confirms trying to edit /etc/resolv.conf and /etc/hosts without success, and admits uncertainty about which configuration to modify. Stephen clarifies the need to check DNS settings inside the Docker container, not just the host, and asks if the container can ping the DNS IP — noting that if ICMP fails, UDP (used by DNS) will too. drakey1988, a non-developer, reports the same error after changing SMTP settings in app.yml, and requests a step-by-step guide to fix Docker-related DNS issues. Stephen reiterates that the root cause is likely DNS misconfiguration preventing the Docker container from resolving github.com. The consensus points to Docker’s internal DNS being misconfigured or unreachable, not the host’s network.

I backup a server image which discourse runs smoothly, and then restore on a new server with the backup, but when I rebuild app from discourse directory, it always gets a error to access git, the message is:

"cd /pups && git pull && /pups/bin/pups --stdin

fatal: unable to access ‘GitHub - discourse/pups: Simple yaml based bootstrapper for Linux machines · GitHub’: Could not resolve host: github.com"

By the way, the network has no problem that I can access github, I wonder there’s a configuration contains the old server’s ip address in discourse, but I can’t find it

The host network has no problem, but the Docker one is busted.

Last week someone complained with a similar bug and the docker network wasn’t able to connect to the DHCP provided DNS, and setting it to a public DNS (like 8.8.8.8) solved it.

I have change the nameserver in resolv.conf and hosts, but it doesn’t work

Which resolve.conf? The docker container or the host?

Can the docker container ping that IP? If ICMP doesn’t reach it then UDP won’t.

I don’t know which one to configure

Sorry for reviving old thread. I got the same problem:

fatal: unable to access ‘GitHub - discourse/pups: Simple yaml based bootstrapper for Linux machines · GitHub’: Could not resolve host: github.com
ed49e7f0cd62b126dbf62361bde91094df50435ead3813455b1a9bf2305a2604
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.

As I am not a developer / coder, I only possess limited knowledge about FTP, SSH, Linux commands. I mostly setup the forum by myself and learn along the way.

However, today I change some SMTP info in app.yml then I rebuild and got this problem.
Can someone point me to a comprehensive guide to fix the problem with the docker?

If your server can’t resolve GitHub, then you likely have some form of DNS problem.