posit-dev / posit-dev/rsconnect-python

deploy fails to redeploy due to global config

Open
#646 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
37
Forks
28
Avg merge
1d 3h
Merged PRs (30d)
7

Description

Replaces https://github.com/posit-dev/connect/issues/30437

System details

OS Version :  OSX Sonoma

Problem Statement

Creating it as a "bug" because it could be perceived as one from the users.

Steps to Reproduce

  1. Deploy an application (I'm using a streamlit dashboard, but shouldn't matter)
    • The application is deployed with an ID, for example: 87a2d580-58fd-4e85-9027-c7946958806c
  2. Delete the application
    • Removed application 87a2d580-58fd-4e85-9027-c7946958806c ("main")
  3. Deploy the same application again
    • The deploy fails with an error: Posit Connect reported an error (calling /__api__/applications/87a2d580-58fd-4e85-9027-c7946958806c): The requested object does not exist.

Actual Behavior

The deploy fails because it tries to reuse an application that was deleted.

This happens even when the user deletes the rsconnect-python directory from the application itself.

That is caused by rsconnect-python saving a global state in /Users/{ME}/Library/Application Support/rsconnect-python where the application ID is stored.

There are 3 problems that I see:

  1. The user is unable to deploy the application again after deleting it
  2. rsconnect-python behaviour is different based on the computer where it gets run as the global state is different
  3. Moving the project directory around causes a mismatch between the global state and the project state (because the global state stores the PATH) even though the project is the same and its state didn't change.

Expected Behavior

  • Doing the deploy again succeeds and creates a new application
  • There is no global state.
    • I think it's perfectly reasonable to store the state in the application itself (as it already does within the $PROJECT_DIR/rsconnect-python subdirectory) so that it can be committed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the deploy command reads and writes state in the project’s rsconnect-python directory and the global /Users/{ME}/Library/Application Support/rsconnect-python location. Reproduce the delete-and-redeploy sequence with the example application ID, then determine how state should behave when the project moves. Done means redeploying creates a new application without relying on global state.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.