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

CLI: improve trunk install handling of extension not found and version not found #873

Open
brianpursley opened this issue Dec 20, 2024 · 0 comments

Comments

@brianpursley
Copy link
Contributor

Currently, for postgres 15, it panics. From the output, it looks like it is interpreting the error message to be the URL... Downloading from: No extension with the given name was found

Example: Postgres 15, Extension not found

$ trunk install doesnotexist
Using pg_config: /usr/lib/postgresql/15/bin/pg_config
Using pkglibdir: "/var/lib/postgresql/data/tembo/15/lib"
Using sharedir: "/var/lib/postgresql/data/tembo"
Downloading from: No extension with the given name was found
thread 'main' panicked at 'error occurred: relative URL without a base', /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/pg-trunk-0.10.5/src/main.rs:60:6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Example: Postgres 15, Extension found, but version not found

$ trunk install pgmq --version=1.0.99
Using pg_config: /usr/lib/postgresql/15/bin/pg_config
Using pkglibdir: "/var/lib/postgresql/data/tembo/15/lib"
Using sharedir: "/var/lib/postgresql/data/tembo"
Downloading from: Version not found
thread 'main' panicked at 'error occurred: relative URL without a base', /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/pg-trunk-0.10.5/src/main.rs:60:6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Postgres 17

The handling seems to be a little better for Postgres 17, but still maybe not ideal.

It correctly says there isn't an extension with that name, but then it prints a message about not being able to install it through the legacy endpoint (?).

Maybe that is the intended output, but as a user, I'm not quite sure what that legacy endpoint error means.

~# trunk install doesnotexist
Using pkglibdir: "/usr/lib/postgresql/17/lib"
Using sharedir: "/usr/share/postgresql/17"
Using Postgres version: 17
Failed to fetch Trunk archive from v1 API: Found no Trunk project with name doesnotexist

error: Cannot install extension for Postgres version 17 through the legacy endpoint

Similar for an extension that is found, but a version that is not found:

~# trunk install pgmq --version=1.0.99
Using pkglibdir: "/usr/lib/postgresql/17/lib"
Using sharedir: "/usr/share/postgresql/17"
Using Postgres version: 17
Failed to fetch Trunk archive from v1 API: Found no Trunk project with name pgmq and version 1.0.99

error: Cannot install extension for Postgres version 17 through the legacy endpoint
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

1 participant