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

couldn't extract plugin archive: zip: not a valid zip file #104

Closed
CloudWise-Lukemiao opened this issue Mar 14, 2023 · 2 comments
Closed

Comments

@CloudWise-Lukemiao
Copy link

When I execute the check plug-in command, docker run -- pull=always grafana/plugin-validator-cli http://xxx.zip Or docker run -- pull=always grafana/plugin-validator-cli - sourceCodeUri http://xxx http://xxxx/xx.zip There will be the following errors

image

@eh-am
Copy link
Contributor

eh-am commented Mar 17, 2023

Hi! Based on the error message, it couldn't extract the zip file

// Extract the ZIP archive in a temporary directory.
archiveDir, archiveCleanup, err := archivetool.ExtractPlugin(bytes.NewReader(b))
if err != nil {
logme.Errorln(fmt.Errorf("couldn't extract plugin archive: %w", err))
os.Exit(1)
}
defer archiveCleanup()

So worth checking, is it a real zip file? How are you packaging it?

Here's what I've used in my projects, which seems to work fine.

mv dist $MY-PLUGIN-ID
zip $MY-PLUGIN-ID.zip $MY-PLUGIN-ID -r

@academo
Copy link
Member

academo commented Apr 17, 2023

Hi @CloudWise-Lukemiao are you still having problems with this? I agree with @eh-am where it looks your zip file was corrupted or incorrectly packaged.

@academo academo closed this as completed Apr 20, 2023
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

3 participants