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

Improve the errors of subo-dev #304

Open
flaki opened this issue May 18, 2022 · 1 comment
Open

Improve the errors of subo-dev #304

flaki opened this issue May 18, 2022 · 1 comment

Comments

@flaki
Copy link
Contributor

flaki commented May 18, 2022

This might very well be a fix meant for Atmo, but I file it here for subo because I think it's primarily a (beginner) UX/DX issue.

With a newly scaffolded project, I forgot to run subo build before subo dev, this was the output:

$ subo dev
{"log_message":"(W) configured to use HTTP with no TLS","timestamp":"2022-05-18T18:26:50.656847092Z","level":2,"app":{"atmo_version":"0.4.7"}}
Error: failed to coordinator.Start: failed to App.Start: failed to findBundle: failed to Read bundle: failed to open bundle: open ./runnables.wasm.zip: no such file or directory
Usage:
  atmo [bundle-path] [flags]

Flags:
      --appName string   if passed, it'll be used as ATMO_APP_NAME, otherwise 'Atmo' will be used (default "Atmo")
      --domain string    if passed, it'll be used as ATMO_DOMAIN and HTTPS will be used, otherwise HTTP will be used
  -h, --help             help for atmo
      --httpPort int     if passed, it'll be used as ATMO_HTTP_PORT, otherwise '8080' will be used (default 8080)
      --tlsPort int      if passed, it'll be used as ATMO_TLS_PORT, otherwise '443' will be used (default 443)
  -v, --version          version for atmo
      --wait             if passed, Atmo will wait until a bundle becomes available on disk, checking once per second

ℹ️  failed to getLatestVersion: failed to fetch latest subo release: context deadline exceeded

Buried in there is the message that runnables.wasm.zip (that is, the Runnable bundle) was not found. Then we seem to fall back an "invalid Atmo command, show commandline help" message which is the second issue. The third issue is the extra log messages logged by Atmo before reaching to the point where it checks for the Runnable bundle.

We should reorganize this to:

  • Ideally move the critical checks, such as existence of the runnable bundle at the very beginning of Atmo startup (or even into subo)
  • The above may return "false negatives" when Atmo is (intended) to run with the --wait flag but subo knows whats going on in cases like subo dev so maybe this check is indeed better suited for subo
  • We should proactively and descriptively describe the issue:

    ⚠️ Could not start Atmo: we couldn't find the Runnable bundle (./runnables.wasm.zip)

  • We could even go full Clippy ("Did you forget to run subo build?), and/or link to troubleshooting tips in the docs.
@flaki
Copy link
Contributor Author

flaki commented May 20, 2022

Similar one, in sat, with a missing runnable:

{"log_message":"(E) failed to exec.Do: failed to reconcilePoolSize: failed to addThread more than numRetries: runnable returned OnChange error: failed to addInstance: failed to builder.New: failed to internals: failed to get ref ModuleBytes: failed to ReadFile for Wasm module: open /Users/lauralangdon/Suborbital/subo/hello-world/hello-world.wasm: no such file or directory","timestamp":"2022-05-20T16:22:57.284998634Z","level":1,"app":{"sat_version":"v0.1.3"}}

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