Itxaka / kairos

:penguin: The immutable Linux meta-distribution for edge Kubernetes.
https://kairos.io
Apache License 2.0
1 stars 0 forks source link

Upgrade on alpine arm errors #14

Closed devstein closed 2 months ago

devstein commented 3 months ago
kairos-agent upgrade --source \
> oci:quay.io/kairos/alpine:3.19-standard-arm64-rpi4-v2.4.3-k3sv1.28.3-k3s1
WARNING: jsonschema: '' does not validate with file:///home/kairos/schema.json#/required: missing properties: 'users'
INFO[2024-01-10T20:08:27Z] kairos-agent version v2.6.2                  
WARN[2024-01-10T20:08:27Z] failed reading installation state: open /run/initramfs/cos-state/state.yaml: no such file or directory 
E0110 20:08:27.117404    2909 mount_linux.go:232] Mount failed: exit status 32
Mounting command: mount
Mounting arguments: -t auto -o rw /dev/sda2 /run/cos/state
Output: mount: /run/cos/state: mount(2) system call failed: No error information.
       dmesg(1) may have more information after failed mount system call.

ERRO[2024-01-10T20:08:27Z] Failed mounting device /dev/sda2 with label COS_STATE 
ERRO[2024-01-10T20:08:27Z] failed mounting %s partition: %vsda2mount failed: exit status 32
Mounting command: mount
Mounting arguments: -t auto -o rw /dev/sda2 /run/cos/state
Output: mount: /run/cos/state: mount(2) system call failed: No error information.
       dmesg(1) may have more information after failed mount system call. 
1 error occurred:
        * mount failed: exit status 32
Mounting command: mount
Mounting arguments: -t auto -o rw /dev/sda2 /run/cos/state
Output: mount: /run/cos/state: mount(2) system call failed: No error information.
       dmesg(1) may have more information after failed mount system call.

This is what the state directory looks like:

/home/kairos # ls -las /run/initramfs/cos-state/
total 36
 4 drwxr-xr-x 7 root root  4096 Jan 10 18:28 .
 0 drwxr-xr-x 3 root root    60 Jan  1  1970 ..
 4 drwxr-xr-x 2 root root  4096 Jan 10 18:28 cOS
 4 drwxr-xr-x 3 root root  4096 Jan 10 18:28 etc
 4 drwxr-xr-x 6 root root  4096 Jan 10 18:28 grub2
16 drwx------ 2 root root 16384 Jan 10 18:28 lost+found
 4 drwxr-xr-x 2 root root  4096 Jan 10 18:28 var
dosubot[bot] commented 3 months ago

To address the errors and warnings encountered during the upgrade on Alpine ARM using the kairos-agent upgrade command, follow these steps:

  1. Ensure Required Properties in Configuration:

    • The warning about missing properties ('users') indicates that the JSON schema validation requires a users section. Ensure your configuration includes this section:
      users:
      - name: "kairos"
      passwd: "kairos"
  2. Check Installation State:

    • The warning about failing to read the installation state suggests that the state file /run/initramfs/cos-state/state.yaml is missing. Ensure that the state is mounted correctly at /run/initramfs/cos-state and is read-only:
      stateAssertVM(vm, "state.mounted", "true")
      stateAssertVM(vm, "state.mount_point", "/run/initramfs/cos-state")
      stateAssertVM(vm, "state.read_only", "true")
      <sup>[[1]](https://github.com/Itxaka/kairos/blob/master/tests/autoinstall_test.go)</sup>
  3. Troubleshoot Mount Failures:

    • The mount failure (exit status 32) indicates an issue with mounting /dev/sda2 to /run/cos/state. Gather more information using the following diagnostic commands:
      df -h > /run/disk
      mount > /run/mounts
      blkid > /run/blkid
      dmesg > /run/dmesg.log
    • These commands will provide detailed information about disk usage, current mounts, block devices, and kernel messages, which are crucial for diagnosing mount failures [2].
  4. Verify Partition Labels and Sizes:

    • Ensure that the partition labels and sizes specified in your configuration match the actual device labels and available space. Incorrect labels or insufficient space can cause mount failures:
      stages:
      boot:
       - name: "Repart image"
         layout:
           device:
             label: COS_RECOVERY
           add_partitions:
             - fsLabel: COS_STATE
               size: 16240 # At least 16gb
               pLabel: state
      <sup>[[3]](https://github.com/Itxaka/kairos/blob/master/tests/assets/raw_image.yaml)</sup>

By following these steps, you should be able to resolve the errors and warnings encountered during the upgrade process on Alpine ARM using the kairos-agent upgrade command.

To continue talking to Dosu, mention @dosu.