Closed FeynmanZhou closed 8 months ago
If you use a text file as the plugin executable, the OS will return the same error message. Therefore, we may not be able to determine the detailed error of fork/exec, whether it is an OS architecture issue or not.
How about error message for notation-go:
plugin installation failed: failed to execute the get-plugin-metadata command for azure-kv plugin: fork/exec /tmp/notation-plugin28956171/notation-azure-kv: exec format error
And add the suggestion in the CLI side:
Error: plugin installation failed: failed to execute the get-plugin-metadata command for azure-kv plugin: fork/exec /tmp/notation-plugin28956171/notation-azure-kv: exec format error. Please ensure the plugin is executable on the current OS and compliant with the Notation plugin protocol. If the error persists, try reaching out to the plugin maintainers for help.
It seems not feasible to detect the OS/Arch information of the plugin during installation. Therefore, notation can only output generic error message regardless of in which error case under the current implementation. This is not helpful to notation
CLI users.
Is it possible to enable notation detect the OS/Arch information of the plugin during installation in future releases? In this way, we can generate much more actionable suggestions in the error message to users.
@JeyJeyGao
My suggested change for the error message from the notation
CLI:
Error: plugin installation failed: failed to execute the get-plugin-metadata command for azure-kv plugin: fork/exec /tmp/notation-plugin28956171/notation-azure-kv: exec format error.
Please ensure the plugin is executable on the current OS and compliant with the plugin installation requirements. If the error persists, try reaching out to the plugin maintainers for help.
Note that there is no concept "Notation plugin protocol" existed in Notary Project or plugin vendors. In general, plugin vendors and Notary Project maintainers publish the plugin installation requirements on the website. So the most straightforward way here is to remind users to re-check and follow the plugin installation requirements accordingly.
Error: plugin installation failed: failed to execute the get-plugin-metadata command for azure-kv plugin: fork/exec /tmp/notation-plugin28956171/notation-azure-kv: exec format error. Please ensure the plugin is executable and meet the installation requirements on the <OS/Arch>. If the error persists, try reaching out to the plugin maintainers for help.
How about this error message for Notation CLI? We can provide the OS and Arch in the recommandation.
The prompted recommendation in notation
CLI sounds good to me.
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.
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:Or even give a much intelligent prompt with a solution:
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