models.Owner.DoesNotExist: Owner matching query does not exist.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- django, github, google-cloud, python
- Ambito
- authentication, backend, cloud
Direzione di ricerca
Inizia da app/codecov_auth/views/github.py e app/codecov_auth/views/base.py per seguire il callback fino alla creazione dell’owner, quindi leggi app/codecov_auth/signals.py e app/utils/shelter.py, dove il traceback arriva all’inizializzazione del client Pub/Sub. Riproduci il callback di GitHub con la configurazione locale documentata e verifica che non restituisca più un 500 quando le credenziali richieste sono disponibili.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When login with github callback, I got a error:
{"error": "Server Error (500)"}
In api container, it raises an error:
{
"message": "Internal Server Error: /login/github",
"asctime": "2024-12-18 14:52:45,187",
"name": "django.request",
"levelname": "ERROR",
"lineno": 241,
"pathname": "/usr/local/lib/python3.12/site-packages/django/utils/log.py",
"funcName": "log_response",
"threadName": "MainThread",
"exc_info": "xxxx",
"taskName": null,
"status_code": 500,
"request": "<WSGIRequest: GET '/login/github?code=xx&state=xx'>",
"utctime": "2024-12-18T14:52:45.187000",
"logger.name": "django.request",
"logger.thread_name": "MainThread",
"level": "ERROR"
}
The exc_info details:
Traceback (most recent call last):
File \"/usr/local/lib/python3.12/site-packages/django/db/models/query.py\", line 916, in get_or_create
return self.get(**kwargs), False
^^^^^^^^^^^^^^^^^^
File \"/usr/local/lib/python3.12/site-packages/django/db/models/query.py\", line 637, in get
raise self.model.DoesNotExist(
shared.django_apps.codecov_auth.models.Owner.DoesNotExist: Owner matching query does not exist.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File \"/usr/local/lib/python3.12/site-packages/django/core/handlers/exception.py\", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File \"/usr/local/lib/python3.12/site-packages/django/core/handlers/base.py\", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/usr/local/lib/python3.12/site-packages/django/views/generic/base.py\", line 104, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/usr/local/lib/python3.12/site-packages/django/views/generic/base.py\", line 143, in dispatch
return handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/app/codecov_auth/views/github.py\", line 139, in get
return self.actual_login_step(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/app/codecov_auth/views/github.py\", line 122, in actual_login_step
owner = self.get_and_modify_owner(user_dict, request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/app/codecov_auth/views/base.py\", line 268, in get_and_modify_owner
owner, is_new_user = self._get_or_create_owner(user_dict, request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/app/codecov_auth/views/base.py\", line 363, in _get_or_create_owner
owner, was_created = Owner.objects.get_or_create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/usr/local/lib/python3.12/site-packages/django/db/models/manager.py\", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/usr/local/lib/python3.12/site-packages/django/db/models/query.py\", line 923, in get_or_create
return self.create(**params), True
^^^^^^^^^^^^^^^^^^^^^
File \"/usr/local/lib/python3.12/site-packages/django/db/models/query.py\", line 658, in create
obj.save(force_insert=True, using=self.db)
File \"/usr/local/lib/python3.12/site-packages/shared/django_apps/codecov_auth/models.py\", line 395, in save
super().save(*args, **kwargs)
File \"/usr/local/lib/python3.12/site-packages/django/db/models/base.py\", line 814, in save
self.save_base(
File \"/usr/local/lib/python3.12/site-packages/model_utils/tracker.py\", line 343, in inner
return original(instance, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/usr/local/lib/python3.12/site-packages/django/db/models/base.py\", line 892, in save_base
post_save.send(
File \"/usr/local/lib/python3.12/site-packages/django/dispatch/dispatcher.py\", line 177, in send
(receiver, receiver(signal=self, sender=sender, **named))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/app/codecov_auth/signals.py\", line 53, in update_owner
ShelterPubsub.get_instance().publish(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/app/utils/shelter.py\", line 22, in get_instance
cls._instance = cls()
^^^^^
File \"/app/utils/shelter.py\", line 27, in __init__
self.pubsub_publisher = pubsub_v1.PublisherClient()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/usr/local/lib/python3.12/site-packages/google/cloud/pubsub_v1/publisher/client.py\", line 139, in __init__
super().__init__(**kwargs)
File \"/usr/local/lib/python3.12/site-packages/google/pubsub_v1/services/publisher/client.py\", line 492, in __init__
self._transport = Transport(
^^^^^^^^^^
File \"/usr/local/lib/python3.12/site-packages/google/pubsub_v1/services/publisher/transports/grpc.py\", line 153, in __init__
super().__init__(
File \"/usr/local/lib/python3.12/site-packages/google/pubsub_v1/services/publisher/transports/base.py\", line 104, in __init__
credentials, _ = google.auth.default(
^^^^^^^^^^^^^^^^^^^^
File \"/usr/local/lib/python3.12/site-packages/google/auth/_default.py\", line 697, in default
raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS)
google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.
How can I fix this ?
- Lingua principale
- Shell
- Stelle
- 544
- Fork
- 61
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codecov/self-hosted
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
codecov/self-hosted#64 · 6 commenti ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
codecov/self-hosted#62 ·
-
RepoSync failure workaroundAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
codecov/self-hosted#61 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
codecov/self-hosted#57 · 2 reazioni ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
codecov/self-hosted#55 · 1 commento ·
Tutte le issue di codecov/self-hosted
Issue simili
-
type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
catppuccin/kde#152 ·
-
update-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
msys2/MINGW-packages#32008 ·
I maintainer di solito rispondono entro 1 giorno
-
bot-found bug priority: P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
madenvel/KalinkaPlayer#179 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100