bug: provisioner: should exit with error if license is borked
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 3
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
# Problem
TL;DR provisionerd can hang on exit if it gets a 403 (for example, after a license change) instead of exiting with an error to try reconnecting at a later date.
A developer modified the license on dev.coder.com to test out an issue.
They were unable to restore the original license after their testing, and accidentally replaced it with a different one that did not include the entitlement for external provisioners.
This caused the external provisioner deployments to disconnect with status 403 as expected:
```
{"ts":"2025-02-26T12:47:10.029756766Z","level":"ERROR","msg":"not authorized to dial coderd","caller":"/home/runner/work/coder/coder/provisionerd/provisionerd.go:240","func":"github.com/coder/coder/v2/provisionerd.(*Server).connect","fields":{"error":"GET https://dev.coder.com/api/v2/organizations/default/provisionerdaemons/serve?id=2d9b6b15-03d0-464d-a6f5-48f64e836bec\u0026name=coder-provisioner-tagged-57bf5899-4ph9k\u0026provisioner=terraform\u0026version=1.3\u0026version=1.3: unexpected status code 403: External provisioner daemons is an Enterprise feature. Contact sales!"}}
{"ts":"2025-02-26T12:47:10.029848836Z","level":"DEBUG","msg":"connect loop exited","caller":"/home/runner/work/coder/coder/provisionerd/provisionerd.go:241","func":"github.com/coder/coder/v2/provisionerd.(*Server).connect"}
```
The license was later replaced.
As we regularly build and deploy `main` to dogfood, one of the provisioner deployments was restarted and reconnected successfully. However, a corresponding step wasn't being done to the second provisioner deployment (corrected here: https://github.com/coder/coder/pull/16716).
The provisioner deployment that was not restarted by CI ended up 'hanging' in that state and not exiting with an error. Users of the dogfood deployment encountered "pending" workspace builds. After manually restarting the deployment, the provisioner reconnected successfully and builds proceeded.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia in provisionerd/provisionerd.go, intorno alla funzione Server.connect e al percorso registrato "connect loop exited". Riproduci o traccia la risposta 403 descritta nell’issue, quindi verifica che una licenza danneggiata faccia terminare provisionerd con un errore invece di lasciarlo disconnesso e lasciare in sospeso le build del workspace.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- go
- Ambito
- backend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 55/100