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

Self-hosted 25.7.7 / 25.8.5 codecov-api fails to boot with migration

Aperta
#64 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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, postgresql, python
Ambito
backend, databases

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

  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 codecov/self-hosted

Tutte le issue di codecov/self-hosted

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.