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

dns issues building images in my own GCP project #125

Open
bhearsum opened this issue Jan 19, 2024 · 0 comments
Open

dns issues building images in my own GCP project #125

bhearsum opened this issue Jan 19, 2024 · 0 comments

Comments

@bhearsum
Copy link
Contributor

I end up with:

googlecompute.generic_translations_gcp: Provisioning with shell script: scripts/ubuntu-jammy/30-packages.sh
==> googlecompute.generic_translations_gcp: sudo: unable to resolve host packer-65aa977a-59b8-4252-80cc-a5074a4d73eb: Name or service not known
==> googlecompute.generic_translations_gcp:
==> googlecompute.generic_translations_gcp: # init helpers
==> googlecompute.generic_translations_gcp: helpers_dir=${MONOPACKER_HELPERS_DIR:-"/etc/monopacker/scripts"}
==> googlecompute.generic_translations_gcp: + helpers_dir=/etc/monopacker/scripts
==> googlecompute.generic_translations_gcp: for h in ${helpers_dir}/.sh; do
==> googlecompute.generic_translations_gcp: . $h;
==> googlecompute.generic_translations_gcp: done
==> googlecompute.generic_translations_gcp: + for h in ${helpers_dir}/
.sh
==> googlecompute.generic_translations_gcp: + . /etc/monopacker/scripts/funcs.sh
==> googlecompute.generic_translations_gcp: #!/bin/bash
==> googlecompute.generic_translations_gcp:
==> googlecompute.generic_translations_gcp: set -ex
==> googlecompute.generic_translations_gcp: ++ set -ex
==> googlecompute.generic_translations_gcp: set +v
==> googlecompute.generic_translations_gcp: ++ set +v
==> googlecompute.generic_translations_gcp: ++ log_dir=/var/log/monopacker/scripts
==> googlecompute.generic_translations_gcp: ++ set -v
==> googlecompute.generic_translations_gcp:
==> googlecompute.generic_translations_gcp: retry apt-get update
==> googlecompute.generic_translations_gcp: + retry apt-get update
==> googlecompute.generic_translations_gcp: + set +e
==> googlecompute.generic_translations_gcp: + local n=0
==> googlecompute.generic_translations_gcp: + local max=5
==> googlecompute.generic_translations_gcp: + true
==> googlecompute.generic_translations_gcp: + apt-get update
==> googlecompute.generic_translations_gcp: Failed to start apt-news.service: Transaction for apt-news.service/start is destructive (systemd-sysusers.service has 'stop' job queued, but 'start' is included in transaction).
==> googlecompute.generic_translations_gcp: See system logs and 'systemctl status apt-news.service' for details.
==> googlecompute.generic_translations_gcp: Failed to start esm-cache.service: Transaction for esm-cache.service/start is destructive (systemd-fsck@dev-disk-by\x2dlabel-UEFI.service has 'stop' job queued, but 'start' is included in transaction).
==> googlecompute.generic_translations_gcp: See system logs and 'systemctl status esm-cache.service' for details.

It seems like this may be somewhat intermittent. I thought I could fix it with:

diff --git a/scripts/ubuntu-jammy/02-grub.sh b/scripts/ubuntu-jammy/02-grub.sh
index 5b7af5a..e042545 100644
--- a/scripts/ubuntu-jammy/02-grub.sh
+++ b/scripts/ubuntu-jammy/02-grub.sh
@@ -32,10 +32,12 @@ cat "${GRUB_INFILE}"
 rm -rf "${TMP_DIR}" 2>/dev/null
 
 # FIXME does not exist?
 # shown here https://launchpad.net/ubuntu/+source/linux-signed/4.15.0-58.64
 # retry apt-get install -y linux-image-$KERNEL_VERSION-dbgsym
 
 # Shutdown and wait forever; packer will consider this script to have finished and
 # start on the next script when it reconnects
+cat /etc/resolv.conf
+echo 'nameserver 8.8.8.8' > /etc/resolv.conf
 shutdown -r now
 while true; do sleep 1; done

...which worked once, but the error kept happening again after that.

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

1 participant