Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
'pgutil upack install' fails when feed has non semver versions
-
Issue:
Runningpgutil upack install --source=my-repo --feed=my-feed --target=.\upack\ --package=MyPackageName --version=0.0.2-199100
I had a universal package with a version that does not conform to Semver (it contained an underscore) in my ProGet universal feed and got an exception (see below). Based on the exception I assumed there is an issue in how I write the version in the pgutil upack command. I did not realise the issue was that the feed has a non compliant package.Suggested easy fix:
Include the string that failed to parse in the exception message in file Inedo.ProGet.UniversalPackages.UniversalPackageVersion.cs on line 295 like soerror = $"String '{s ?? string.Empty}' is not a valid semantic version.";
.
This should make it easy for the user to figure out what is going on.Unhandled exception. System.ArgumentException: String is not a valid semantic version. at Inedo.ProGet.UniversalPackages.UniversalPackageVersion.Parse(String s) in /_/Inedo.ProGet/UniversalPackages/UniversalPackageVersion.cs:line 107 at PgUtil.Program.UpackCommand.GetPackageAsync(CommandContext context, CancellationToken cancellationToken) in /_/pgutil/Upack/UpackCommand.cs:line 146 at PgUtil.Program.UpackCommand.GetPackageAsync(CommandContext context, CancellationToken cancellationToken) in /_/pgutil/Upack/UpackCommand.cs:line 144 at PgUtil.Program.UpackCommand.InstallCommand.ExecuteAsync(CommandContext context, CancellationToken cancellationToken) in /_/pgutil/Upack/InstallCommand.cs:line 46 at ConsoleMan.Command.ExecuteAsync(String[] args) at PgUtil.Program.Main(String[] args) in /_/pgutil/Program.cs:line 38 at PgUtil.Program.<Main>(String[] args)
Suggested alternative fix:
pgutil upack install can deal with non semver packages on the feed and just does not install them. upack already knows not to match to them because the user provided parameter is already validated to be semver compliant.
-
By the way, thank you for hosting the source code publicly. I would not have been able to figure this out otherwise.
-
@lukas-christel_6718 just a heads up we're a bit slammed with ProGet 2025 release but will respond soon!
-
You mentioned that your version had an underscore in it, but the command you referenced does not have an underscore. Is this something that once you add a package with a bad version, then any package fails to install, any version of a package with the same group and name fails to install, or just the specific package with the bad version fails to install? Also, can you please send us the bad version that you uploaded to the feed? Once we have that information, we should be able to reproduce your issue and get a fix out for you.
Thanks,
Dan
-
The issue occurs when I try to install a package that complies with semver. The presence of a package with a non-semver version is enough to fail the installation of other packages with the same name (maybe all other packages with the same name). Installing a package from the same feed with a different name still succeeds.
I manually created demo packages to reproduce the issue. I first uploaded the bad version to the proget feed (don't know if that matters) through the manual file upload in the web interface, then the good version. The issue occurs when I try to install the good version.
The issue happens when pgutil tries to parse the available versions on the server (see call stack in first post) AFTER it already successfully parsed the requested version from the command.I couldn't find a general file upload. Here are the upack.json used to create the demo packages
{ "name" : "DEMO-5418", "version" : "1.0.0-bad_version", "createdDate" : "2025-06-16T17:17:15Z" }
{ "name" : "DEMO-5418", "version" : "1.0.0-good-version", "createdDate" : "2025-06-16T17:18:10Z" }