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

Error when following learn_powerpipe instructions #478

Open
jheidbrink opened this issue Aug 29, 2024 · 6 comments
Open

Error when following learn_powerpipe instructions #478

jheidbrink opened this issue Aug 29, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@jheidbrink
Copy link

Powerpipe version (powerpipe -v)
v0.4.2

To reproduce

@jheidbrink jheidbrink added the bug Something isn't working label Aug 29, 2024
@jheidbrink
Copy link
Author

Note that replacing powerpipe with steampipe in the powerpipe mod ... commands, and running steampipe dashboard instead of powerpipe server works

@pskrbasu
Copy link
Collaborator

@jheidbrink We don't maintain the steampipe and powerpipe Nix packages. I suggest you install Powerpipe using brew(mac) or the installer(linux & wsl) and see if you still get the same error while running powerpipe server. Let me know how It goes.

Meanwhile, I'll try to install it from Nix and see if I can replicate your error.

Thanks

@jheidbrink
Copy link
Author

When using the sh $(curl ...) way of installing Steampipe and Powerpipe, powerpipe server works. It looks like this is specific to the Nix package.

@jheidbrink
Copy link
Author

jheidbrink commented Sep 17, 2024

I noticed that on Debian with the sh "$(curl ...) installation, the powerpipe server command creates and populates the ~/.powerpipe/dashboard/assets folder. On NixOS, the folder is created but not populated. If I copy the files from Debian to NixOS, powerpipe server runs on NixOS as well.

@jheidbrink
Copy link
Author

jheidbrink commented Sep 18, 2024

I took a look at the source code and I believe one important difference between the Nix build and the official build is that the official build process sets the builtBy variable to "goreleaser" whereas the Nix build leaves the default value of "local".

This leads to different behaviour in

if localcmdconfig.IsLocal() {
if err := verifyAssetsExist(ctx); err != nil {
return sperr.New("during development, dashboard assets must be present when running powerpipe dashboard")
}
return nil
}

The official build then goes on to extract an assets.tar.gz to ~/.powerpipe/dashboard/assets:

tarGz, err := staticFS.Open(embeddedAssetArchiveName)
if err != nil {
return sperr.WrapWithMessage(err, "could not open embedded dashboard assets archive")
}
defer tarGz.Close()
err = extractTarGz(ctx, tarGz, reportAssetsPath)
if err != nil {
return sperr.WrapWithMessage(err, "could not extract embedded dashboard assets archive")

I haven't figured out in which folder it is looking for assets.tar.gz though and how the file is created in the first place, maybe someone can shed some light on this.

@pskrbasu
Copy link
Collaborator

@jheidbrink

I haven't figured out in which folder it is looking for assets.tar.gz though and how the file is created in the first place, maybe someone can shed some light on this.

The assets are built in this step in the Release workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants