Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't upgrade Weblate with Docker #2161

Closed
2 tasks done
AlphaStarguide opened this issue Feb 14, 2024 · 8 comments
Closed
2 tasks done

Can't upgrade Weblate with Docker #2161

AlphaStarguide opened this issue Feb 14, 2024 · 8 comments
Labels
question This is more a question for the support than an issue.

Comments

@AlphaStarguide
Copy link

Describe the issue

I'm trying to upgrade weblate from 5.1.1 to the latest version.
I'm using weblate with docker so I pulled and run the compose up and it showed me some error.

Attaching to weblate-docker-cache-1, weblate-docker-database-1, weblate-docker-weblate-1
weblate-docker-weblate-1   | Operations to perform:
weblate-docker-weblate-1   |   Apply all migrations: accounts, admin, auth, authtoken, configuration, contenttypes, django_celery_beat, gitexport, glossary, sessions, social_django, trans, utils, vcs, weblate_auth
weblate-docker-weblate-1   | [2024-02-14 06:24:23,206: WARNING/74] Handled exception: KeyError: ('trans', 'change')
weblate-docker-weblate-1   | Traceback (most recent call last):
weblate-docker-weblate-1   |   File "/usr/local/bin/weblate", line 8, in <module>
weblate-docker-weblate-1   |     sys.exit(main())
weblate-docker-weblate-1   |              ^^^^^^
weblate-docker-weblate-1   |   File "/usr/local/lib/python3.11/site-packages/weblate/runner.py", line 19, in main
weblate-docker-weblate-1   |     utility.execute()
weblate-docker-weblate-1   |   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
weblate-docker-weblate-1   |     self.fetch_command(subcommand).run_from_argv(self.argv)
weblate-docker-weblate-1   |   File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
weblate-docker-weblate-1   |     self.execute(*args, **cmd_options)
weblate-docker-weblate-1   |   File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
weblate-docker-weblate-1   |     output = self.handle(*args, **options)
weblate-docker-weblate-1   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
weblate-docker-weblate-1   |   File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 106, in wrapper
weblate-docker-weblate-1   |     res = handle_func(*args, **kwargs)
weblate-docker-weblate-1   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
weblate-docker-weblate-1   |   File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 301, in handle
weblate-docker-weblate-1   |     pre_migrate_state = executor._create_project_state(with_applied_migrations=True)
weblate-docker-weblate-1   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
weblate-docker-weblate-1   |   File "/usr/local/lib/python3.11/site-packages/django/db/migrations/executor.py", line 91, in _create_project_state
weblate-docker-weblate-1   |     migration.mutate_state(state, preserve=False)
weblate-docker-weblate-1   |   File "/usr/local/lib/python3.11/site-packages/django/db/migrations/migration.py", line 91, in mutate_state
weblate-docker-weblate-1   |     operation.state_forwards(self.app_label, new_state)
weblate-docker-weblate-1   |   File "/usr/local/lib/python3.11/site-packages/django/db/migrations/operations/fields.py", line 93, in state_forwards
weblate-docker-weblate-1   |     state.add_field(
weblate-docker-weblate-1   |   File "/usr/local/lib/python3.11/site-packages/django/db/migrations/state.py", line 248, in add_field
weblate-docker-weblate-1   |     self.models[model_key].fields[name] = field
weblate-docker-weblate-1   |     ~~~~~~~~~~~^^^^^^^^^^^
weblate-docker-weblate-1   | KeyError: ('trans', 'change')
weblate-docker-weblate-1   |
weblate-docker-weblate-1   | Database migration has failed. Please check the error message above.
weblate-docker-weblate-1   | Note: Upgrading across major versions is not supported. In case you are upgrading
weblate-docker-weblate-1   |       from an 4.x version, please upgrade to 5.0.2 first.
weblate-docker-weblate-1 exited with code 0
weblate-docker-weblate-1   | System check identified no issues (1 silenced).
weblate-docker-weblate-1   | Postgres 150006 is up
weblate-docker-weblate-1   | Starting database migration...
^Ccanceled

I already tried

  • I've read and searched the documentation.
  • I've searched for similar filed issues in this repository.

Steps to reproduce the behavior

everytime tried to upgrade the container

Expected behavior

No response

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

5.1.1

Weblate deploy checks

No response

Additional context

No response

@nijel nijel transferred this issue from WeblateOrg/weblate Feb 14, 2024
@nijel
Copy link
Member

nijel commented Feb 14, 2024

I couldn't reproduce what you observe. Furthermore, there are actually no database migrations to perform between 5.1.1 and 5.3.1 (what is currently latest). Did you make any manual changes to the database, container, or settings?

@nijel nijel added the question This is more a question for the support than an issue. label Feb 14, 2024
@AlphaStarguide
Copy link
Author

Thank you for your reply .
I did nothing to the database.
But I did write some settings in override.yml, does it matter?

@nijel
Copy link
Member

nijel commented Feb 14, 2024

Settings change should not matter. Are you sure you were on 5.1.1 before? Wasn't it 4.x?

@AlphaStarguide
Copy link
Author

AlphaStarguide commented Feb 15, 2024

image
It says so unless I checked the wrong place.

@nijel
Copy link
Member

nijel commented Feb 15, 2024

Did you do any changes to the container?

As I've said, for me the upgrade went without any issues:

weblate-1   | Starting database migration...
weblate-1   | Operations to perform:
weblate-1   |   Apply all migrations: accounts, addons, admin, auth, authtoken, checks, configuration, contenttypes, django_celery_beat, fonts, gitexport, glossary, lang, memory, metrics, screenshots, sessions, social_django, trans, utils, vcs, weblate_auth, wladmin
weblate-1   | Running migrations:
weblate-1   |   No migrations to apply.

@nijel
Copy link
Member

nijel commented Feb 15, 2024

PS: We've just released 5.4 today, the Docker image should be available tomorrow, so it might be worth trying if it changes anything.

@AlphaStarguide
Copy link
Author

I tried again today and don't know why this time it works!!!
Thank you for your advice!!!

Copy link

The issue you have reported is now resolved. If you don’t feel it’s right, please follow its labels to get a clue for further steps.

  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is more a question for the support than an issue.
Projects
None yet
Development

No branches or pull requests

2 participants