Skip to content

Lastest Janeway versions fail to install with fresh install #4632

Description

@am486dx

Describe the bug
I cannot perform a fresh Janeway install using versions 1.7.3 and 1.7.4. The install fails during the migration. I've included the stack trace at the bottom. After trying to use version 1.7.2, the application migrated properly and installation completes successfully. Another user on the Discord thought it might relate to #4518, and this makes sense because (1) because the failed migration seems to relate to language and (2) this pull request was added in version 1.7.3.

My guess is that these two Janeway versions were not tested on a fresh database. The reason being, is that I was able to migrate from 1.7.2 to 1.7.3 successfully.

Also please note, that the default Docker-Compose included with Janeway using sqlite fails out of the box because it's mounting janeway.sqlite3 as a directory rather than as a file.

Janeway version
Versions 1.7.3, 1.7.4

To Reproduce
Steps to reproduce the behavior:

I had this error using a custom Dockerimage and docker-compose setup, and postgresql. I was trying to find a way to reproduce this with the docker-compose script that ships with Janeway for your convenience, and and it seems to show a different but related error saying: FileNotFoundError: [Errno 2] No such file or directory: '/vol/janeway/src/core/locales/en_us'. This is after fixing the issue where it mounts janeway.sqlite3 as a directory.

  1. Clone Janeway to a place where it has a fresh filesystem and database
  2. Ensure you're on version 1.7.3 or 1.7.4
  3. Run Django's 'migrate' command
  4. Observe that migrations abort on 0053_display_article_images_settings

Expected behavior
I expected migrations to complete successfully.

Screenshots
N/A

Front-end Issues

N/A

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
STACK TRACE for custom Docker-Compose and Postgres application:

  Applying journal.0052_add_fields_to_fixedpubcheckitems_and_issue... OK
  Applying journal.0053_display_article_images_settings...Traceback (most recent call last):
  File "/opt/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.errors.UndefinedColumn: column core_settingvalue.value_es does not exist
LINE 1: ...alue"."value_nl", "core_settingvalue"."value_cy", "core_sett...
                                                             ^
HINT:  Perhaps you meant to reference the column "core_settingvalue.value_en".


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/vol/janeway/src/manage.py", line 16, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vol/janeway/src/utils/management/commands/install_janeway_k8s.py", line 45, in handle
    call_command('migrate')
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 194, in call_command
    return command.execute(*args, **defaults)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/base.py", line 106, in wrapper
    res = handle_func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 356, in handle
    post_migrate_state = executor.migrate(
                         ^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/db/migrations/executor.py", line 135, in migrate
    state = self._migrate_all_forwards(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
    state = self.apply_migration(
            ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
    state = migration.apply(state, schema_editor)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/db/migrations/migration.py", line 132, in apply
    operation.database_forwards(
  File "/opt/venv/lib/python3.11/site-packages/django/db/migrations/operations/special.py", line 193, in database_forwards
    self.code(from_state.apps, schema_editor)
  File "/vol/janeway/src/journal/migrations/0053_display_article_images_settings.py", line 15, in update_setting_values
    call_command('load_default_settings')
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 194, in call_command
    return command.execute(*args, **defaults)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vol/janeway/src/utils/management/commands/load_default_settings.py", line 23, in handle
    install.update_settings(
  File "/vol/janeway/src/utils/install.py", line 58, in update_settings
    setting_value, created = core_models.SettingValue.objects.get_or_create(
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/modeltranslation/manager.py", line 419, in get_or_create
    return super().get_or_create(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/db/models/query.py", line 916, in get_or_create
    return self.get(**kwargs), False
           ^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/db/models/query.py", line 633, in get
    num = len(clone)
          ^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/db/models/query.py", line 380, in __len__
    self._fetch_all()
  File "/opt/venv/lib/python3.11/site-packages/django/db/models/query.py", line 1881, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/db/models/query.py", line 91, in __iter__
    results = compiler.execute_sql(
              ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/opt/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/opt/venv/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/opt/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django.db.utils.ProgrammingError: column core_settingvalue.value_es does not exist
LINE 1: ...alue"."value_nl", "core_settingvalue"."value_cy", "core_sett...
                                                             ^
HINT:  Perhaps you meant to reference the column "core_settingvalue.value_en".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething's not working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions