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

log_util.py[ERROR]: Cloud-init 24.4-0ubuntu1~20.04.1 received SIGTERM, #5944

Open
ritikgohate opened this issue Dec 26, 2024 · 3 comments
Open
Labels
bug Something isn't working correctly incomplete Action required by submitter

Comments

@ritikgohate
Copy link

Bug report

Since the release of new update i.e 24.4. We are receiving " log_util.py[ERROR]: Cloud-init 24.4-0ubuntu1~20.04.1 received SIGTERM," which has affected our startup script's execution flow. Before this release, we were able to provisioning new VMs and even rebuild was flawless.

Steps to reproduce the problem

Building a new Ubuntu VM or Rebuilding the existing one.

Environment details

  • Cloud-init version: 24.4-0ubuntu1~20.04.1
  • Operating System Distribution: 20.04-
  • Cloud provider, platform or installer type: Google Cloud Platform

cloud-init logs

2024-12-25 08:10:10,581 - performance.py[DEBUG]: Writing to console took 0.264 seconds
2024-12-25 08:10:10,581 - log_util.py[ERROR]: Cloud-init 24.4-0ubuntu1~20.04.1 received SIGTERM, exiting...
Filename: /usr/lib/python3.8/subprocess.py
Function: _try_wait
Line number: 1764
Filename: /usr/lib/python3.8/subprocess.py
Function: _wait
Line number: 1806
Filename: /usr/lib/python3.8/subprocess.py
Function: wait
Line number: 1083
2024-12-25 08:10:10,581 - performance.py[DEBUG]: Running ['/var/lib/cloud/instance/scripts/part-001'] took 48.635 seconds
2024-12-25 08:10:10,582 - handlers.py[DEBUG]: finish: modules-final/config-scripts_user: FAIL: running config-scripts_user with frequency once-per-instance
2024-12-25 08:10:10,582 - main.py[ERROR]: failed stage modules-final
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 927, in status_wrapper
ret = functor(name, args)
File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 767, in main_modules
return run_module_section(mods, name, name)
File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 145, in run_module_section
(which_ran, failures) = mods.run_section(full_section_name)
File "/usr/lib/python3/dist-packages/cloudinit/config/modules.py", line 379, in run_section
return self._run_modules(active_mods)
File "/usr/lib/python3/dist-packages/cloudinit/config/modules.py", line 295, in _run_modules
ran, _r = cc.run(
File "/usr/lib/python3/dist-packages/cloudinit/cloud.py", line 60, in run
return self._runners.run(name, functor, args, freq, clear_on_fail)
File "/usr/lib/python3/dist-packages/cloudinit/helpers.py", line 156, in run
results = functor(**args)
File "/usr/lib/python3/dist-packages/cloudinit/config/cc_scripts_user.py", line 38, in handle
subp.runparts(runparts_path)
File "/usr/lib/python3/dist-packages/cloudinit/subp.py", line 371, in runparts
subp(prefix + [exe_path], capture=False)
File "/usr/lib/python3/dist-packages/cloudinit/subp.py", line 272, in subp
out, err = sp.communicate(data, timeout=timeout)
File "/usr/lib/python3.8/subprocess.py", line 1020, in communicate
self.wait()
File "/usr/lib/python3.8/subprocess.py", line 1083, in wait
return self._wait(timeout=timeout)
File "/usr/lib/python3.8/subprocess.py", line 1806, in _wait
(pid, sts) = self._try_wait(0)
File "/usr/lib/python3.8/subprocess.py", line 1764, in _try_wait
(pid, sts) = os.waitpid(self.pid, wait_flags)
File "/usr/lib/python3/dist-packages/cloudinit/signal_handler.py", line 48, in _handle_exit
sys.exit(rc)
SystemExit: 1
2024-12-25 08:10:10,605 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)

@ritikgohate ritikgohate added bug Something isn't working correctly new An issue that still needs triage labels Dec 26, 2024
@ritikgohate
Copy link
Author

At least, let us know how can we avoid using 24.4 version while provisioning new VMs ? We want to provision new VMs with cloud-init 24.3.1only.

@TheRealFalcon
Copy link
Member

In order to diagnose your issue, please run cloud-init collect-logs and upload the results here.

At least, let us know how can we avoid using 24.4 version while provisioning new VMs ? We want to provision new VMs with cloud-init 24.3.1only.

It's hard to know what you're asking for here without understand your provisioning process. If you're asking how to downgrade cloud-init in Ubuntu, you can see the available versions in apt with

apt list -a cloud-init

and then downgrade with

sudo apt install cloud-init=<version>

@TheRealFalcon TheRealFalcon added incomplete Action required by submitter and removed new An issue that still needs triage labels Jan 10, 2025
@Thanzex
Copy link

Thanzex commented Jan 31, 2025

@TheRealFalcon I am encountering the same error.
While provisioning a few Ubuntu 22.04 VMs, I was getting a SIGTERM while installing packages on all of them, cloud-init status --long often would not report errors, but I could see in the logs the SIGTERM and the error while installing.

I found this bug on Launchpad which seems it could be related.
Adding package_reboot_if_required: false seems to have fixed the problem on most VMs, but on one in particular i keep consistently getting this same error.
While installing quite a bit of packages, cloud-init fails midway, leaving the machine with a few of the packages installed and working and some missing.

Running cloud-init single --name cc_package_update_upgrade_install --frequency always works without issue and installs the missing packages.

This is a slimmed version of my cloud-init script

Here's the logs
cloud-init-redacted.tar.gz

Just as @ritikgohate said, Do you know if there's a way to downgrade cloud-init in-place before running the package installs? I'd rather not download, customize and reupload a cloud-image just for this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly incomplete Action required by submitter
Projects
None yet
Development

No branches or pull requests

3 participants