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

Deploy: pulling with an invalid project id returns a bad error #883

Open
josephjclark opened this issue Feb 26, 2025 · 0 comments
Open

Deploy: pulling with an invalid project id returns a bad error #883

josephjclark opened this issue Feb 26, 2025 · 0 comments

Comments

@josephjclark
Copy link
Collaborator

openfn pull abc

abc is not a valid project id (it's not a UUID). So I get error output like this:

[CLI] ♦ Downloading existing project state (as JSON) from the server.
Checking https://app.staging.openfn.org/api/provision/abc? for existing project.

[CLI] ✘ Command failed!
[CLI] ✘ Error: Failed to fetch project abc: Bad Request
    at getProject (file:///home/joe/.asdf/installs/nodejs/18.12.1/lib/node_modules/@openfn/cli/node_modules/@openfn/deploy/dist/index.js:694:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async pullHandler (file:///home/joe/.asdf/installs/nodejs/18.12.1/lib/node_modules/@openfn/cli/dist/process/runner.js:1554:31)
    at async parse (file:///home/joe/.asdf/installs/nodejs/18.12.1/lib/node_modules/@openfn/cli/dist/process/runner.js:1778:12)

This is not a useful error message. We should do better in the CLI at helping the user understand the actual problem. I think Lightning could probably be more helpful about this too (although I can't see the error body so I don't know, maybe there's a good message attached).

We also shouldn't be logging a stack trace for an error like this. It doesn't help the user.

@github-project-automation github-project-automation bot moved this to New Issues in v2 Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New Issues
Development

No branches or pull requests

1 participant