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

upgrade - prerelease with dependencies that are also prerelease fails to upgrade #1957

Open
bc3tech opened this issue Nov 21, 2019 · 10 comments

Comments

@bc3tech
Copy link
Contributor

bc3tech commented Nov 21, 2019

What You Are Seeing?

I cannot upgrade a prerelease package which has a prerelease dependency w/o specifying -pre to choco upgrade

What is Expected?

chocolatey attempts to upgrade the package because it sees it's out of date - without -pre - so it should likewise update any prerelease dependencies

seealso my comment on #686

How Did You Get This To Happen? (Steps to Reproduce)

attempt choco upgrade vivaldi when an old prerelease package is installed

Output Log

Full Log Output

C:\Users\Brandon> cup vivaldi -y
Chocolatey v0.10.15 Professional
Upgrading the following packages:
vivaldi
By upgrading you accept licenses for the packages.

vivaldi not upgraded. An error occurred during installation:
 Unable to resolve dependency 'vivaldi.portable (= 2.9.1732.13-snapshot)'.
vivaldi package files upgrade completed. Performing other installation steps.
The upgrade of vivaldi was NOT successful.
vivaldi not upgraded. An error occurred during installation:
 Unable to resolve dependency 'vivaldi.portable (= 2.9.1732.13-snapshot)'.

Chocolatey upgraded 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - vivaldi (exited 1) - vivaldi not upgraded. An error occurred during installation:
 Unable to resolve dependency 'vivaldi.portable (= 2.9.1732.13-snapshot)'.
C:\Users\Brandon> cup vivaldi -y -pre
Chocolatey v0.10.15 Professional
Upgrading the following packages:
vivaldi
By upgrading you accept licenses for the packages.

You have vivaldi v2.9.1719.3-snapshot installed. Version 2.9.1732.13-snapshot is available based on your source(s).    Progress: Downloading vivaldi.portable 2.9.1732.13-snapshot... 100%
Progress: Downloading Vivaldi 2.9.1732.13-snapshot... 100%

vivaldi.portable v2.9.1732.13-snapshot
vivaldi.portable package files upgrade completed. Performing other installation steps.
Downloading vivaldi 64 bit
  from 'https://downloads.vivaldi.com/snapshot-auto/Vivaldi.2.9.1732.13.x64.exe'
Using download CDN cache instead of original url.

@ferventcoder
Copy link
Member

That's weird. I wonder if there are other things at play on this with the repository issues we've been having. Can we verify this against a source that is not https://chocolatey.org/api/v2?

@Gootjes
Copy link

Gootjes commented Jan 8, 2020

I am having the same issue with the jamovi package.
I verified this bug against a local source folder. Therefore, I can confirm that choco upgrade jamovi --pre works, but choco upgrade jamovi does not work. With the api as a source, there are no differences in web requests and responses either (as indicated by Fiddler). The nupkg is simply never downloaded when the command does not include --pre.

What is interesting, is that it does detect that the package is outdated (and therefore, also understands that the installation is a prelease).

I ran with --debug --trace and --verbose, but there is no additional log output before the error occurs, and it seems to occur in (the logic directly preceding) NuGet.

[NuGet] Attempting to resolve dependency 'jamovi.install (= 1.2.0.0-current)'.
jamovi not upgraded. An error occurred during installation:
    Unable to resolve dependency 'jamovi.install (= 1.2.0.0-current)'.

Running separate NuGet or Find-Package commands find the packages btw, although the nuget command output specifies the version differently than Find-Package (which one does choco use?)

.\nuget list jamovi -source 'https://chocolatey.org/api/v2' -prerelease
Find-Package jamovi -allowPrereleaseVersions -Source 'https://chocolatey.org/api/v2/'

@bc3tech
Copy link
Contributor Author

bc3tech commented Jan 8, 2020

That's weird. I wonder if there are other things at play on this with the repository issues we've been having. Can we verify this against a source that is not https://chocolatey.org/api/v2?

How would I do that?

@ferventcoder
Copy link
Member

Outdated and upgrade all specifically flips a switch on prereleases to do that. I would consider this an enhancement to allow upgrade do that if you have a prerelease installed. I think it would probably need to flip it on for the entire set of dependencies though.

@ferventcoder
Copy link
Member

Maybe a bug... I went back and reread the previous issue that made it work for a package being a prerelease being upgraded - it properly handles that aspect.

@bc3tech
Copy link
Contributor Author

bc3tech commented Feb 4, 2020

Not what I'm seeing...

cup [pkg] -y
C:\Users\brand> clist -lo vivaldi
Chocolatey v0.10.15 Professional
vivaldi 2.11.1805.3-snapshot
vivaldi.portable 2.11.1805.3-snapshot
2 packages installed.
C:\Users\brand> cup vivaldi -y
Chocolatey v0.10.15 Professional
Upgrading the following packages:
vivaldi
By upgrading you accept licenses for the packages.

You have vivaldi v2.11.1805.3-snapshot installed. Version 2.11.1811.3-snapshot is available based on your source(s).
vivaldi not upgraded. An error occurred during installation:
 Unable to resolve dependency 'vivaldi.portable (= 2.11.1811.3-snapshot)'.
vivaldi package files upgrade completed. Performing other installation steps.
The upgrade of vivaldi was NOT successful.
vivaldi not upgraded. An error occurred during installation:
 Unable to resolve dependency 'vivaldi.portable (= 2.11.1811.3-snapshot)'.

Chocolatey upgraded 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - vivaldi (exited 1) - vivaldi not upgraded. An error occurred during installation:   Unable to resolve dependency 'vivaldi.portable (= 2.11.1811.3-snapshot)'.
C:\Users\brand> cup vivaldi -y -pre
Chocolatey v0.10.15 Professional
Upgrading the following packages:
vivaldi
By upgrading you accept licenses for the packages.

You have vivaldi v2.11.1805.3-snapshot installed. Version 2.11.1811.3-snapshot is available based on your source(s).
Progress: Downloading Vivaldi 2.11.1811.3-snapshot... 100%

vivaldi.portable v2.11.1811.3-snapshot
vivaldi.portable package files upgrade completed. Performing other installation steps.File appears to be downloaded already. Verifying with package checksum to determine if it needs to be redownloaded.
Hashes match.
Virus check: 0/68 scan engines flagged this assembly.
 Due to possible false positives we fail at 4 minimum positives.
 Virus scan engines indicate this file is probably safe. For details see
  https://www.virustotal.com/file/edc135781ec2d699d9804e9bb36dab42a24794e6aa63beca2755b3565e8589ad/analysis/
Hashes match.
Installing Vivaldi.2.11.1811.3.x64.exe...
Vivaldi.2.11.1811.3.x64.exe has been installed.
  vivaldi.portable may be able to be automatically uninstalled.
 The upgrade of vivaldi.portable was successful.
  Software installed to 'C:\Users\brand\AppData\Local\Vivaldi\Application'

Vivaldi v2.11.1811.3-snapshot - Possibly broken
vivaldi package files upgrade completed. Performing other installation steps.
 The upgrade of vivaldi was successful.
  Software install location not explicitly set, could be in package or
  default install location if installer.

Chocolatey upgraded 2/2 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
cup all -y
C:\Users\brand> cup all -y
Chocolatey v0.10.15 Professional
Upgrading the following packages:
all
By upgrading you accept licenses for the packages.
...
You have vivaldi v2.11.1805.3-snapshot installed. Version 2.11.1811.3-snapshot is available based on your source(s).
vivaldi not upgraded. An error occurred during installation:
 Unable to resolve dependency 'vivaldi.portable (= 2.11.1811.3-snapshot)'.
vivaldi package files upgrade completed. Performing other installation steps.
The upgrade of vivaldi was NOT successful.
vivaldi not upgraded. An error occurred during installation:
 Unable to resolve dependency 'vivaldi.portable (= 2.11.1811.3-snapshot)'.

You have vivaldi.portable v2.11.1805.3-snapshot installed. Version 2.11.1811.3-snapshot is available based on your source(s).
vivaldi.portable not upgraded. An error occurred during installation:
 Updating 'vivaldi.portable 2.11.1805.3-snapshot' to 'vivaldi.portable 2.11.1811.3-snapshot' failed. Unable to find a version of 'vivaldi' that is compatible with 'vivaldi.portable 2.11.1811.3-snapshot'.
vivaldi.portable package files upgrade completed. Performing other installation steps.The upgrade of vivaldi.portable was NOT successful.
vivaldi.portable not upgraded. An error occurred during installation:
 Updating 'vivaldi.portable 2.11.1805.3-snapshot' to 'vivaldi.portable 2.11.1811.3-snapshot' failed. Unable to find a version of 'vivaldi' that is compatible with 'vivaldi.portable 2.11.1811.3-snapshot'.

Chocolatey upgraded 2/83 packages. 2 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

both appear broken w.r.t. this issue. #686 should be re-opened.

@ferventcoder
Copy link
Member

@bc3tech I explained why the issue won't get reopened already at #686 (comment)

So let's move past that and focus on this issue at hand. It looks like a bug, that prerelease dependencies are not also getting found for a prerelease.

@ferventcoder ferventcoder added this to the 0.10.16 milestone Feb 5, 2020
@ferventcoder ferventcoder changed the title choco upgrade doesn't upgrade prerelease dependencies upgrade - prerelease with dependencies that are also prerelease fails to upgrade Feb 5, 2020
@ferventcoder
Copy link
Member

That's weird. I wonder if there are other things at play on this with the repository issues we've been having. Can we verify this against a source that is not https://chocolatey.org/api/v2?

How would I do that?

Put all the nupkgs in the same folder locally and use -s . as part of upgrade.

@bc3tech
Copy link
Contributor Author

bc3tech commented Feb 5, 2020

doesn't appear to change things

C:\gh1957> ls


    Directory: C:\gh1957


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----         2/5/2020  12:03 PM           3410 vivaldi.2.11.1811.3-snapshot.nupkg
-a----         2/5/2020  12:03 PM           4227 vivaldi.portable.2.11.1811.3-snapshot.nupkg


C:\gh1957> clist -lo vivaldi
Chocolatey v0.10.15 Professional
vivaldi 2.11.1805.3-snapshot
vivaldi.portable 2.11.1805.3-snapshot
2 packages installed.
C:\gh1957> cup vivaldi -y -s .
Chocolatey v0.10.15 Professional
Upgrading the following packages:
vivaldi
By upgrading you accept licenses for the packages.

You have vivaldi v2.11.1805.3-snapshot installed. Version 2.11.1811.3-snapshot is available based on your source(s).
vivaldi not upgraded. An error occurred during installation:
 Unable to resolve dependency 'vivaldi.portable (= 2.11.1811.3-snapshot)'.
vivaldi package files upgrade completed. Performing other installation steps.
The upgrade of vivaldi was NOT successful.
vivaldi not upgraded. An error occurred during installation:
 Unable to resolve dependency 'vivaldi.portable (= 2.11.1811.3-snapshot)'.

Chocolatey upgraded 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - vivaldi (exited 1) - vivaldi not upgraded. An error occurred during installation:
 Unable to resolve dependency 'vivaldi.portable (= 2.11.1811.3-snapshot)'.

@ferventcoder
Copy link
Member

Good, that validates the issue is an issue. Thanks for that @bc3tech. I've marked this up as a bug and to be reviewed with the next release. This does have a workaround, but that workaround is not optimal. So hopefully this will be easy to find and fix.

@pauby pauby modified the milestones: 0.10.16, 0.10.x May 11, 2021
@vexx32 vexx32 modified the milestones: 0.11.x, Future, Future_ Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants