Skip to content

with-connect crashes with a traceback when the command after -- doesn't exist #64

Closed

Description

@cgraham-rs

If the command after -- doesn't exist, with-connect starts Connect and waits for it to be ready. Then it crashes with a Python traceback and exits with code 1. A typo in the command name is enough to cause this. Here it took about 30 seconds to fail.

$ python main.py --version latest --license ~/dev/connect/connect-license.lic --port 3941 --quiet -- rsconect deploy manifest .
Pulling image ghcr.io/posit-dev/connect:latest...
Successfully pulled ghcr.io/posit-dev/connect:latest
Waiting for port 3941 to open...
Waiting for HTTP server to start...
Running Posit Connect v2026.09.0
Traceback (most recent call last):
  File ".../main.py", line 499, in <module>
    sys.exit(main())
             ~~~~^^
  File ".../main.py", line 373, in main
    result = subprocess.run(args.command, check=True, env=env)
  ...(trimmed frames inside subprocess.py)...
FileNotFoundError: [Errno 2] No such file or directory: 'rsconect'

A shell exits with code 127 when it can't find a command. with-connect only handles a command that ran and failed, so a command that never starts is not handled. See main.py. The help text added in #63 says with-connect exits with the command's exit code, which isn't true here.

This is separate from #61. That issue is about errors the tool already catches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions