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

fallocate command fails with 'invalid length value specified' using default swap size #38

Closed
mohsenari opened this issue Feb 5, 2024 · 5 comments

Comments

@mohsenari
Copy link

mohsenari commented Feb 5, 2024

I noticed our github actions started failing around 2 days ago and it keeps failing for the same reason. Looking into it, I noticed it's because the fallocate command in this github action is failing claiming invalid length value even though, we use the default swap size and haven't made any changes to our github actions. See the log below:

My guess is Github changing its ubuntu-latest version from 20.04 to 22.04 may have something to do with it.

Here is the link to our failed github action job.

Run easimon/maximize-build-space@v8
Run echo "Memory and swap:"
Memory and swap:
               total        used        free      shared  buff/cache   available
Mem:        16365024      607300    14552084       22820     1205640    15380000
Swap:        4194300           0     4194300

NAME          TYPE SIZE USED PRIO
/mnt/swapfile file   4G   0B   -2

Available storage:
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        73G   54G   20G  74% /
tmpfs           7.9G  172K  7.9G   1% /dev/shm
tmpfs           3.2G  1.1M  3.2G   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sdb15      105M  6.1M   99M   6% /boot/efi
/dev/sda1        74G  4.1G   66G   6% /mnt
tmpfs           1.6G   12K  1.6G   1% /run/user/1001

Run set -euo pipefail
Arguments:

  Root reserve:      40000 MiB
  Temp reserve:      10000 MiB
  Swap space:        4096 MiB
  Overprovision LVM: false
  Mount path:        /home/runner/work/devbox/devbox
  Root PV loop path: /pv.img
  Temp PV loop path: /mnt/tmp-pv.img
  Removing:     dotnet android haskell codeql 
Removing unwanted software... 
... done
Unmounting and removing swap file.
Creating LVM Volume.
  Creating LVM PV on root fs.
fallocate: invalid length value specified
Error: Process completed with exit code 1.

@mohsenari
Copy link
Author

I'm not super familiar with this github action but it seems like the issue is here

sudo touch "${{ inputs.pv-loop-path }}" && sudo fallocate -z -l "${ROOT_LVM_SIZE_BYTES}" "${{ inputs.pv-loop-path }}"

And the value for ${ROOT_LVM_SIZE_BYTES} seems to be incorrect.

@mohsenari
Copy link
Author

And lastly, this is our configuration for using this github action:

- name: Maximize build disk space
  uses: easimon/maximize-build-space@v8
  if: matrix.os == 'ubuntu-latest'
  with:
    root-reserve-mb: 40000
    temp-reserve-mb: 10000
    remove-dotnet: true
    remove-android: true
    remove-haskell: true
    remove-codeql: true

@DmitriyLewen
Copy link

DmitriyLewen commented Feb 5, 2024

Hello there!
We received the same error.
Our GitHub action broken run
Our configuration

My guess is Github changing its ubuntu-latest version from 20.04 to 22.04 may have something to do with it.

We have seen it work correctly on Ubuntu 22.04.
But i checked successful and broken runs:
image version changed:
successful run:

Runner Image
  Image: ubuntu-22.04
  Version: 20240126.1.0

broken run:

Runner Image
  Image: ubuntu-22.04
  Version: 20240201.1.0

@DmitriyLewen
Copy link

I investigated more.
Size of GitHub action ubuntu image has been reduce:
before:

Filesystem Size Used Avail Use% Mounted on 
/dev/root 84G 53G 31G 64% /

now:

Filesystem Size Used Avail Use% Mounted on 
/dev/root 73G 53G 21G 73% /

Also i played with root-reserve-mb. Size equal 32GB doesn't return error - aquasecurity/trivy#6064

@mohsenari
Copy link
Author

Can confirm reducing root-reserve-mb fixes my issue.
Will close this issue for now.

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

2 participants