Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Catch HTTP errors when downloading core agent

Aperta
#239 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
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start in src/scout_apm/core/core_agent_manager.py, following download(), download_package(), and untar() from the reported traceback. Check how HTTP responses and filesystem failures are currently handled; done means failed downloads do not reach tarfile extraction or start the agent, and the failure is logged and returned clearly.

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

Descrizione

At current the download code doesn't check for status code or other failures when downloading the core agent package.

Overriding SCOUT_CORE_AGENT_TRIPLE can lead to invalid URL's for the core agent package, which leads to the S3 404 page being attempted to be opened as a tarfile:

~/Documents/Projects/scout_apm_python/src/scout_apm/core/core_agent_manager.py in download(self)
     55
     56     def download(self):
---> 57         self.downloader.download()
     58
     59     def run(self):

~/Documents/Projects/scout_apm_python/src/scout_apm/core/core_agent_manager.py in download(self)
    143             try:
    144                 self.download_package()
--> 145                 self.untar()
    146             except OSError:
    147                 logger.exception("Exception raised while downloading Core Agent")

~/Documents/Projects/scout_apm_python/src/scout_apm/core/core_agent_manager.py in untar(self)
    192
    193     def untar(self):
--> 194         t = tarfile.open(self.package_location, "r")
    195         t.extractall(self.destination)
    196

~/.pyenv/versions/3.7.4/lib/python3.7/tarfile.py in open(cls, name, mode, fileobj, bufsize, **kwargs)
   1576                         fileobj.seek(saved_pos)
   1577                     continue
-> 1578             raise ReadError("file could not be opened successfully")
   1579
   1580         elif ":" in mode:

ReadError: file could not be opened successfully

We should catch all kinds of HTTP or filesystem errors (FS getting full!) and workaround correspondingly (mostly by logging, returning failure, and not starting the agent).

Lingua principale
Python
Stelle
77
Fork
19
Merge medio
1g 9h
PR unite (30g)
5

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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 scoutapp/scout_apm_python

Tutte le issue di scoutapp/scout_apm_python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.