pixie icon indicating copy to clipboard operation
pixie copied to clipboard

dev_dns_updater execution result exception

Open tuninger opened this issue 3 years ago • 4 comments

After executing the following command, No host records are generated in the /etc/hosts file, is there something wrong with my understanding?

#./dev_dns_updater` --domain-name="dev.withpixie.dev" --kubeconfig=$HOME/.kube/config --n=plc INFO[0000] DNS Entries entries="dev.withpixie.dev, work.dev.withpixie.dev, segment.dev.withpixie.dev, docs.dev.withpixie.dev" service=cloud-proxy-service INFO[0000] DNS Entries entries=cloud.dev.withpixie.dev service=vzconn-service

tuninger avatar Jul 11 '22 11:07 tuninger

Hi, I'm encountering the same problem. I build the go module for dev_dns_updater, but when I run: ./dev_dns_updater --domain-name=guy.withpixie.ts --kubeconfig=$HOME/.kube/config --n=plc

it get's stuck trying to execute and no DNS records are generated:

INFO[0000] DNS Entries                                   entries="guy.withpixie.ts, work.guy.withpixie.ts" service=cloud-proxy-service
[sudo] password for root:
INFO[0002] Update                                        addr=X.X.X.X service=cloud-proxy-service

I'm running on a WSL ubuntu 22.04 machine. @tuninger did you solve this issue?

guybal avatar Jul 29 '24 06:07 guybal

@guybal did you enter your sudo password at the prompt? Would you be able to try running the script as root?

If that still doesn't fix your problem, it would be helpful if you could run the script under strace with the following command and provide the output:

sudo strace -f -o output.txt ./dev_dns_updater --domain-name=guy.withpixie.ts --kubeconfig=$HOME/.kube/config --n=plc

ddelnano avatar Jul 29 '24 08:07 ddelnano

Hi @ddelnano, Thanks for the quick reply.

I am running as root, and I did enter the password to the prompt (hence: INFO[0002] Update addr=X.X.X.X service=cloud-proxy-service output line).

I ran the command you supplied and here is the output.txt.

Take notice I ran the command against the correct domain name. I also exited the process after a few minutes.

Would appreciate your input, Thanks

guybal avatar Jul 29 '24 10:07 guybal

In the file you provided, it does look like there are updates to the /etc/hosts file. See the files where the cp commands are being run:

15336 execve("/usr/bin/sudo", ["sudo", "-S", "cp", "/tmp/hosts2870658131", "/etc/hosts"], 0xc000300080 /* 14 vars */ <unfinished ...>
15338 execve("/usr/bin/cp", ["cp", "/tmp/hosts2870658131", "/etc/hosts"], 0x55c3404d61b0 /* 14 vars */ <unfinished ...>

Is something managing your /etc/hosts file already? I noticed that when the file is being written, there is a comment that says this file was automatically generated? Maybe something is reverting the dev_dns_updater's changes?

15338 write(4, "# This file was automatically ge"..., 672) = 672

I would also try to see if those /tmp/hosts* files contain the content you expect. To further confirm if the dev_dns_updater is creating the right content.

ddelnano avatar Jul 29 '24 14:07 ddelnano