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

multipass transfer only transfers half the file (every 2nd 32K block) #3892

Open
loop-evgeny opened this issue Jan 23, 2025 · 4 comments
Open
Labels
bug documentation needs triage Issue needs to be triaged

Comments

@loop-evgeny
Copy link

Describe the bug
Building a vagrant box with bartender fails, because only half of the ingredients.tar.gz file is transferred by multipass transfer.

To Reproduce

Run multipassd as root in one terminal window, and in another run:

UBUNTU_SERIES=noble
./ubuntu-bartender --livecd-rootfs-branch ubuntu/$UBUNTU_SERIES --build-provider multipass -- --series $UBUNTU_SERIES --image-target vagrant --project ubuntu-cpc

It fails (see below). Then:

debug_bartender_name=(name from ubuntu-bartender output above)
multipass transfer "ingredients.tar.gz" "$debug_bartender_name:ingredients.tar.gz"
multipass transfer "$debug_bartender_name:ingredients.tar.gz" "bad_ingredients.tar.gz"
diff ingredients.tar.gz bad_ingredients.tar.gz 

Expected behavior
No output (the files are the same).

Actual behavior

Binary files ingredients.tar.gz and bad_ingredients.tar.gz differ

Logs
I dit not get any logs or output from multipassd despite running with -V debug. It only produced output when terminated with Ctrl+C.

Additional info

  • OS: Linux Mint 22
  • multipass version: 1.16.0-dev.134+g637e43139
  • multipass info:
Name:           noted-ant-ubuntu-bartender
State:          Running
Snapshots:      0
IPv4:           10.196.80.87
Release:        **Ubuntu 20.04.6 LTS**
Image hash:     5c054e515add (Ubuntu 20.04 LTS)
CPU(s):         1
Load:           0.00 0.00 0.00
Disk usage:     1.6GiB out of 48.4GiB
Memory usage:   145.5MiB out of 7.8GiB
Mounts:         --

(This also seems weird, because I requested "noble" = 24.04)

  • multipass get local.driver: qemu

Additional context

Following https://documentation.ubuntu.com/public-images/en/latest/public-images-how-to/build-vagrant-with-bartender/ I built multipass from source (because I don't want to use snap). The build failed twice, by the way, and I had to sudo apt install ninja-build clang to fix it - would be nice to add those to the README.

I then ran multipassd as root in one terminal window, and in another ran:

UBUNTU_SERIES=noble
./ubuntu-bartender --livecd-rootfs-branch ubuntu/$UBUNTU_SERIES --build-provider multipass -- --series $UBUNTU_SERIES --image-target vagrant --project ubuntu-cpc

This failed:

Launched: noted-ant-ubuntu-bartender
Preparing ingredients... in /home/em/ubuntu-bartender-multipass.FryRQJvSQB
UBUNTU_OLD_FASHIONED_DIR is not set, cloning https://github.com/ubuntu-bartenders/ubuntu-old-fashioned.git to /home/em/ubuntu-bartender-multipass.FryRQJvSQB/ubuntu-old-fashioned ...
LIVECD_ROOTFS_DIR is not set, cloning https://git.launchpad.net/livecd-rootfs to /home/em/ubuntu-bartender-multipass.FryRQJvSQB/livecd-rootfs ...
uploading ingredients.tar.gz to noted-ant-ubuntu-bartender ...
extracting ingredients.tar.gz in noted-ant-ubuntu-bartender ...

gzip: stdin: invalid compressed data--crc error

gzip: stdin: invalid compressed data--length error
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

To investigate further I opened a shell with multipass exec bash and saw that the ingredients.tar.gz file in the VM is about half the size of the original file on the host. I then reproduced this by uploading the file with multipass transfer myself (without bartender).

@loop-evgeny loop-evgeny added bug needs triage Issue needs to be triaged labels Jan 23, 2025
@loop-evgeny
Copy link
Author

Original file: ingredients.tar.gz
File retrieved after uploading: bad_ingredients.tar.gz

Note that it is not truncated, but rather every second 32 KB block seems to have been transferred somehow!

@loop-evgeny
Copy link
Author

loop-evgeny commented Jan 23, 2025

Tried to build the release/1.15 branch instead of HEAD and cmake failed with

CMake Error at CMakeLists.txt:162 (message):
  You need to set MULTIPASS_UPSTREAM for a release build.

  Use an empty string to make local the authoritative repository.
Call Stack (most recent call first):
  CMakeLists.txt:216 (determine_version)

To a user, who is just trying to build multipass to run it, this message is unclear. How do I set MULTIPASS_UPSTREAM? I tried export MULTIPASS_UPSTREAM= but still got the same error. And what does "make local the authoritative repository" mean? Do I want to do that?

Searched PRs here and #1377 pointed me onto the right track: cmake ../ -DMULTIPASS_UPSTREAM= makes it work, but it would be nice to improve the message to something like: "If you're just building the release for personal use set this to an empty string by running cmake with -DMULTIPASS_UPSTREAM=".

@loop-evgeny
Copy link
Author

Got the release/1.15 branch built and this transfer bug did not happen there.

@giuliazanchi
Copy link
Contributor

Hi @loop-evgeny , thanks for the detailed report, I've passed this on to our engineering team. I've also added the "documentation" label as a reminder to review the build instructions in the README file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug documentation needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants