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

appimage-builder InvalidVersion(f"Invalid version: '{version}'") #324

Open
afl-dev opened this issue Oct 7, 2023 · 7 comments
Open

appimage-builder InvalidVersion(f"Invalid version: '{version}'") #324

afl-dev opened this issue Oct 7, 2023 · 7 comments

Comments

@afl-dev
Copy link

afl-dev commented Oct 7, 2023

appimage-builder
INFO:main:Running main script
INFO:main:Running apt deploy
INFO:apt:apt-get update
Get:1 https://dl.google.com/linux/chrome/deb stable InRelease [1,825 B]
Ign:1 https://dl.google.com/linux/chrome/deb stable InRelease                                          
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]                               
Get:3 http://us.archive.ubuntu.com/ubuntu jammy InRelease [270 kB]                                                
Get:4 https://ppa.launchpadcontent.net/appimagelauncher-team/stable/ubuntu jammy InRelease [24.4 kB]              
Ign:4 https://ppa.launchpadcontent.net/appimagelauncher-team/stable/ubuntu jammy InRelease      
Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Get:5 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Ign:3 http://us.archive.ubuntu.com/ubuntu jammy InRelease
Get:6 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]
Ign:5 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:6 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease
Fetched 632 kB in 2s (290 kB/s)
Reading package lists... Done
W: GPG error: https://dl.google.com/linux/chrome/deb stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB27DB2A3B88B8B
W: The repository 'https://dl.google.com/linux/chrome/deb stable InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: https://ppa.launchpadcontent.net/appimagelauncher-team/stable/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4AF9B16F75EF2FCA
W: The repository 'https://ppa.launchpadcontent.net/appimagelauncher-team/stable/ubuntu jammy InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://security.ubuntu.com/ubuntu jammy-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
W: The repository 'http://security.ubuntu.com/ubuntu jammy-security InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://us.archive.ubuntu.com/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
W: The repository 'http://us.archive.ubuntu.com/ubuntu jammy InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
W: The repository 'http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
W: The repository 'http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Traceback (most recent call last):
  File "/usr/local/bin/appimage-builder", line 8, in <module>
    sys.exit(__main__())
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/__main__.py", line 50, in __main__
    invoker.execute(commands)
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/invoker.py", line 29, in execute
    command()
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/commands/apt_deploy.py", line 46, in __call__
    deployed_packages = apt_deploy.deploy(
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/modules/deploy/apt/deploy.py", line 39, in deploy
    self._prepare_apt_venv()
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/modules/deploy/apt/deploy.py", line 55, in _prepare_apt_venv
    apt_core_packages = self._remove_old_packages(apt_core_packages)
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/modules/deploy/apt/deploy.py", line 93, in _remove_old_packages
    if package > latest_packages[pkg_tuple]:
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/modules/deploy/apt/package.py", line 79, in __gt__
    return version.parse(self.version) > version.parse(other.version)
  File "/usr/local/lib/python3.10/dist-packages/packaging/version.py", line 54, in parse
    return Version(version)
  File "/usr/local/lib/python3.10/dist-packages/packaging/version.py", line 200, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: '1.21.1ubuntu2.1'
@afl-dev
Copy link
Author

afl-dev commented Oct 8, 2023

resolved gpg error

      key_url: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C
      key_url: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x4AF9B16F75EF2FCA
      key_url: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x4EB27DB2A3B88B8B

there is still an error

Traceback (most recent call last):
  File "/usr/local/bin/appimage-builder", line 8, in <module>
    sys.exit(__main__())
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/__main__.py", line 50, in __main__
    invoker.execute(commands)
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/invoker.py", line 29, in execute
    command()
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/commands/apt_deploy.py", line 46, in __call__
    deployed_packages = apt_deploy.deploy(
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/modules/deploy/apt/deploy.py", line 39, in deploy
    self._prepare_apt_venv()
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/modules/deploy/apt/deploy.py", line 55, in _prepare_apt_venv
    apt_core_packages = self._remove_old_packages(apt_core_packages)
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/modules/deploy/apt/deploy.py", line 93, in _remove_old_packages
    if package > latest_packages[pkg_tuple]:
  File "/usr/local/lib/python3.10/dist-packages/appimagebuilder/modules/deploy/apt/package.py", line 79, in __gt__
    return version.parse(self.version) > version.parse(other.version)
  File "/usr/local/lib/python3.10/dist-packages/packaging/version.py", line 54, in parse
    return Version(version)
  File "/usr/local/lib/python3.10/dist-packages/packaging/version.py", line 200, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: '1.21.1ubuntu2.1'

@afl-dev
Copy link
Author

afl-dev commented Oct 8, 2023

@dungeon-slave
Copy link

Did you manage to solve this problem?

@cabiste-dev
Copy link
Contributor

you need to set the version in the recipe according to the sementic versioning standard

so if you're app is version 2.3 you need to write it v2.3.0 in the recipe file

@daa
Copy link

daa commented Oct 30, 2023

For those who is interested: appimage-builder uses packaging module to parse versions which implements versioning specific to Python but it is not the same as for Debian packages: 1.21.1ubuntu2.1 is valid version for Debian package but invalid from the point of view of Python packaging. The offending package seems to be dpkg or its relative (libdpkg-perl or dpkg-dev) - in Ubuntu 22.04 it has version 1.21.1ubuntu2.2 in jammy-updates repository, 1.21.1ubuntu2.1 in jammy-security and 1.21.1ubuntu2 in jammy.

@daa
Copy link

daa commented Oct 30, 2023

The issue should have been solved by 728998d but it's not released yet.

@dungeon-slave
Copy link

For those who is interested: appimage-builder uses packaging module to parse versions which implements versioning specific to Python but it is not the same as for Debian packages: 1.21.1ubuntu2.1 is valid version for Debian package but invalid from the point of view of Python packaging. The offending package seems to be dpkg or its relative (libdpkg-perl or dpkg-dev) - in Ubuntu 22.04 it has version 1.21.1ubuntu2.2 in jammy-updates repository, 1.21.1ubuntu2.1 in jammy-security and 1.21.1ubuntu2 in jammy.

Yeah, i have same problem and search how to solve it. But i dont have a lot of experience in appimage packaging and my solution was to set up ubuntu-18 on virtual box and to try package appimages with builder on it

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

4 participants