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

describe package failing in newer version #1797

Closed
sarahbakal opened this issue May 10, 2017 · 6 comments
Closed

describe package failing in newer version #1797

sarahbakal opened this issue May 10, 2017 · 6 comments
Labels
Type: Bug Feature not working as expected

Comments

@sarahbakal
Copy link

package

Description

running

describe package('WinZip 21.0') do
it { should be_installed }
end

working in Inspec 1.7.1 but fails in newer 1.19.1

InSpec and Platform Version

1.19.1

Replication Case

verifying installed application in multiple versions. Some work but most dont.

Possible Solutions

If you have already ideas how to solve the issue, add them here.

Stacktrace

See screenshot

@adamleff
Copy link
Contributor

adamleff commented Jun 2, 2017

@sarahbakal can you please add the screenshot you referenced in your issue description? I'm not 100% clear how this is failing so it would be helpful to determine where the failure lies before I try to reproduce it. Thanks!

@sarahbakal
Copy link
Author

@adamleff
Having trouble adding it.

@adamleff
Copy link
Contributor

adamleff commented Jun 2, 2017

@sarahbakal sent me the image directly via Slack, I'll take this one and dig into it.

@adamleff adamleff added Type: Bug Feature not working as expected and removed Awaiting Contributor labels Jun 2, 2017
@adamleff adamleff self-assigned this Jun 2, 2017
@adamleff
Copy link
Contributor

adamleff commented Jun 5, 2017

Hi @sarahbakal. I tried to reproduce this issue today but was unable to. It worked with one of the packages I already had installed in my test Windows VM, so I then installed WinZip v21 like you have on your machine, and it worked for me via the inspec shell:

 aleff@remaleff01  ~/projects/inspec   adamleff/fix-windows-package  be inspec shell --target winrm://vagrant@127.0.0.1 --password vagrant
Welcome to the interactive InSpec Shell
To find out how to use it, type: help

You are currently running on:

    OS platform:  Windows Server 2012 R2 Standard
    OS family:  windows
    OS release: 6.3.9600

inspec> describe package('WinZip 21.0') do
inspec>   it { should be_installed }
inspec> end

Profile: inspec-shell
Version: (not specified)

  System Package
     ✔  WinZip 21.0 should be installed

Test Summary: 1 successful, 0 failures, 0 skipped

Is it possible the user you're running InSpec with doesn't have access to see installed packages? I don't think that's the case based on your screenshots, but I'm grasping at straws.

This is the core Powershell command that's run under the covers, minus any filtering. What happens if you run this manually? Do you get any JSON output and is WinZip included in that output?

Get-ItemProperty (@("HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKCU:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*") | Where-Object { Test-Path $_ }) | Select-Object -Property DisplayName,DisplayVersion | ConvertTo-Json

@sarahbakal
Copy link
Author

The manual command works and has the package i'm looking for. I'll test it a bit more through the compliance server to see if its just this single server.

@sarahbakal
Copy link
Author

Localized issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants