Skip to content

tedge-apt-plugin version mismatch error does not show the full package version #3671

@reubenmiller

Description

@reubenmiller

Describe the bug

Misleading error when the tedge-apt-plugin is installing a package, and the user provided version does not match the version contained in the debian package, however the error message only shows part of the version number instead of the full version when the version contains a Debian epoch prefix (e.g. 1:2.3.4).

Below shows a snippet taken from the Apama Repository package where the Version meta info is set to 1:26.0-1, however the user entered in 2006 as user-given version.

----- $ Downloading: https://download.cumulocity.com/Apama/Debian/apama-repo_26.0-1_all.deb to /tmp/apama-repo_2026 
----- $ /usr/bin/sudo "-n" "/etc/tedge/sm-plugins/apt" "update-list"
Exit status: 5 (ERROR)

stderr <<EOF
ERROR: Validation of /tmp/apama-repo_2026 metadata failed, expected value for the Version is  1, but provided  2026
EOF

stdout (EMPTY)

It seems to be a simple parsing bug were it is a assumed that the value part of each meta information line, {key}: {value}, does not contain a colon, :.

So if the package would have a version in the following format, then the error message would only contain the value 1 (which is misleading for the user).

Version: 1:2.3.4 => "1"

To Reproduce

Try installing any debian package which contains an epoch prefix in the version, and then try installing it using an incorrect version number in the software repository definition (to invoke the version mismatch scenario).

Expected behavior

The tedge-apt-plugin should show the full version as defined in the debian package which is being installed.

Screenshots

Environment (please complete the following information):

  • OS [incl. version]: any
  • Hardware [incl. revision]: any
  • System-Architecture [e.g. result of "uname -a"]: any
  • thin-edge.io version [e.g. 0.1.0]: 1.5.1

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions