posit-dev / posit-dev/rsconnect-python

KeyError: 'id' when deploying jupyter notebook

Offen
#523 11 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
37
Forks
28
Ø Merge
1 T. 3 Std.
Gemergte PRs (30 T.)
7

Beschreibung

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

https://github.com/rstudio/rsconnect-python/blob/b583723fbc0157f2ed83d8501aeaadb9baa51f06/rsconnect/api.py#L253-L257

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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit rsconnect/api.py in den Zeilen 253-257 und dem Aufruf von deploy_bundle in Zeile 712. Reproduzieren Sie dann das Problem mit rsconnect deploy notebook -v ./snowflake_pythonconnector_demo.ipynb. Untersuchen Sie die von self.app_create zurückgegebene Antwort und den Credential-Kontext. Die Aufgabe ist abgeschlossen, wenn Sie ermittelt haben, warum der Antwort id fehlt, und einen klaren Umgangs- oder Diagnosepfad bereitstellen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
jupyter-notebook, python
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.