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 output says "See logs for details" but doesn't indicate where those logs are located #1413

Open
SeanKilleen opened this issue Oct 1, 2017 · 20 comments

Comments

@SeanKilleen
Copy link
Contributor

SeanKilleen commented Oct 1, 2017

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

packageResult.Messages.Add(new ResultMessage(ResultType.Error, "Error while running '{0}'.{1} See log for details.".format_with(chocoPowerShellScript, Environment.NewLine)));

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.
@ferventcoder
Copy link
Member

ferventcoder commented Oct 2, 2017

  • 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:

this.Log().Warn(
() => @"{0}{1} {2} {3}/{4} packages. {5}{0} See the log for details ({6}).".format_with(
Environment.NewLine,
ApplicationParameters.Name,
actionName,
successes.Count(),
packageResults.Count,
(failures > 0) ? failures + " packages failed.": string.Empty,
_fileSystem.combine_paths(ApplicationParameters.LoggingLocation, ApplicationParameters.LoggingFile)
));

@ferventcoder
Copy link
Member

  • 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!

@monty241
Copy link

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.

@ferventcoder
Copy link
Member

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

@monty241
Copy link

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

@AdmiringWorm
Copy link
Member

@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)

@monty241
Copy link

@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.

@ferventcoder
Copy link
Member

Exemption from testing is a once thing.

@monty241
Copy link

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.

@gep13
Copy link
Member

gep13 commented Mar 22, 2019

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

@NicTanghe
Copy link

this is still hapening

@ferventcoder
Copy link
Member

Just reopened this since this has not yet been implemented.

@jayvdb
Copy link

jayvdb commented Jun 14, 2019

c.f. #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.

@ghost
Copy link

ghost commented Apr 2, 2021

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

@tomasfejfar
Copy link

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 :(

@samopolacek
Copy link

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

@theking2
Copy link

theking2 commented Apr 9, 2024

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.)

@pauby
Copy link
Member

pauby commented Apr 9, 2024

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

@theking2
Copy link

theking2 commented Apr 9, 2024

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

@pauby
Copy link
Member

pauby commented Apr 9, 2024

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

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