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

Vague error with invalid TOWER_API_ENDPOINT #190

Closed
drpatelh opened this issue Jan 7, 2025 · 5 comments
Closed

Vague error with invalid TOWER_API_ENDPOINT #190

drpatelh opened this issue Jan 7, 2025 · 5 comments

Comments

@drpatelh
Copy link
Member

drpatelh commented Jan 7, 2025

Given a YAML file in the following format hello_world.yml:

launch:
  - name: "hello-world"
    workspace: "seqeralabs/showcase"
    compute-env: "seqera_aws_ireland_fusion_nvme"
    labels: "aws"
    pipeline: "hello"

Providing an invalid TOWER_API_ENDPOINT raises an opaque error:

export TOWER_API_ENDPOINT=https://wrong.cloud.seqera.io
seqerakit hello_world.yml

INFO:root: Running command: tw launch --name hello-world --workspace seqeralabs/showcase --compute-env seqera_aws_ireland_fusion_nvme --labels aws hello
INFO:root: Command output: ERROR: error
ERROR:root:Resource creation failed: 'ERROR: error'. Check your config and try again.
@adamrtalbot
Copy link
Collaborator

Looks like the underlying tw command is this:

> tw -u https://wrong.endpoint workspaces list

 ERROR: java.net.UnknownHostException: wrong.endpoint


 ERROR: Connection error. Check the connection using the command 'tw info'.

@adamrtalbot
Copy link
Collaborator

adamrtalbot commented Jan 7, 2025

Likely this code here is covering up the error somehow:

def _handle_command_errors(self, stdout):
# Check for specific tw cli error patterns and raise custom exceptions
if re.search(
r"ERROR: .*already (exists|a participant)", stdout, flags=re.IGNORECASE
):
raise ResourceExistsError(
"Resource already exists. Please delete first or set 'overwrite: true'"
)
else:
raise ResourceCreationError(
f"Resource creation failed: '{stdout}'. "
"Check your config and try again."
)

Looks like stdout is being converted to just 'ERROR: error'.

@ejseqera
Copy link
Member

ejseqera commented Jan 7, 2025

Using v0.10.3, the error returned by the CLI itself is vague:

$ export TOWER_API_ENDPOINT=https://wrong.cloud.seqera.io
$ tw launch --name hello-world --workspace seqera/showcase --compute-env seqera_aws_ireland_fusion_nvme --labels aws hello

 ERROR: error

Alternatively with -u:

$ tw -u https://wrong.cloud.seqera.io/api launch --name hello-world --workspace seqera/showcase --compute-env seqera_aws_ireland_fusion_nvme --labels aws hello

ERROR: error

Seqerakit is just returning the stdout from the command invoked. Nothing being masked here.

Version info:

    Details
   -------------------------+-----------------------------
    Tower API endpoint      | https://api.cloud.seqera.io
    Tower API version       | 1.25.0
    Tower version           | 24.2.0_cycle28
    CLI version             | 0.10.3 (a86eeed)
    CLI minimum API version | 1.15
    Authenticated user      | eshajoshi

   System health status
   ---------------------------------------+----
    Remote API server connection check    | OK
    Tower API version check               | OK
    Authentication API credential's token | OK

@adamrtalbot
Copy link
Collaborator

adamrtalbot commented Jan 8, 2025

Woops, seems mine was because it wasn't a fully valid URI (should be able to accept anything though right?)

> tw -u https://wrong.cloud.seqera.io/api pipelines list --workspace seqera/showcase

 ERROR: error

> tw -u https://wrong.cloud.seqera.io/api runs list

 ERROR: error

> tw -u https://wrong.cloud.seqera.io/api workspaces list

 ERROR: error

> tw -u https://wrong.endpoint workspaces list

 ERROR: java.net.UnknownHostException: wrong.endpoint


 ERROR: Connection error. Check the connection using the command 'tw info'.

@ejseqera
Copy link
Member

ejseqera commented Jan 9, 2025

Closing this since it should be fixed at source: seqeralabs/tower-cli#473

@ejseqera ejseqera closed this as completed Jan 9, 2025
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