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

choco command stopped working #825

Closed
KurtPfeifle opened this issue Jun 23, 2016 · 10 comments
Closed

choco command stopped working #825

KurtPfeifle opened this issue Jun 23, 2016 · 10 comments

Comments

@KurtPfeifle
Copy link

Please have a look at the following series of commands I've been executing:

win@KP-W10-01 C:\Users\win
$ echo %prompt%
$E[m$E[32m$E]9;8;"USERNAME"$E\@$E]9;8;"COMPUTERNAME"$E\$S$E[92m$P$E[90m$_$E[90m$$$E[m$S$E]9;12$E\

win@KP-W10-01 C:\Users\win
$ choco outdated
Cannot find file at '../choco.exe' (C:\ProgramData\chocolatey\choco.exe). This usually indicates a missing or moved file.

win@KP-W10-01 C:\Users\win
$ which choco
C:\ProgramData\chocolatey\bin\choco.exe

win@KP-W10-01 C:\Users\win
$ choco list --lo
Cannot find file at '../choco.exe' (C:\ProgramData\chocolatey\choco.exe). This usually indicates a missing or moved file.

win@KP-W10-01 C:\Users\win
$ C:\ProgramData\chocolatey\bin\choco.exe list --lo
Cannot find file at '../choco.exe' (C:\ProgramData\chocolatey\choco.exe). This usually indicates a missing or moved file.

win@KP-W10-01 C:\Users\win
$ dir C:\ProgramData\chocolatey\bin\choco.exe
 Volume in Laufwerk C: hat keine Bezeichnung.
 Volumeseriennummer: 0082-3AE5

 Verzeichnis von C:\ProgramData\chocolatey\bin

17.06.2016  22:16           142.480 choco.exe
               1 Datei(en),        142.480 Bytes
               0 Verzeichnis(se), 179.041.488.896 Bytes frei

win@KP-W10-01 C:\Users\win                                                                                              
$ \pa\gnuwin32\bin\file.exe C:\ProgramData\chocolatey\bin\choco.exe                                                     
C:\ProgramData\chocolatey\bin\choco.exe; PE32 executable for MS Windows (console) Intel 80386 32-bit Mono/.Net assembly

win@KP-W10-01 C:\Users\win
$

Please note how I tried to execute choco.exe with a full path as C:\ProgramData\chocolatey\bin\choco.exe. However the error message suggests, that it tried to execute C:\ProgramData\chocolatey\choco.exe instead!

WTF?!? I don't understand that...

@ferventcoder
Copy link
Member

It appears your choco.exe (actual, not the shim in the bin directory) may have disappeared?

@ferventcoder
Copy link
Member

So you have C:\ProgramData\chocolatey\choco.exe that is the actual binary. And then you have a shimmed exe at C:\ProgramData\chocolatey\bin\choco.exe. The actual binary, does it exist?

@KurtPfeifle
Copy link
Author

So you have C:\ProgramData\chocolatey\choco.exe that is the actual binary. And then you have a shimmed exe at C:\ProgramData\chocolatey\bin\choco.exe. The actual binary, does it exist?

You're the expert, I'm just a stupid user.

I don't know (yet) what a "shimmed exe" is nor what it is suppose do do -- where is it documented?

Anyway, here are the contents of c:\programdata\chocolatey\bin:

PS C:\Users\win> dir C:\ProgramData\Chocolatey\
    Verzeichnis: C:\ProgramData\Chocolatey
Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       18.06.2016     15:36                bin
d-----       02.01.2016     16:42                ChocolateyInstall
d-----       20.06.2016     01:18                config
d-----       07.06.2016     23:03                extensions
d-----       20.06.2016     01:19                helpers
d-----       20.06.2016     01:19                lib
d-----       18.06.2016     15:36                lib-bad
d-----       20.06.2016     01:15                lib-bkp
d-----       11.05.2016     10:04                license
d-----       18.06.2016     15:15                logs
d-----       20.06.2016     01:19                redirects
d-----       20.06.2016     01:19                tools
-a----       17.06.2016     22:16              0 choco.exe.ignore
-a----       17.06.2016     22:16        6918800 choco.exe.old
-a----       28.12.2015     08:59         203486 googleearthinstall.log
-a----       17.06.2016     22:16            620 LICENSE.txt
-a----       25.03.2016     00:48             81 yed.cmd

Please tell, if this list contains the expected set of files (aside from the missing choco.exe)?

(I'll try to rename the .exe.old file and see if it executes to upgrade+repair chocolatey.)

@KurtPfeifle
Copy link
Author

Ok, the renaming workaround seems to have worked...

I still wonder what may have caused the problem.

@KurtPfeifle
Copy link
Author

I don't know (yet) what a "shimmed exe" is nor what it is suppose do do -- where is it documented?

Nevermind, I found something which I'll have to read first before asking further questions:

@ferventcoder
Copy link
Member

You're the expert, I'm just a stupid user.

I'm not really keen to that terminology. It was more about understanding if the file went missing or not.

@ferventcoder
Copy link
Member

Seems like an upgrade of Chocolatey may have failed and there was no more choco.exe. If you wouldn't mind, can you provide a zip of your logs folder to ferventcoder at gmail so I can review to see if it is a bug in the installer?

@KurtPfeifle
Copy link
Author

Seems like an upgrade of Chocolatey may have failed and there was no more choco.exe.

It happened again: just now, when upgrading 0.9.10.2 -> 0.9.10.3.

In PowerShell, I see this:

[....]
Chocolatey upgraded 1/323 packages. 8 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Upgraded:
 - chocolatey v0.9.10.3
Failures
 - manictime.install - manictime.install not upgraded. An error occurred during installation:
 Updating 'manictime.install 3.5.1' to 'manictime.install 3.6.3' failed. Unable to find a version of 'manictime' that is compatible with 'manictime.install 3.6.3'.
 - vim-tux (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\vim-tux\tools\chocolateyinstall.ps1'.
 See log for details.
 - googlechrome (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\GoogleChrome\tools\chocolateyInstall.ps1'.
 See log for details.
 - libreoffice-help (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\libreoffice-help\tools\chocolateyInstall.ps1'.
 See log for details.
 - unetbootin (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\unetbootin\tools\chocolateyInstall.ps1'.
 See log for details.
 - vim-tux.install (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\vim-tux.install\tools\chocolateyinstall.ps1'.
 See log for details.
 - xnviewmp.install (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\xnviewmp.install\tools\chocolateyInstall.ps1'.
 See log for details.
 - vcredist2008 - vcredist2008 not upgraded. An error occurred during installation:
 Updating 'vcredist2008 9.0.21022.8' to 'vcredist2008 9.0.30729.6161' failed. Unable to find a version of 'xnviewmp.install' that is compatible with 'vcredist2008 9.0.30729.6161'.
PS C:\Users\win> choco upgrade libreoffice-help googlechrome vim-tux.install -y
Cannot find file at '../choco.exe' (C:\ProgramData\chocolatey\choco.exe). This usually indicates a missing or moved file.
PS C:\Users\win>

I'll send you the logs....

@ferventcoder
Copy link
Member

From the logs it appears this is due to multiple choco.exe processes being run at the same time and pending #198 deleting the Chocolatey package out of lib before it has had a chance to complete. 0.9.10.3 added #822 to address a small window of wait time but it can still cause this if you run multiple choco.exe processes at the same time.

@ferventcoder
Copy link
Member

@KurtPfeifle is this still an issue or did we resolve this?

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

3 participants