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

Error in database migration after upgrade from 4.9 to 4.10 #1320

Closed
2 tasks done
rwrx opened this issue Dec 20, 2021 · 6 comments
Closed
2 tasks done

Error in database migration after upgrade from 4.9 to 4.10 #1320

rwrx opened this issue Dec 20, 2021 · 6 comments
Labels
bug Something is broken. duplicate Similar issue or pull request already exists.

Comments

@rwrx
Copy link

rwrx commented Dec 20, 2021

Describe the issue

I have deployed Weblate with docker-compose. I have upgraded from 4.9 to 4.10 and I am getting this error:

weblate_1   | Postgres is up
database_1  | ERROR:  column c.relispartition does not exist at character 54
database_1  | STATEMENT:  
database_1  |               SELECT c.relname,
database_1  |               CASE WHEN c.relispartition THEN 'p' WHEN c.relkind IN ('m', 'v') THEN 'v' ELSE 't' END
database_1  |               FROM pg_catalog.pg_class c
database_1  |               LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
database_1  |               WHERE c.relkind IN ('f', 'm', 'p', 'r', 'v')
database_1  |                   AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
database_1  |                   AND pg_catalog.pg_table_is_visible(c.oid)
database_1  |          
weblate_1   | [2021-12-20 18:26:06,211: WARNING/26] Handled exception: ProgrammingError: column c.relispartition does not exist
weblate_1   | LINE 3:             CASE WHEN c.relispartition THEN 'p' WHEN c.relki...
weblate_1   |                               ^
weblate_1   |
weblate_1   | Traceback (most recent call last):
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/db/backends/utils.py", line 83, in _execute
weblate_1   |     return self.cursor.execute(sql)
weblate_1   | psycopg2.errors.UndefinedColumn: column c.relispartition does not exist
weblate_1   | LINE 3:             CASE WHEN c.relispartition THEN 'p' WHEN c.relki...
weblate_1   |                               ^
weblate_1   |
weblate_1   |
weblate_1   | The above exception was the direct cause of the following exception:
weblate_1   |
weblate_1   | Traceback (most recent call last):
weblate_1   |   File "/usr/local/bin/weblate", line 8, in <module>
weblate_1   |     sys.exit(main())
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/weblate/runner.py", line 34, in main
weblate_1   |     utility.execute()
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/core/management/__init__.py", line 419, in execute
weblate_1   |     self.fetch_command(subcommand).run_from_argv(self.argv)
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/core/management/base.py", line 373, in run_from_argv
weblate_1   |     self.execute(*args, **cmd_options)
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/core/management/base.py", line 417, in execute
weblate_1   |     output = self.handle(*args, **options)
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/core/management/commands/showmigrations.py", line 54, in handle
weblate_1   |     return self.show_plan(connection, options['app_label'])
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/core/management/commands/showmigrations.py", line 121, in show_plan
weblate_1   |     loader = MigrationLoader(connection)
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/db/migrations/loader.py", line 53, in __init__
weblate_1   |     self.build_graph()
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/db/migrations/loader.py", line 223, in build_graph
weblate_1   |     self.applied_migrations = recorder.applied_migrations()
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/db/migrations/recorder.py", line 77, in applied_migrations
weblate_1   |     if self.has_table():
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/db/migrations/recorder.py", line 56, in has_table
weblate_1   |     tables = self.connection.introspection.table_names(cursor)
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/db/backends/base/introspection.py", line 52, in table_names
weblate_1   |     return get_names(cursor)
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/db/backends/base/introspection.py", line 47, in get_names
weblate_1   |     return sorted(ti.name for ti in self.get_table_list(cursor)
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/db/backends/postgresql/introspection.py", line 49, in get_table_list
weblate_1   |     cursor.execute("""
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/db/backends/utils.py", line 67, in execute
weblate_1   |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
weblate_1   |     return executor(sql, params, many, context)
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/db/backends/utils.py", line 85, in _execute
weblate_1   |     return self.cursor.execute(sql, params)
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/db/utils.py", line 90, in __exit__
weblate_1   |     raise dj_exc_value.with_traceback(traceback) from exc_value
weblate_1   |   File "/usr/local/lib/python3.9/dist-packages/django/db/backends/utils.py", line 83, in _execute
weblate_1   |     return self.cursor.execute(sql)
weblate_1   | django.db.utils.ProgrammingError: column c.relispartition does not exist
weblate_1   | LINE 3:             CASE WHEN c.relispartition THEN 'p' WHEN c.relki...
weblate_1   |                               ^
weblate_1   |
weblate_1   |
weblate_1   | Database migration has failed. Please check the error message above.
weblate_1   | In case you are upgrading from an 3.x version, please upgrade to 4.1.1-3 first.
weblate-docker_weblate_1 exited with code 1

This is my docker-compose.yml:

version: '3'
services:
  weblate:
    image: weblate/weblate
    links:
      - database
      - cache
    volumes:
      - weblate-data:/app/data
    env_file:
      - ./environment
    restart: always
    depends_on:
      - database
      - cache
  database:
    image: postgres:9.6-alpine
    env_file:
      - ./environment
    volumes:
      - postgres-data:/var/lib/postgresql/data
    restart: always
  cache:  
    image: redis:4-alpine
    restart: always
    command: ["redis-server", "--appendonly", "yes"]
    volumes:
      - redis-data:/data
volumes:  
  weblate-data: {}
  postgres-data: {}
  redis-data: {}

I already tried

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

Steps to reproduce the behavior

No response

Expected behavior

No response

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

No response

Weblate deploy checks

No response

Additional context

No response

@github-actions
Copy link

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger.

In case your question is already answered, making a donation is the right way to say thank you!

@nijel
Copy link
Member

nijel commented Dec 20, 2021

Most likely you need to upgrade the PostgreSQL server, see https://docs.weblate.org/en/latest/admin/upgrade.html#upgrade-4-10

@nijel nijel transferred this issue from WeblateOrg/weblate Dec 20, 2021
@nijel nijel added bug Something is broken. duplicate Similar issue or pull request already exists. labels Dec 20, 2021
@nijel
Copy link
Member

nijel commented Dec 20, 2021

Duplicate of #1314

@nijel nijel marked this as a duplicate of #1314 Dec 20, 2021
@nijel nijel closed this as completed Dec 20, 2021
@rwrx
Copy link
Author

rwrx commented Dec 22, 2021

@nijel Thank you a lot. I have fixed it.

@neznour
Copy link

neznour commented Apr 11, 2022

Hi,
I have the same issue!! How did you fix it?
After downloading the Postregsql ,It shows this error!!@nijel

@rwrx
Copy link
Author

rwrx commented Apr 12, 2022

@neznour Hi, I am sorry, but I do not really remember. Please try looking at #1314 how they fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken. duplicate Similar issue or pull request already exists.
Projects
None yet
Development

No branches or pull requests

3 participants