Submit_Workflow hangs on submission

Aperta
#4 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Inizia da _open_auth_url nell’issue e segui come CallbackHandler fornisce auth_code a httpd.handle_request(). Riproduci il flusso di invio e analizza perché il callback localhost non viene completato. Il lavoro è completato quando l’autorizzazione restituisce correttamente, AUTH è presente nell’ambiente e in src/.env e l’invio prosegue invece di rimanere bloccato.

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

Descrizione

It hangs when attempting to submit to a namespace. URL opens, nothing is displayed. Env file created, but remains empty of info (just null strings)

  def _open_auth_url(auth_url: str, port: int) -> None:
      httpd = _ReusingHTTPServer(("localhost", port), CallbackHandler)
      webbrowser.open(auth_url)
      try:
          print(
              f"Please authorize the application in your browser. If it does not open automatically, visit: {auth_url}"
          )
          httpd.handle_request()
          os.environ["AUTH"] = httpd.auth_code
          dotenv.set_key("src/.env", "AUTH", httpd.auth_code)
          
      except OSError:
          print("ERROR: Port in use. Please restart your terminal.")
          os.environ["AUTH"] = ""
          print("ERROR: Port in use. Please restart your terminal.")
          exit(1)
      finally:
          print("Shutting down the server...")
          httpd.socket.shutdown(socket.SHUT_RDWR)
          httpd.server_close()

output:

(node:5049) [DEP0169] DeprecationWarning: url.parse() behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for url.parse() vulnerabilities.
(Use node --trace-deprecation ... to show where the warning was created)
Please authorize the application in your browser. If it does not open automatically, visit: https://identity.diamond.ac.uk/realms/dls/protocol/openid-connect/auth?client_id=workflows-cli&response_type=code&redirect_uri=http://localhost:8000/&scope=openid posix-uid profile email fedid&state=&nonce=&code_challenge=JVZHGbR1yQmIgn4MniLQK9xVmvIujWozvSgf0F6zhQI&code_challenge_method=S256

Seems to be hanging on handle request?

Acceptance Criteria

  • Specific criteria that will be used to judge if the issue is fixed
Lingua principale
Python
Stelle
0
Fork
0
Merge medio
10h 26m
PR unite (30g)
2

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.

Altre issue di DiamondLightSource/python-workflow-submitter

Tutte le issue di DiamondLightSource/python-workflow-submitter

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.