choco icon indicating copy to clipboard operation
choco copied to clipboard

Choco output says "See logs for details" but doesn't indicate where those logs are located

Open SeanKilleen opened this issue 8 years ago • 20 comments

I'm posting this issue mostly as grounds for a PR that I can contribute to adjust it.

I searched around but couldn't find any issues that currently exist for this.

Reproduction Steps

  • Run choco upgrade on a package that fails (my current example is RDCMan, which is failing for me with error 1603 -- irrelevant here though.
  • See the error message in the log
  • See a message that says "See log for details".

Expected behavior: See the location of the log files Actual Behavior: Only see the generic "see log for details" message.

Example of Error Encountered

Error while running 'C:\ProgramData\chocolatey\lib\rdcman\tools\chocolateyInstall.ps1'. See log for details.

Source of Message

https://github.com/chocolatey/choco/blob/0906be845e938b5deb610800f248fffabd9feca0/src/chocolatey/infrastructure.app/services/PowershellService.cs#L316

Fix Steps (I think)

This is what I'll be planning for my PR:

  • Understand how to obtain the log locations for chocolatey itself
  • Understand how to detect MSI or other logs emitted from packages, in case those logs would help.
  • Updating the format of the chocolatey error message to provide the log location(s) identified.
  • Tests to go along with it.

SeanKilleen avatar Oct 01 '17 23:10 SeanKilleen

  • Understand how to obtain the log locations for chocolatey itself

That message is captured at that location, but it shows up at the end summary right next to the location of the Chocolatey log file in the summary:

https://github.com/chocolatey/choco/blob/0906be845e938b5deb610800f248fffabd9feca0/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs#L821-L830

ferventcoder avatar Oct 02 '17 15:10 ferventcoder

  • Understand how to detect MSI or other logs emitted from packages, in case those logs would help.
  • Updating the format of the chocolatey error message to provide the log location(s) identified.

These could be helpful!

ferventcoder avatar Oct 02 '17 15:10 ferventcoder

I'm having the same problem, but then during automated validation. The chocolatey package installs fine when run from file and when running the MSI. But automated validation reports:

/norestart /l*v "C:\Users\Administrator\AppData\Local\Temp\chocolatey\invantive-estate-for-outlook-17.10.7-msi-install.log" ] exited with '1603'.
2017-10-11 17:57:56,300 2716 [ERROR] - ERROR: Running ["C:\Windows\System32\msiexec.exe" /i "C:\Users\Administrator\AppData\Local\Temp\chocolatey\invantive-estate-for-outlook\17.10.7\Invantive Estate for Outlook-17.10.7.msi" /qn /norestart /l*v "C:\Users\Administrator\AppData\Local\Temp\chocolatey\invantive-estate-for-outlook-17.10.7-msi-install.log" ] was not successful. Exit code was '1603'. See log for possible error messages.
 at Start-ChocolateyProcessAsAdmin, C:\ProgramData\chocolatey\helpers\functions\Start-ChocolateyProcessAsAdmin.ps1: line 276
at Install-ChocolateyInstallPackage, C:\ProgramData\chocolatey\helpers\functions\Install-ChocolateyInstallPackage.ps1: line 271
at Install-ChocolateyPackage, C:\ProgramData\chocolatey\helpers\functions\Install-ChocolateyPackage.ps1: line 336
at <ScriptBlock>, C:\ProgramData\chocolatey\lib\invantive-estate-for-outlook\tools\chocolateyinstall.ps1: line 19
at <ScriptBlock>, C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1: line 48
at <ScriptBlock>, <No file>: line 1

After that it reports:

Chocolatey installed 4/6 packages. 2 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

I've tried adding dotnet4.7 as dependency (which is correct), but didn't help.

I think the contents of C:\ProgramData\chocolatey\logs\chocolatey.log might easily be inserted into the logging of the automatic validation (not volunteering, just getting started with chocolatey).

Or even better that you could instruct the ps1 to output what log files itself created and that these would get inserted too.

For now, I will have to change our MSIs to log directly to a mother ship their problems.

monty241 avatar Oct 11 '17 18:10 monty241

@monty241 1603 - generic error (many times it is a pending restart).

ferventcoder avatar Oct 11 '17 20:10 ferventcoder

@ferventcoder I am aware of the very generic nature of 1603, but how can I get it automated tested / resolved when not sure?

monty241 avatar Oct 11 '17 21:10 monty241

@monty241 well one way would be to install what you think is the dependency, reboot, then install the software/package.

Other than that, it would be just trial and error (unless the MSI logs mention something else, which I doubt)

AdmiringWorm avatar Oct 11 '17 21:10 AdmiringWorm

@AdmiringWorm The installation on internal test devices across a range of Windows platforms (server and desktop editions) run fine (no 1603, silent mode). Only the automated tests when you upload a package are giving me a headache in terms of debugging what the issue is.

Now I would have to add an comment based upon this:

If the verifier is incompatible with the package, please log in and leave a review comment if the package needs to bypass testing (e.g. package installs specific drivers).

But that introduces extra work for the moderators. I prefer to be only once the famous pain during initial problem solving, instead of hindering the moderators with every new version.

monty241 avatar Oct 11 '17 22:10 monty241

Exemption from testing is a once thing.

ferventcoder avatar Oct 12 '17 04:10 ferventcoder

Ah great, that saves time for the moderators. I will have them skip now the tests. Maybe some day the chocolatey.log can be added to the gist :-)

Suggestion to change the following text:

`If the verifier is incompatible with the package, please log in and leave a review comment if the package needs to bypass testing (e.g. package installs specific drivers).

to

Please log in and leave a review comment requesting to have automatic testing skipped If the verifier is known to be incompatible with the package (e.g. package installs specific drivers). Once automatic testing is skipped, this also applies to new versions of the same package.

monty241 avatar Oct 12 '17 06:10 monty241

@SeanKilleen is there a reason that you closed this issue?

gep13 avatar Mar 22 '19 14:03 gep13

this is still hapening

NicTanghe avatar May 15 '19 21:05 NicTanghe

Just reopened this since this has not yet been implemented.

ferventcoder avatar May 15 '19 22:05 ferventcoder

c.f. https://github.com/chocolatey/choco/issues/187 also about the same request, and has people say it is still happening. Perhaps it has been done in some parts of the codebase and not others.

jayvdb avatar Jun 14 '19 10:06 jayvdb

Please implement this feature, I'm not able to see where is the mentioned log file (when a package upgrade fails).

ghost avatar Apr 02 '21 08:04 ghost

In my case git failed to install with this message. Couldn't find the log, so I killed the process after download and tried to run without "silent". Learned that it was an opened bash that the installer required to be closed. Anyway, it's really hard to debug these installation errors without proper error message :(

tomasfejfar avatar Nov 18 '22 07:11 tomasfejfar

Is there a way to make choco print the log to stdout?

samopolacek avatar Mar 27 '23 12:03 samopolacek

choco shows this also installing wamp-server .

(On a Microsoft Surface which I now realize is not supported... but choco did install all the prereq.)

theking2 avatar Apr 09 '24 12:04 theking2

@theking2 can you be clearer on what you mean by 'this'?

pauby avatar Apr 09 '24 13:04 pauby

choco install wamp-server -y

shows a path to the log file only after excuting it twice. First time it only suggest to show the log without pointing out where this log is

theking2 avatar Apr 09 '24 15:04 theking2

Can you provide a screenshot of both the first and second run?

pauby avatar Apr 09 '24 17:04 pauby