appimage-builder icon indicating copy to clipboard operation
appimage-builder copied to clipboard

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

Open afl-dev opened this issue 9 months ago • 7 comments

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 avatar Oct 07 '23 04:10 afl-dev

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 avatar Oct 08 '23 15:10 afl-dev

https://github.com/glpi-project/glpi-agent/commit/0818da1dee869aac8e799608ddaf85904a88a21f#diff-d5f06d670bde84f8c36ea555d2c4cc9cad1eca4710bc0273aa7f765aa2e75fc4

afl-dev avatar Oct 08 '23 18:10 afl-dev

Did you manage to solve this problem?

dungeon-slave avatar Oct 23 '23 12:10 dungeon-slave

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

cabiste69 avatar Oct 30 '23 13:10 cabiste69

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 avatar Oct 30 '23 23:10 daa

The issue should have been solved by https://github.com/AppImageCrafters/appimage-builder/commit/728998dc603b7a8e155fdc5d4c1295092edba9dd but it's not released yet.

daa avatar Oct 30 '23 23:10 daa

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

dungeon-slave avatar Nov 02 '23 12:11 dungeon-slave