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

Incorrect Service Install Path for Blackbox Exporter #8

Closed
andrewmostello opened this issue Jun 21, 2017 · 4 comments
Closed

Incorrect Service Install Path for Blackbox Exporter #8

andrewmostello opened this issue Jun 21, 2017 · 4 comments

Comments

@andrewmostello
Copy link

Unfortunately the current version of the package has an error.

The path used on line 34...

Start-ChocolateyProcessAsAdmin "install $ServiceName $(Join-Path $env:chocolateyPackageFolder "tools\prometheus-$PackageVersion.windows-amd64\prometheus.exe")" nssm

...is not where the exe is located. It's found instead at

tools\blackbox_exporter-$PackageVersion.windows-amd64\blackbox_exporter.exe

I'm not sure if this is something that would change again in the future, but I have a fix that should take care of this and any future changes.

ChrisMagnuson added a commit that referenced this issue Jun 21, 2017
Fix #8 - incorrect path to blackbox exporter
@ChrisMagnuson
Copy link
Member

Running choco upgrade prometheus-blackbox-exporter --version 0.5.0.20170621 -y I got the following:

C:\ProgramData\chocolatey\lib\prometheus-blackbox-exporter\tools
ERROR: Cannot process argument transformation on parameter 'fileFullPath'. Cannot convert value to type System.String.
The upgrade of prometheus-blackbox-exporter was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\prometheus-blackbox-exporter\tools\chocolateyinstall.ps1'.
 See log for details.

Chocolatey upgraded 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - prometheus-blackbox-exporter (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\prometheus-blackbox-exp
orter\tools\chocolateyinstall.ps1'.
 See log for details.

@ChrisMagnuson ChrisMagnuson reopened this Jun 21, 2017
@andrewmostello
Copy link
Author

Hmm, what did the log report? I ran the install process on the chocolatey test vagrant box but I didn't run through an upgrade.

@andrewmostello
Copy link
Author

It might be the case that during $File = Get-ChildItem -File -Path $env:ChocolateyInstall\lib\$packageName\tools\ -Filter *.tar it found multiple .tar files. That would account for the conversion to string error, since Get-ChildItem would return an array.

@ChrisMagnuson
Copy link
Member

Uninstalled and reinstalled and it worked without errors, hopefully that was just an issue on my side. Thanks for sending the pull request!

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

No branches or pull requests

2 participants