posit-dev / posit-dev/rsconnect-python

KeyError: 'id' when deploying jupyter notebook

Aperta
#523 11 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
37
Fork
28
Merge medio
1g 3h
PR unite (30g)
7

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da rsconnect/api.py alle righe 253-257 e dalla chiamata a deploy_bundle alla riga 712, quindi riproduci il problema con rsconnect deploy notebook -v ./snowflake_pythonconnector_demo.ipynb. Esamina la risposta restituita da self.app_create e il contesto delle credenziali; il lavoro è completato quando hai identificato perché nella risposta manca id e hai fornito un percorso chiaro per la gestione o la diagnosi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
jupyter-notebook, python
Ambito
cli
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.