Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

[Enhancement] Smooth out the success/failure logging #154

Closed
ferventcoder opened this issue Sep 14, 2012 · 9 comments
Closed

[Enhancement] Smooth out the success/failure logging #154

ferventcoder opened this issue Sep 14, 2012 · 9 comments

Comments

@ferventcoder
Copy link
Contributor

Don't like seeing a bunch of those.

Also, tackle the idea of putting items into a holding cell until they are successfully installed.

@ghost ghost assigned ferventcoder Sep 14, 2012
@rismoney
Copy link
Contributor

Did you have an idea on holding cell?
Are you implying that any error in chocolateyinstall.ps1 does not unwind to a clean state upon error?

@ferventcoder
Copy link
Contributor Author

It just show up too many times per package (the errors are displayed more than once sometimes).

@ferventcoder
Copy link
Contributor Author

Same goes for success logging.

As far as the holding area, yeah, I think we install the packages to a holding area - when they are successful we copy them up (prior to running the exe locator).

@mwrock
Copy link
Contributor

mwrock commented Sep 14, 2012

The nice thing about the holding cell is that should solve the scenario where after an error occurs, chocolatey thinks that the package is installed.

@rismoney
Copy link
Contributor

The only "thinking" chocolatey does is check lib.
-force kills thinking

@mwrock
Copy link
Contributor

mwrock commented Sep 14, 2012

right. Do you think the expectation though is that if a package fails to install calling cinst without -force should not state that the package has already been installed? That was always mine and getting that message feels wrong. If the holding cell is deleted after a failure and nothing goes to lib in the end, then that should solve the issue.

@rismoney
Copy link
Contributor

are you suggesting then, that if there is a failure, then the $packagefolder then just be moved to something like \failures$packagefolder? i would think that it should also run chocolateyuninstall.ps1 with a silentlycontinue... There is no way to know the "impact" of errors since anything could have happened. Also worthy, is everything needs to get logged...

@mwrock
Copy link
Contributor

mwrock commented Sep 14, 2012

That's a good point on the uninstall. I was actually thinking that it just get deleted but your idea is much better.

@Redsandro
Copy link
Contributor

Some packages output an error message and then throw it.
Does this cause two out of three error messages?

    } catch {
        $errorMessage = "This package tried to do something stupid and has failed to install."
        Write-Error $errorMessage
        throw $errorMessage
  }

I don't know what Write-Error does besides writing the message, but if it includes the stack details, maybe that's where it goes wrong.

Just a thought.

-edit-

Other packages do

} catch {
    Write-ChocolateyFailure $name $($_.Exception.Message)
    throw   
}

But maybe it's irrelevant.

-edit-
Caught another one. Four (4) times the same error message. Skipping the errors itself, it does display line numbers to track down:

Write-Error : [ERROR] Exit code was '1'.
At C:\Common\Chocolatey\chocolateyInstall\helpers\functions\Start-ChocolateyProcessAsAdmin.ps1:46 char:5

[ERROR] [ERROR] Exit code was '1'.
At C:\Common\Chocolatey\chocolateyInstall\helpers\functions\Write-ChocolateyFailure.ps1:30 char:2

[ERROR] [ERROR] Exit code was '1'.
At C:\Common\Chocolatey\chocolateyInstall\helpers\functions\Write-ChocolateyFailure.ps1:30 char:2

Write-Error : Package did not install successfully: [ERROR] Exit code was '1'.
At C:\Common\Chocolatey\chocolateyInstall\functions\Chocolatey-NuGet.ps1:90 char:17

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants