Skip to content

Improve notation plugin error message #867

@FeynmanZhou

Description

@FeynmanZhou

What is not working as expected?

This issue summarizes the error messages of notation plugin that I suggest improving in v1.1.x.

Negative case: install a plugin on a non-matching CPU architecture machine

I installed Notation AKV plugin (Linux_arm64 version) on an Linux_amd64 machine with Notation v1.1.0 (main branch). The error response is empty in stderr as follows. This empty error response also exists when I installed the AWS Signer plugin in a mismatched Arch.

$ notation plugin install --file notation-azure-kv_1.0.1_linux_arm64.tar.gz
···
Error: plugin installation failed: failed to get metadata of new plugin: ERROR: response is not in JSON format. error: fork/exec /tmp/notation-plugin1835003109/notation-azure-kv: exec format error, stderr:

What did you expect to happen?

Suggested change:

By following the Notation error message guidance, notation should prompt users that the architecture of the installing plugin is not matched with the machine:

$ notation plugin install --file notation-azure-kv_1.0.1_linux_arm64.tar.gz
···
Error: plugin installation failed: failed to get metadata of new plugin. exec format error, stderr: non-matching CPU architecture
Use a matched architecture of the plugin and try to install it again

Or even give a much intelligent prompt with a solution:

$ notation plugin install --file notation-azure-kv_1.0.1_linux_arm64.tar.gz
···
Error: plugin installation failed: failed to get metadata of new plugin. exec format error, non-matching CPU architecture
Use a matched architecture linux/amd64 of the plugin and try to install it again

How can we reproduce it?

See above

Describe your environment

Linux, Golang 21.06

What is the version of your notation-go Library?

v1.1.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions