Skip to content

stack trace when you have multiple saved servers and don't pick one #541

Closed

Description

@christierney

I have 3 saved/nicknamed servers. When deploying, I need to pick one using -n. When I forgot, instead of a helpful error message I got a stack trace:

❯ rsconnect deploy quarto index.qmd
Inspecting Quarto project...                     [OK]
Traceback (most recent call last):
  File "/Users/chris/content/quarto-email-install-fest/.venv/lib/python3.11/site-packages/rsconnect/main.py", line 97, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/content/quarto-email-install-fest/.venv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/content/quarto-email-install-fest/.venv/lib/python3.11/site-packages/rsconnect/main.py", line 1219, in deploy_quarto
    ce = RSConnectExecutor(**kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/content/quarto-email-install-fest/.venv/lib/python3.11/site-packages/rsconnect/api.py", line 424, in __init__
    self.setup_client(cookies)
  File "/Users/chris/content/quarto-email-install-fest/.venv/lib/python3.11/site-packages/rsconnect/api.py", line 540, in setup_client
    self.client = RSConnectClient(self.remote_server, cookies)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/content/quarto-email-install-fest/.venv/lib/python3.11/site-packages/rsconnect/api.py", line 136, in __init__
    append_to_path(server.url, "__api__"),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chris/content/quarto-email-install-fest/.venv/lib/python3.11/site-packages/rsconnect/http_support.py", line 129, in append_to_path
    if uri.endswith("/") and path.startswith("/"):
       ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'endswith'
Internal error: 'NoneType' object has no attribute 'endswith'

related: #214

Activity

  1. tdstein commented on Nov 10, 2026

    @tdstein
    Collaborator

    🤖 This is fixed. The check for a missing deploy target never fired, because it tested a dict that was always truthy. That's how a deploy with several saved servers and no -n reached the NoneType traceback. #777 (released in 1.30.0) fixed the check (rsconnect/validation.py:302). Running rsconnect deploy shiny <dir> with three saved servers and no default now exits 1 with:

    Error: You must specify one of -n/--name OR -s/--server OR --connect-cloud OR -T/--token, -S/--secret, either via command options or environment variables.
    

    Since 1.30.0 you can also mark one server as the default with rsconnect server set-default -n <name>, or rsconnect add --set-default, so -n isn't needed. Since 1.31.0, a directory that was deployed before redeploys to its previous target. If you still get a traceback here on 1.33 or later, please reopen with the command and output.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions