posit-dev / posit-dev/rsconnect-python
KeyError: 'id' when deploying jupyter notebook
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 37
- Forks
- 28
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 7
Description
We have a report of a keyerror when deploying a jupyter notebook.
After doing some code reading, it's unclear to me how this could occur if we get a successful response from self.app_create
We'll follow up with additional diagnostic information but I thought we should file an issue here in case others have run into this problem.
rsconnect deploy notebook -v ./snowflake_pythonconnector_demo.ipynb
Connect detected CLI commands and/or environment variables that overlap with stored credential.
Check your environment variables (e.g. CONNECT_API_KEY) to make sure you want them to be used.
Credential paremeters are taken with the following precedence: stored > CLI > environment.
To ignore an environment variable, override it in the CLI with an empty string (e.g. -k '').
Validating server... [OK]
Validating app mode... [OK]
Making bundle ...[VERBOSE] 2023-11-02T09:43:20-0500 Adding file: manifest.json
[VERBOSE] 2023-11-02T09:43:20-0500 Adding file: requirements.txt
[VERBOSE] 2023-11-02T09:43:20-0500 Adding file: ./snowflake_pythonconnector_demo.ipynb
[OK]
Deploying bundle ... [ERROR]: 'id'
Traceback (most recent call last):
File "/Users/user/.pyenv/versions/3.9.15/lib/python3.9/site-packages/rsconnect/main.py", line 96, in wrapper
result = func(*args, **kwargs)
File "/Users/user/.pyenv/versions/3.9.15/lib/python3.9/site-packages/rsconnect/main.py", line 901, in deploy_notebook
ce.deploy_bundle().save_deployed_info().emit_task_log()
File "/Users/user/.pyenv/versions/3.9.15/lib/python3.9/site-packages/rsconnect/log.py", line 189, in wrapper
result = method(self, *args, **kw)
File "/Users/user/.pyenv/versions/3.9.15/lib/python3.9/site-packages/rsconnect/api.py", line 712, in deploy_bundle
result = self.client.deploy(
File "/Users/user/.pyenv/versions/3.9.15/lib/python3.9/site-packages/rsconnect/api.py", line 257, in deploy
app_id = app["id"]
KeyError: 'id'
Internal error: 'id'
Is it possible there's 2 api keys in play as a result of the environment var being different than the api key from the cache?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with rsconnect/api.py at lines 253-257 and the deploy_bundle call at line 712, then reproduce the issue with rsconnect deploy notebook -v ./snowflake_pythonconnector_demo.ipynb. Inspect the response returned by self.app_create and the credential context; done means identifying why the response lacks id and providing a clear handling or diagnostic path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100