Skip to content

AL2023 Consistently Failing to boot #3741

Closed

Description

@jkruse14

I have been trying to upgrade to the latest major version, specifically 5.6.2 from 4.7.0 (lambda versions were updated too); however, the instances consistently fail to boot when using AL2023. The default AMI is used (as of this writing, ami-0a3c3a20c09d6f377)

While debugging, I run tail -f /var/log/user-data.log to see what information the script is giving. I consistently see RPM failing, but in different spots along the way, but with the same message when installing dependencies, here is an example:

image

When this message is printed, the boot up stalls out and nothing happens. The instances is eventually brought down by the scale down lambda.

I looked for out of memory errors as described here using the following:

$ sudo journalctl -p err | grep -i "out of memory"

and

$ sudo dmesg | grep -i "out of memory"

I did not find any messages relating "to out of memory"

In the journalctl, I did find this error:

image

I'm not sure if that message is relevant.

I've also found this issue in amazon-linux-2023's repo that seems relevant:
amazonlinux/amazon-linux-2023#397

Please let me know if I can provide any additional information.

Additional Log Information:

<13>Jan 26 19:02:10 user-data: Un-tar action runner
<13>Jan 26 19:02:17 user-data: Delete tar file
<13>Jan 26 19:02:17 user-data: OS: "amzn" "fedora"
[   87.371493] systemd-sysv-generator[20854]: SysV service '/etc/rc.d/init.d/cfn-hup' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[   87.386192] zram_generator::config[20856]: zram0: system has too much memory (7833MB), limit is 800MB, ignoring.
<13>Jan 26 19:02:18 user-data: Last metadata expiration check: 0:00:31 ago on Fri Jan 26 19:01:47 2024.
<13>Jan 26 19:02:19 user-data: Dependencies resolved.
<13>Jan 26 19:02:19 user-data: ================================================================================
<13>Jan 26 19:02:19 user-data:  Package      Architecture Version                      Repository         Size
<13>Jan 26 19:02:19 user-data: ================================================================================
<13>Jan 26 19:02:19 user-data: Installing:
<13>Jan 26 19:02:19 user-data:  libicu       x86_64       67.1-7.amzn2023.0.3          amazonlinux       9.6 M
<13>Jan 26 19:02:19 user-data: 
<13>Jan 26 19:02:19 user-data: Transaction Summary
<13>Jan 26 19:02:19 user-data: ================================================================================
<13>Jan 26 19:02:19 user-data: Install  1 Package
<13>Jan 26 19:02:19 user-data: 
<13>Jan 26 19:02:19 user-data: Total download size: 9.6 M
<13>Jan 26 19:02:19 user-data: Installed size: 33 M
<13>Jan 26 19:02:19 user-data: Downloading Packages:
<13>Jan 26 19:02:19 user-data: libicu-67.1-7.amzn2023.0.3.x86_64.rpm            40 MB/s | 9.6 MB     00:00    
<13>Jan 26 19:02:19 user-data: --------------------------------------------------------------------------------
<13>Jan 26 19:02:19 user-data: Total                                            27 MB/s | 9.6 MB     00:00     
<13>Jan 26 19:02:19 user-data: Running transaction check
<13>Jan 26 19:02:19 user-data: Transaction check succeeded.
<13>Jan 26 19:02:19 user-data: Running transaction test
[   88.532985] systemd-sysv-generator[21456]: SysV service '/etc/rc.d/init.d/cfn-hup' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[   88.543461] zram_generator::config[21476]: zram0: system has too much memory (7833MB), limit is 800MB, ignoring.
<13>Jan 26 19:02:19 user-data: Transaction test succeeded.
<13>Jan 26 19:02:19 user-data: Running transaction
<13>Jan 26 19:02:19 user-data: RPM: error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Resource temporarily unavailable)
<13>Jan 26 19:02:19 user-data: The downloaded packages were saved in cache until the next successful transaction.
<13>Jan 26 19:02:20 user-data: You can remove cached packages by executing 'dnf clean packages'.
<13>Jan 26 19:02:20 user-data: Error: Could not run transaction.
[   89.072760] cloud-init[1855]: 2024-01-26 19:02:20,177 - cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
[   99.829792] cloud-init[1853]: 2024-01-26 19:13:08,236 - util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python3.9/site-packages/cloudinit/config/cc_scripts_user.py'>) failed

Additional log info to show it's not always in the same place (fails with libicu above). I included more here, to the point of the SIGTERM. However, the log above looked the same.

<13>Jan 26 19:01:10 user-data: Amazon Linux 2023 repository                     36 MB/s |  23 MB     00:00    


Amazon Linux 2023
Kernel 6.1.72-96.166.amzn2023.x86_64 on an x86_64 (-)

ip-172-16-160-19 login: <13>Jan 26 19:01:26 user-data: Amazon Linux 2023 Kernel Livepatch repository   340 kB/s | 165 kB     00:00    
<13>Jan 26 19:01:27 user-data: Last metadata expiration check: 0:00:01 ago on Fri Jan 26 19:01:26 2024.
<13>Jan 26 19:01:29 user-data: Dependencies resolved.
<13>Jan 26 19:01:29 user-data: Nothing to do.
<13>Jan 26 19:01:29 user-data: Complete!
<13>Jan 26 19:01:30 user-data: Last metadata expiration check: 0:00:04 ago on Fri Jan 26 19:01:26 2024.
<13>Jan 26 19:01:30 user-data: Dependencies resolved.
<13>Jan 26 19:01:30 user-data: ================================================================================
<13>Jan 26 19:01:30 user-data:  Package                  Arch     Version                  Repository     Size
<13>Jan 26 19:01:30 user-data: ================================================================================
<13>Jan 26 19:01:30 user-data: Installing:
<13>Jan 26 19:01:30 user-data:  docker                   x86_64   24.0.5-1.amzn2023.0.3    amazonlinux    42 M
<13>Jan 26 19:01:30 user-data: Installing dependencies:
<13>Jan 26 19:01:30 user-data:  containerd               x86_64   1.7.11-1.amzn2023.0.1    amazonlinux    35 M
<13>Jan 26 19:01:30 user-data:  iptables-libs            x86_64   1.8.8-3.amzn2023.0.2     amazonlinux   401 k
<13>Jan 26 19:01:30 user-data:  iptables-nft             x86_64   1.8.8-3.amzn2023.0.2     amazonlinux   183 k
<13>Jan 26 19:01:30 user-data:  libcgroup                x86_64   3.0-1.amzn2023.0.1       amazonlinux    75 k
<13>Jan 26 19:01:30 user-data:  libnetfilter_conntrack   x86_64   1.0.8-2.amzn2023.0.2     amazonlinux    58 k
<13>Jan 26 19:01:30 user-data:  libnfnetlink             x86_64   1.0.1-19.amzn2023.0.2    amazonlinux    30 k
<13>Jan 26 19:01:30 user-data:  libnftnl                 x86_64   1.2.2-2.amzn2023.0.2     amazonlinux    84 k
<13>Jan 26 19:01:30 user-data:  pigz                     x86_64   2.5-1.amzn2023.0.3       amazonlinux    83 k
<13>Jan 26 19:01:30 user-data:  runc                     x86_64   1.1.7-1.amzn2023.0.3     amazonlinux   3.0 M
<13>Jan 26 19:01:30 user-data: 
<13>Jan 26 19:01:30 user-data: Transaction Summary
<13>Jan 26 19:01:30 user-data: ================================================================================
<13>Jan 26 19:01:30 user-data: Install  10 Packages
<13>Jan 26 19:01:30 user-data: 
<13>Jan 26 19:01:30 user-data: Total download size: 81 M
<13>Jan 26 19:01:30 user-data: Installed size: 309 M
<13>Jan 26 19:01:30 user-data: Downloading Packages:
<13>Jan 26 19:01:31 user-data: (1/10): libnfnetlink-1.0.1-19.amzn2023.0.2.x86_ 220 kB/s |  30 kB     00:00    
<13>Jan 26 19:01:31 user-data: (2/10): pigz-2.5-1.amzn2023.0.3.x86_64.rpm      4.0 MB/s |  83 kB     00:00    
<13>Jan 26 19:01:31 user-data: (3/10): iptables-libs-1.8.8-3.amzn2023.0.2.x86_ 2.2 MB/s | 401 kB     00:00    
<13>Jan 26 19:01:31 user-data: (4/10): iptables-nft-1.8.8-3.amzn2023.0.2.x86_6 5.8 MB/s | 183 kB     00:00    
<13>Jan 26 19:01:31 user-data: (5/10): runc-1.1.7-1.amzn2023.0.3.x86_64.rpm     13 MB/s | 3.0 MB     00:00    
<13>Jan 26 19:01:31 user-data: (6/10): libnftnl-1.2.2-2.amzn2023.0.2.x86_64.rp 1.9 MB/s |  84 kB     00:00    
<13>Jan 26 19:01:31 user-data: (7/10): libnetfilter_conntrack-1.0.8-2.amzn2023 2.4 MB/s |  58 kB     00:00    
<13>Jan 26 19:01:31 user-data: (8/10): libcgroup-3.0-1.amzn2023.0.1.x86_64.rpm 3.8 MB/s |  75 kB     00:00    
<13>Jan 26 19:01:31 user-data: (9/10): containerd-1.7.11-1.amzn2023.0.1.x86_64  53 MB/s |  35 MB     00:00    
<13>Jan 26 19:01:32 user-data: (10/10): docker-24.0.5-1.amzn2023.0.3.x86_64.rp  44 MB/s |  42 MB     00:00    
<13>Jan 26 19:01:32 user-data: --------------------------------------------------------------------------------
<13>Jan 26 19:01:32 user-data: Total                                            60 MB/s |  81 MB     00:01     
[   35.963422] systemd-sysv-generator[2085]: SysV service '/etc/rc.d/init.d/cfn-hup' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[   36.006309] zram_generator::config[2087]: zram0: system has too much memory (7833MB), limit is 800MB, ignoring.
<13>Jan 26 19:01:33 user-data: [Errno 2] No such file or directory: '/var/cache/dnf/amazonlinux-4d57537f6d85fd5f/packages/libcgroup-3.0-1.amzn2023.0.1.x86_64.rpm'
<13>Jan 26 19:01:33 user-data: The downloaded packages were saved in cache until the next successful transaction.
<13>Jan 26 19:01:33 user-data: You can remove cached packages by executing 'dnf clean packages'.
[   36.691981] cloud-init[1856]: 2024-01-26 19:01:33,812 - cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
[   36.693530] cloud-init[1856]: 2024-01-26 19:01:33,814 - util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python3.9/site-packages/cloudinit/config/cc_scripts_user.py'>) failed
ci-info: no authorized SSH keys fingerprints found for user ec2-user.
<14>Jan 26 19:01:33 cloud-init: #############################################################
<14>Jan 26 19:01:33 cloud-init: -----BEGIN SSH HOST KEY FINGERPRINTS-----
REDACTED
<14>Jan 26 19:01:33 cloud-init: -----END SSH HOST KEY FINGERPRINTS-----
<14>Jan 26 19:01:33 cloud-init: #############################################################
-----BEGIN SSH HOST KEY KEYS-----
REDACTED
-----END SSH HOST KEY KEYS-----
[   36.907172] cloud-init[1856]: Cloud-init v. 22.2.2 finished at Fri, 26 Jan 2024 19:01:34 +0000. Datasource DataSourceEc2.  Up 36.89 seconds
[�[0;1;31mFAILED�[0m] Failed to start �[0;1;39mcloud-fina� Execute cloud user/final scripts.
[   38.010176] zram_generator::config[2158]: zram0: system has too much memory (7833MB), limit is 800MB, ignoring.
[   38.046105] systemd-sysv-generator[2156]: SysV service '/etc/rc.d/init.d/cfn-hup' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[   47.463502] systemd-sysv-generator[2192]: SysV service '/etc/rc.d/init.d/cfn-hup' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[   47.511184] zram_generator::config[2194]: zram0: system has too much memory (7833MB), limit is 800MB, ignoring.
[   48.163914] systemd-sysv-generator[2225]: SysV service '/etc/rc.d/init.d/cfn-hup' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[   48.209683] zram_generator::config[2227]: zram0: system has too much memory (7833MB), limit is 800MB, ignoring.
[   49.349448] zram_generator::config[2264]: zram0: system has too much memory (7833MB), limit is 800MB, ignoring.
[   49.363459] systemd-sysv-generator[2262]: SysV service '/etc/rc.d/init.d/cfn-hup' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
2024/01/26 19:01:46Z: Amazon SSM Agent v3.2.2143.0 is running
2024/01/26 19:01:46Z: OsProductName: Amazon Linux
2024/01/26 19:01:46Z: OsVersion: 2023
2024/01/26 19:01:58Z: Amazon SSM Agent v3.2.2143.0 is running
2024/01/26 19:01:58Z: OsProductName: Amazon Linux
2024/01/26 19:01:58Z: OsVersion: 2023
[   60.663834] systemd-sysv-generator[2357]: SysV service '/etc/rc.d/init.d/cfn-hup' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[   60.721989] zram_generator::config[2359]: zram0: system has too much memory (7833MB), limit is 800MB, ignoring.
[ 1177.024652] kauditd_printk_skb: 72 callbacks suppressed
[ 1177.024655] audit: type=1305 audit(1706296834.501:426): op=set audit_pid=0 old=1322 auid=4294967295 ses=4294967295 subj=system_u:system_r:auditd_t:s0 res=1
[ 1177.029384] audit: type=1334 audit(1706296834.521:427): prog-id=114 op=UNLOAD
[ 1177.031180] audit: type=1131 audit(1706296834.521:428): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=auditd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 1177.034967] audit: type=1131 audit(1706296834.521:429): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-tmpfiles-setup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 1177.053038] audit: type=1131 audit(1706296834.531:430): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-fsck@dev-disk-by\x2duuid-94FC\x2dEE88 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 1177.059741] audit: type=1131 audit(1706296834.551:431): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-remount-fs comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 1177.063208] audit: type=1131 audit(1706296834.551:432): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-fsck-root comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 1177.066665] audit: type=1131 audit(1706296834.551:433): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-tmpfiles-setup-dev comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 1177.070187] audit: type=1130 audit(1706296834.551:434): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-poweroff comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 1177.073686] audit: type=1131 audit(1706296834.551:435): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-poweroff comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 1177.233759] systemd-shutdown[1]: Syncing filesystems and block devices.
[ 1177.249415] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
[ 1177.255155] systemd-journald[847]: Received SIGTERM from PID 1 (systemd-shutdow).

These lines seem suspect:

[   36.691981] cloud-init[1856]: 2024-01-26 19:01:33,812 - cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
[   36.693530] cloud-init[1856]: 2024-01-26 19:01:33,814 - util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python3.9/site-packages/cloudinit/config/cc_scripts_user.py'>) failed

Activity

  1. jkruse14 commented on Feb 2, 2024

    @jkruse14
    ContributorAuthor

    There seems to be a race condition somewhere. I continue to mostly see the errors above, but I have seen one job get past libicu and successfully connect to GH:
    image

  2. jkruse14 commented on Feb 2, 2024

    @jkruse14
    ContributorAuthor

    Also, for what it's worth, it looks like yum handled the retry logic natively:
    image

  3. npalm commented on Feb 20, 2024

    @npalm
    Member

    closing the Issue since the PR is merged. Feel free to re-open if there is any need

  4. jkruse14 commented on Mar 6, 2024

    @jkruse14
    ContributorAuthor

    @npalm - I'm still seeing this issue:
    image

    Note: it's not failing at libicu, but I've seen it fail there and the retry logic not get run. I'm not doing anything special, so it's hard to believe this is a "me only" issue, but if it isn't, I'd expect other people to be running into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions