Self-hosted 25.7.7 / 25.8.5 codecov-api fails to boot with migration
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Riproduci l’aggiornamento dalla versione 25.6.2 alla 25.7.7 o alla 25.8.5 e ispeziona apps/codecov-api/manage.py insieme a shared/django_apps/core/migrations/0061_increment_version.py. Inizia tracciando la ricerca di Constants che fallisce durante la migrazione, quindi verifica che le migrazioni vengano completate e che l’API si avvii correttamente senza l’eccezione segnalata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Was on the 25.6.2, tried to upgrade to 25.7.7 or the latest 25.8.5 and seeing the logs as below, with failing to boot the app.
Starting api
Running migrations
==> Checking License
License is valid
License expires 2030-12-25 00:00:00 <==
{"message": "Codecov is starting migrations...", "asctime": "2025-07-18 17:47:34,708", "name": "shared.django_apps.legacy_migrations.management.commands.migrate", "levelname": "INFO", "lineno": 117, "pathname": "/usr/local/lib/python3.13/site-packages/shared/django_apps/legacy_migrations/management/commands/migrate.py", "funcName": "handle", "threadName": "MainThread", "utctime": "2025-07-18T17:47:34.708000", "logger.name": "shared.django_apps.legacy_migrations.management.commands.migrate", "logger.thread_name": "MainThread", "level": "INFO"}
{"message": "Trying to acquire migrations lock...", "asctime": "2025-07-18 17:47:34,709", "name": "shared.django_apps.legacy_migrations.management.commands.migrate", "levelname": "INFO", "lineno": 108, "pathname": "/usr/local/lib/python3.13/site-packages/shared/django_apps/legacy_migrations/management/commands/migrate.py", "funcName": "_obtain_lock", "threadName": "MainThread", "utctime": "2025-07-18T17:47:34.709000", "logger.name": "shared.django_apps.legacy_migrations.management.commands.migrate", "logger.thread_name": "MainThread", "level": "INFO"}
{"message": "Acquired Lock('lock:djang-migrations-lock').", "asctime": "2025-07-18 17:47:34,715", "name": "redis_lock.acquire", "levelname": "INFO", "lineno": 236, "pathname": "/usr/local/lib/python3.13/site-packages/redis_lock/__init__.py", "funcName": "acquire", "threadName": "MainThread", "utctime": "2025-07-18T17:47:34.715000", "logger.name": "redis_lock.acquire", "logger.thread_name": "MainThread", "level": "INFO"}
System check identified some issues:
WARNINGS:
codecov_auth.Owner.username: (fields.W907) django.contrib.postgres.fields.CITextField is deprecated. Support for it (except in historical migrations) will be removed in Django 5.1.
HINT: Use TextField(db_collation="…") with a case-insensitive non-deterministic collation instead.
codecov_auth.User.email: (fields.W907) django.contrib.postgres.fields.CITextField is deprecated. Support for it (except in historical migrations) will be removed in Django 5.1.
HINT: Use TextField(db_collation="…") with a case-insensitive non-deterministic collation instead.
core.Repository.name: (fields.W907) django.contrib.postgres.fields.CITextField is deprecated. Support for it (except in historical migrations) will be removed in Django 5.1.
HINT: Use TextField(db_collation="…") with a case-insensitive non-deterministic collation instead.
Operations to perform:
Apply all migrations: admin, auth, billing, bundle_analysis, codecov_auth, codecov_metrics, compare, contenttypes, core, labelanalysis, legacy_migrations, reports, rollouts, sessions, staticanalysis, ta_timeseries, timeseries, upload_breadcrumbs, user_measurements
Running migrations:
Applying core.0061_increment_version...{"message": "Codecov migrations failed for default: Constants matching query does not exist.", "asctime": "2025-07-18 17:47:39,013", "name": "shared.django_apps.legacy_migrations.management.commands.migrate", "levelname": "INFO", "lineno": 145, "pathname": "/usr/local/lib/python3.13/site-packages/shared/django_apps/legacy_migrations/management/commands/migrate.py", "funcName": "handle", "threadName": "MainThread", "utctime": "2025-07-18T17:47:39.013000", "logger.name": "shared.django_apps.legacy_migrations.management.commands.migrate", "logger.thread_name": "MainThread", "level": "INFO"}
Traceback (most recent call last):
File "/app/apps/codecov-api/manage.py", line 17, in <module>
execute_from_command_line(sys.argv)
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.13/site-packages/shared/django_apps/legacy_migrations/management/commands/migrate.py", line 142, in handle
super().handle(*args, **options)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/django/core/management/base.py", line 106, in wrapper
res = handle_func(*args, **kwargs)
File "/usr/local/lib/python3.13/site-packages/django/core/management/commands/migrate.py", line 356, in handle
post_migrate_state = executor.migrate(
targets,
...<3 lines>...
fake_initial=fake_initial,
)
File "/usr/local/lib/python3.13/site-packages/django/db/migrations/executor.py", line 135, in migrate
state = self._migrate_all_forwards(
state, plan, full_plan, fake=fake, fake_initial=fake_initial
)
File "/usr/local/lib/python3.13/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
state = self.apply_migration(
state, migration, fake=fake, fake_initial=fake_initial
)
File "/usr/local/lib/python3.13/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
state = migration.apply(state, schema_editor)
File "/usr/local/lib/python3.13/site-packages/django/db/migrations/migration.py", line 132, in apply
operation.database_forwards(
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
self.app_label, schema_editor, old_state, project_state
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/site-packages/django/db/migrations/operations/special.py", line 193, in database_forwards
self.code(from_state.apps, schema_editor)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/shared/django_apps/core/migrations/0061_increment_version.py", line 8, in update_version
version = Constants.objects.get(key="version")
File "/usr/local/lib/python3.13/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.13/site-packages/django/db/models/query.py", line 637, in get
raise self.model.DoesNotExist(
"%s matching query does not exist." % self.model._meta.object_name
)
__fake__.Constants.DoesNotExist: Constants matching query does not exist.
Seems
__fake__.Constants.DoesNotExist: Constants matching query does not exist.
is the issue - any idea how to workaround those?
Sorry for creating dupe from https://github.com/codecov/self-hosted/issues/63, not sure which one's right place to report.
- 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
-
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 ·
-
ChangelogAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 15/100
codecov/self-hosted#53 ·
Tutte le issue di codecov/self-hosted
Issue simili
-
bot-found bug priority: P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
madenvel/KalinkaPlayer#179 ·
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
jbaruch/coding-policy#621 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
mattpocock/skills#1134 ·
-
area:build bug P3
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
uttrflow/uttrflow-swift#2506 ·
I maintainer di solito rispondono entro 1 giorno