Page MenuHomeVyOS Platform

Build Causes Errors When "--version" Contains Slashes ("/")
Closed, ResolvedPublicBUG

Description

When building vyos with build-vyos-image, if there is a / in the --version argument, the build process will fail and throws the following error:

P: Build completed successfully
Traceback (most recent call last):
  File "/vyos/./build-vyos-image", line 517, in <module>
I: Checking if packages required for VyOS image build are installed
    shutil.copy("live-image-{0}.hybrid.iso".format(build_config["architecture"]),
  File "/usr/lib/python3.11/shutil.py", line 419, in copy
build/config
I: Cleaning the build workspace
I: Setting up additional APT entries
I: Configuring live-build
I: Starting image build
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.11/shutil.py", line 258, in copyfile
    with open(dst, 'wb') as fdst:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'vyos-test/current-amd64.iso'

This is due to the final copying did not check for any / in the version string.

Details

Difficulty level
Easy (less than an hour)
Version
1.4.0-epa2
Why the issue appeared?
Implementation mistake
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Revisions and Commits

Event Timeline

I have also created a pull request that fixes this issue: https://github.com/vyos/vyos-build/pull/543

Viacheslav changed the task status from Open to In progress.Sun, Mar 31, 11:10 AM
Viacheslav assigned this task to rts-kotori.
Viacheslav triaged this task as Normal priority.
c-po changed Why the issue appeared? from Will be filled on close to Implementation mistake.
GitHub <[email protected]> closed this task as Resolved by committing Restricted Diffusion Commit.Sat, Apr 13, 10:37 AM
GitHub <[email protected]> added a commit: Restricted Diffusion Commit.