fluvio
fluvio copied to clipboard
Hub: Connector download need better error message if arch is not present
Error message when connector arch is not present: fluvio hub connector download infinyon/[email protected] Using hub https://hub.infinyon.cloud downloading infinyon/[email protected] to infinyon-duckdb-sink-0.1.0.ipkg Hub error: downloading infinyon/[email protected] failed Server: Downloading package Status(404
This should be something like:
Connector infinyon/[email protected] is not available for target `aarch64-unknown-linux-musl`.
However following targets are available:
- X86-64-unknown-linux-musl.
So the server response for this one doesn't provide enough granularity to distinguish between say a misnamed package vs. a package that doesn't support a particular platform. Example:
$ fluvio hub connector download infinyon/[email protected]
and
$ fluvio hub connector download --target i686-pc-windows-gnu infinyon/[email protected]
So simply returning available targets might mislead folks when the error is a simple misspelling.
I see a few ways to go about this:
- Make the error status from the server be a bit more granular, as in, distinguish between an unsupported platform vs. an actual 404 (say a misspelling) so that the CLI can provide the appropriate error message.
- Retrieve all available packages for various platforms first, cross check that with the
target, then proceed or error. This of course costs an extra network call. - Make a more general error message.
I don't believe that the codebase for the API is public so I wouldn't be able to do 1 without some help. If we go route 2, it would be of tremendous help if I could get some direction on how to query packages for a particular platform. If we go route 3, I'm open to suggestions on what the more general error message should be. I'm happy to provide a suggestion as well.
edit: Relevant piece of code
This is a solid assessment. Our package servers already have an index of all the packages already on the server side, so a hybrid of 1 and 2 would be to add a new endpoint (e.g. "connector/pkginfo") to return information about a particular package versions and supported arches.
Stale issue message