Repository navigation
Closed
Labels
kind/bugSomething isn't working
Description
What is the issue?
I cannot build example todoapp. Maybe because I'm in private network (not reachable to any public DNS)
Log output
~/github.com/dagger/pkg/universe.dagger.io/examples/todoapp$ dagger do build
11:33PM INF upgrading buildkit have host network=false version=v0.10.1
WARN[0008] commandConn.CloseWrite: commandconn: failed to wait: signal: terminated
WARN[0008] commandConn.CloseRead: commandconn: failed to wait: signal: terminated
11:33PM INF upgrading buildkit have host network=false version=v0.10.1
[✔] actions.build.run.script
[✗] actions.deps
#8 0.325 fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
#8 5.331 fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
#8 5.331 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.15/main: temporary error (try again later)
#8 10.34 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.15/community: temporary error (try again later)
#8 10.34 ERROR: unable to select packages:
#8 10.34 bash (no such package):
#8 10.34 required by: world[bash]
[✔] actions.test.script
[✔] client.filesystem."./".read
11:33PM FTL failed to execute plan: task failed: actions.deps._dag."0"._dag."1"._exec: process "apk -U --no-cache add bash" did not complete successfully: exit code: 1
~/github.com/dagger/pkg/universe.dagger.io/examples/todoapp$
Steps to reproduce
- Install dagger
$ git clone https://github.com/dagger
$ cd dagger/pkg/universe.dagger.io/examples/todoapp
$ dagger do build
Dagger version
dagger 0.2.6 (e2c2213) linux/amd64
OS version
Ubuntu 18.04
Activity
rinrinne commentedon Apr 19, 2022
If run buildkit container with the following command then run dagger, build is successful
buildkitd.toml
xx.xx.xx.xx is our private DNS
marcosnils commentedon Apr 19, 2022
This is interesting, IIRC any container that you run in your machine should use your main system DNS configuration by default unless specifically overridden. Which setup are you currently using? Mac, Windows, Linux?
If you run a stand alone container, does it have DNS resolution out of the box?
rinrinne commentedon Apr 19, 2022
I'm using Ubuntu desktop 18.04, already described in issue report.
Host's
/etc/resolv.confmarcosnils commentedon Apr 19, 2022
my bad, I missed this.
Yes, that's using the default systemd-resolve service.
If you create a stand alone container, does resolution work?
docker run --rm alpine ping google.comrinrinne commentedon Apr 19, 2022
yes, works.
I ran buildctl in dagger started buildkit container with the following Dockerfile
Result
marcosnils commentedon Apr 19, 2022
Oh! I see what's happening here. Since we're running
dindlike containerscontainerdandlibnetworkis fallbacking to 8.8.8.8. I guess potentially we'd need adagger.Confdefinition to start adding all these non-dagger specific configs and pass them to underlying systems like buildkit.@helderco @aluzzardi @shykes haven't found an issue / feature for this. I recall seeing some issues related but AFIAK we haven't taken any decision on how to tackle this.
Related:
#1369
#2227
rinrinne commentedon Apr 20, 2022
Seems /etc/resolve.conf in host is delivered to buildkit container if "docker run" with
--net=host, If default (--net=bridge), /run/systemd/resolve/resolv.conf in host is delivered as /etc/resolv.conf.juaruipav commentedon Jun 30, 2022
Any progress on this? I'm sadly in the same situation.
Thanks!
JJ
marcosnils commentedon Dec 2, 2023
Closing this since it's a very outdated issue and haven't seen anyone reporting this anymore
kema-dev commentedon Jan 31, 2024
Hello, I'm experiencing issues that might be related to this. I am using a wireguard VPN.
Following get started procedure for go, I get networking errors as follows
Details
Setting custom DNS to Cloudflare's
1.1.1.1fixes the issue. Using the VPN without custom DNS, I am able todocker pullthe image and to fetch the docker auth anonymous token without any issue. Running using nodejs SDK give about same output as GraphQL errors reporting timeouts on docker registry endpoints.I installed
daggeron Fedora 39 using brew, which gave me the same binary as the installation script.marcosnils commentedon Feb 2, 2024
hey there! if you run the following commands:
docker run --rm alpine cat /etc/resolv.conf// engine container needs to be running
docker exec $(docker ps --filter name=dagger-engine- -q) cat /etc/dnsmasq-resolv.conf. Do you see a validdo you see the same
nameserverip?kema-dev commentedon Feb 3, 2024
Looks like nameservers are the same. Sometimes when I delete the dagger-engine container and re-create it, the 2 selected NS are not the same in each container, but I still overall get 3 same servers :
<NS from VPN><router>and1.1.1.1.Running
nslookupin interactive shell inside thedagger-enginecontainer gives same result, only works when no VPN / VPN but1.1.1.1NS set. However, once cached, I canwget -qO- <server name / IP>successfully most of the time. If i do not runwgetfor about 1 minute, I get 2/3 tries returningbad address, then it works. 😕marcosnils commentedon Feb 4, 2024
I think I know what's happening here. Basically each time you disconnect from the VPN you need to "remove" the docker engine since otherwise it'll keep the wrong DNS servers from old VPN sessions. Try doing the following:
dagger-enginecontainerStart again in #1 and repeat.
That should work.
kema-dev commentedon Feb 4, 2024
I ran your steps, but it unfortunately didn't work.
However, it looks like I misunderstood what's happening. My
wgetcommand behavior is “consistent” (in the sense it happens even if I permanently use my VPN). Same behavior for nslookup calls, fails at first, then hits, then fails again if I do not make calls for about 1 minute.Local machine
nslookupusing<NS FROM VPN>works like a charm, as well as using the custom one if defined in VPN config (1.1.1.1), but any other NS is blocked. The same goes inside dagger-engine container, forcing the right NS I get no issue. Container's/etc/resolve.confis classical, giving its own IP as resolver. I saw no specific configuration ofdnsmasqinside dagger's container, as you can see itsdnsmasqresolver looks the same as the bare-alpine'sresolve.conf.I wonder if something like a round-robin selection of a NS could happen ? In a bare-alpine, nslookup calls are trying using
<ROUTER IP>and1.1.1.1with failures, then resolves successfully. Might dagger select a specific NS and try only this one for a set amount of time or w/e ?marcosnils commentedon Feb 5, 2024
Would you run this command again please (#2228 (comment)) with the VPN conneted but separate the outputs clearly? from your output I cant easily tell what's coming from where.
kema-dev commentedon Feb 5, 2024
Sorry for this, here are the outputs:
Bare alpine:
Dagger engine:
Same outputs 🤷
kema-dev commentedon Feb 18, 2024
Did some work on another project using alpine, looks like DNS servers gets me troubles too. The error seems not to be related to Dagger.
marcosnils commentedon Feb 28, 2024
good to know @kema-dev! we're here if you need us!