prometheus / prometheus/client_python

Error: TypeError: expected str, bytes or os.PathLike object, not NoneType

Ouverte
#1,061 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
Python
Étoiles
4.4k
Forks
876
Merge moyen
8 j 4 h
PR mergées (30 j)
1

Description

Sometimes i get this error:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.10/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/opt/homebrew/Cellar/python@3.10/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/django_q/cluster.py", line 165, in __init__
    self.start()
  File "/opt/homebrew/lib/python3.10/site-packages/django_q/cluster.py", line 174, in start
    self.guard()
  File "/opt/homebrew/lib/python3.10/site-packages/django_q/cluster.py", line 315, in guard
    self.reincarnate(p)
  File "/opt/homebrew/lib/python3.10/site-packages/django_q/cluster.py", line 234, in reincarnate
    prometheus_multiprocess.mark_process_dead(process.pid)
  File "/opt/homebrew/lib/python3.10/site-packages/prometheus_client/multiprocess.py", line 169, in mark_process_dead
    for f in glob.glob(os.path.join(path, f'gauge_{mode}_{pid}.db')):
  File "/opt/homebrew/Cellar/python@3.10/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/posixpath.py", line 76, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

It happen here:

https://github.com/django-q2/django-q2/blob/337a5782d9113a6e9d058743488e7517aebb8280/django_q/cluster.py#L233-L234

When mark_process_dead is called.

Can you help me?

Thanks.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez dans django_q/cluster.py autour des lignes 233-234 et suivez l’appel jusqu’à prometheus_client.multiprocess.mark_process_dead. Reproduisez l’échec et examinez pourquoi le chemin transmis à os.path.join est None. Le travail est terminé lorsque la cause est confirmée et que le comportement du scénario en échec est défini et vérifié.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
django, prometheus, python
Domaine
observability
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.