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

Uninstall throws error on path not found if the id nuspec file in lib folder and inside downloaded nupkg is different case #1040

Open
AdmiringWorm opened this issue Nov 7, 2016 · 15 comments

Comments

@AdmiringWorm
Copy link
Member

AdmiringWorm commented Nov 7, 2016

What You Are Seeing?

When uninstalling a package where the id in lib\packageName.nuspec and the nuspec file inside lib\packageName.nupkg have different casing, the uninstallation process throws an error
reporting that the lib\PackageName path was not found.

It does not matter if the uninstall script is run, or if it is skipped.

What is Expected?

No error even if the casing is different

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

I'll give an example with the InnoSetup package.
The casing on the website uses upper case I and S, while when I pushed
the package with all lowercase.
When that package is then installed, the casing of the id element in the nuspec file inside the downloaded nupkg file and the nuspec file in the lib folder are different causing the error of a path not found.

Output Log

https://gist.github.com/AdmiringWorm/bac515b64b3d4e22f5eba385b07efb5c

Tested with choco versions

choco 0.10.3 (Error occurred)
choco 0.10.2 (Error occurred)
choco 0.10.1 (No Error)

@ferventcoder
Copy link
Member

added this to next release.

@ferventcoder
Copy link
Member

I ran this with the latest beta and was not able to get it to occur. I am going to move this to next release and mark it back for triage.

@AdmiringWorm
Copy link
Member Author

@ferventcoder I don't suppose it would be possible to provide a beta release of choco?
I'm thinking this could have been solved in a previous commit, as I couldn't get it to occur either when building from the master branch previously (although I had to reuse my locally installed nuget cli, as I couldn't get the provided one to work correctly with restoring dev dependencies).

@ferventcoder
Copy link
Member

ferventcoder commented Mar 25, 2017

@AdmiringWorm there is a beta out now. However it is incompatible with the licensed edition. Something to keep in mind. Working on a fix for the incompatibility and will provide notice to all customers related to that.

@AdmiringWorm
Copy link
Member Author

I just tried with the latest available beta, and it is still happening for me.
I tested with version 5.5.9.20160928 of innosetup.

@AdmiringWorm
Copy link
Member Author

I can't seem to replicate the issue when debugging through visual studio though.

@ferventcoder ferventcoder modified the milestones: 0.10.6, 0.10.7 Apr 1, 2017
@johnypony3
Copy link

i just ran into this issue with v0.10.5 (latest currently)
my nuspec excerpt:

<id>paket</id>
<title>Paket</title>

the error on uninstall:

Failures

  • paket (exited 1) - paket not uninstalled. An error occurred during uninstall:
    Unable to find package 'Paket'.

@AdmiringWorm
Copy link
Member Author

@ferventcoder have there been any update on this on what is causing this error?
Personally I'm still unable to reproduce when running choco through visual studio, but still happening when installing packages where current casing differ from original casing (only when the package have been installed from a remote source though).

@ferventcoder
Copy link
Member

@johnypony3 Can you post a gist of your full log output (you can find it in the chocolatey.log file or one of the numbered files)? Since this is quite difficult to recreate, it would be helpful.

@AdmiringWorm did you happen to notice this right before the error from your gist?
C:\ProgramData\chocolatey\lib\InnoSetup\tools\chocolateyUninstall.ps1.5.5.9.20160928

https://gist.github.com/AdmiringWorm/bac515b64b3d4e22f5eba385b07efb5c#file-chocouninstall-log-L316-L318

If the folder it is looking for the package in has changed to something like the above, that explains why it would not find the package.

@AdmiringWorm
Copy link
Member Author

@ferventcoder that certainly is odd (IMO). Unless choco changed the folder, the folder shouldn't have changed.
That uninstall log is from a pure install then uninstall on the choco-environment (without doing anything in between),

@johnypony3
Copy link

johnypony3 commented Jun 4, 2017 via email

@ferventcoder ferventcoder modified the milestones: 0.10.8, 0.10.7 Jun 6, 2017
@flcdrg
Copy link
Member

flcdrg commented Jul 19, 2017

I've seen this happen for a package that was originally created on Chocolatey.org with the id 'SqlToolbelt'. When I took over maintaining the package, I wrote my own nuspec with 'sqltoolbelt'. This caused uninstall fails like this - https://gist.github.com/choco-bot/711c5e276e9293c9069af01e916ccb86

Updating my nuspec to revert to the original casing caused the uninstall to pass - https://gist.github.com/choco-bot/9cac09aaaf23d8f649f7034398b0cea7)

@bcurran3
Copy link

I just ran into this bug yesterday with Chocolatey v0.10.7 Professional.

An easy way to duplicate this problem is with the current GNU Wget 1.19.1 package since it's small and fast to install/uninstall.

@ferventcoder ferventcoder modified the milestone: 0.10.8 Aug 27, 2017
@ferventcoder
Copy link
Member

Starting to wonder if this is in the nuget.core codebase instead.

@ferventcoder
Copy link
Member

ferventcoder commented Aug 27, 2017

I think the trick here is to start by installing a package with one case, then change case of the package and have an upgrade of that. Then upgrade. Then attempt uninstall.

@ferventcoder ferventcoder modified the milestones: 0.10.8, 0.10.9 Aug 29, 2017
ferventcoder added a commit that referenced this issue Sep 7, 2017
When uninstalling packages, attempt to use lower case as the local file
system could be having issues finding the package. Log more surrounding
what is going on to try to pinpoint the source of the issue. Also skip
removing files if they are already deleted.
ferventcoder added a commit that referenced this issue Sep 14, 2017
* stable:
  (version) 0.10.9-beta
  (GH-1400) API - Ensure one instance of GetChocolatey
  (GH-1399) uninstall - keep stored pkg information
  (maint) formatting/wording
  (GH-1398) Upgrade: Ignore unfound option
  (GH-1398) Use feature for ignore unfound pkgs
  (GH-1398) fix: specs
  (GH-1040) use lower case for uninstall / log more
  (GH-1398) outdated: ignore unfound
@ferventcoder ferventcoder modified the milestones: 0.10.9, 0.10.10 Mar 4, 2018
@ferventcoder ferventcoder modified the milestones: 0.10.10, 0.10.11 Mar 27, 2018
@ferventcoder ferventcoder modified the milestones: 0.10.11, 0.10.12 May 3, 2018
@ferventcoder ferventcoder modified the milestones: 0.10.12, 0.10.13, 0.10.14 Mar 13, 2019
@ferventcoder ferventcoder removed this from the 0.10.14 milestone Apr 1, 2019
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