Project

General

Profile

Bug #16183

Weblate cannot update some database schemes when upgrading

Added by emmapeel 12 months ago. Updated 2 months ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
12/03/2018
Due date:
% Done:

0%

Spent time:
Feature Branch:
Type of work:
Sysadmin
Blueprint:
Starter:
Affected tool:
Translation Platform

Description

There is an issue with the weblate instance upgrade (i don't really know exactly what is the problem because I am unable to see the mysql logs), but it seems weblate cannot update the database schemes.

Steps to reproduce:

- cd /usr/local/share/weblate/

- 'sudo -u weblate python3 ./manage.py makemigrations' to make the file

- 'sudo -u weblate python3 ./manage.py migrate' to apply the changes. Changes look like are applied.

- 'sudo -u weblate python3 ./manage.py migrate' again, to check for new migrations. It says new migrations needed!

- 'sudo -u weblate python3 ./manage.py makemigrations' generates a new file with the same mysql query!!!.

what should happen:

- the second time we run 'sudo -u weblate python3 ./manage.py migrate' it should tell us that there are no migrations needed.

The query is adding some more options to the check table because of new checks available on upgrade.


Related issues

Related to Tails - Bug #16943: Upgrade to Weblate 3.x Confirmed

History

#1 Updated by emmapeel 12 months ago

  • Assignee set to groente

#2 Updated by emmapeel 12 months ago

  • Description updated (diff)

#3 Updated by groente 12 months ago

  • Assignee changed from groente to emmapeel

well, i don't see any failures, even when running migrate with -v3 --traceback.

what i do see is that the migate command adds an entry to the django_migrations table.

running the thing in strace, i don't even see it trying to make any changes to the database structure. All that is sent to the mysql server is the INSERT into the django_migrations table and a whole lot of SELECT's, but no ALTER or UPDATE or anything else I'd expect from an attempt to make the needed adjustments you mentioned.

i'm afraid i can't help you any further on this one, i'm inclined to think there's something wrong with the internal logic of manage.py.

#4 Updated by intrigeri 4 months ago

  • Status changed from Confirmed to Rejected

We've seen no such problem last time we upgraded Weblate (late June). Let's reopen this (currently not actionable) ticket if we see this problem again!

#5 Updated by hefee 3 months ago

  • Status changed from Rejected to Confirmed
  • Assignee deleted (emmapeel)

The migration is about available checks. I expect, that some typo or anything in that list, that is not correct, but somehow the migration checks this incorrectly.

class Migration(migrations.Migration):

    dependencies = [
        ('trans', '0162_auto_20190627_1801'),
    ]

    operations = [
        migrations.AlterField(
            model_name='check',
            name='check',
            field=models.CharField(choices=[('begin_space', 'Starting spaces'), ('ellipsis', 'Ellipsis'), ('end_newline', 'Trailing newline'), ('end_ellipsis', 'Trailing ellipsis'), ('zero-width-space', 'Zero-width space'), ('perl_format', 'Perl format'), ('javascript_format', 'Javascript format'), ('end_space', 'Trailing space'), ('begin_newline', 'Starting newline'), ('xml-invalid', 'Invalid XML markup'), ('multiple_failures', 'Multiple failing checks'), ('escaped_newline', 'Mismatched \\n'), ('end_exclamation', 'Trailing exclamation'), ('php_format', 'PHP format'), ('translated', 'Has been translated'), ('end_semicolon', 'Trailing semicolon'), ('end_colon', 'Trailing colon'), ('bbcode', 'Mismatched BBcode'), ('optional_plural', 'Optional plural'), ('end_question', 'Trailing question'), ('max-length', 'Maximum length of translation'), ('python_brace_format', 'Python brace format'), ('c_format', 'C format'), ('same-plurals', 'Same plurals'), ('plurals', 'Missing plurals'), ('end_stop', 'Trailing stop'), ('xml-tags', 'XML tags mismatch'), ('python_format', 'Python format'), ('inconsistent', 'Inconsistent')], max_length=50),
        ),
    ]

#6 Updated by hefee 3 months ago

I think it is about the table trans_check.check. But I have no idea what it is about. I checked my test system that is using a sqlite3 db and there I also see just VARCHAR as type.

Maybe about the content itself?

select `check` from trans_check group by `check`;
+-------------------+
| check             |
+-------------------+
| begin_space       |
| ellipsis          |
| end_colon         |
| end_exclamation   |
| end_semicolon     |
| end_stop          |
| escaped_newline   |
| inconsistent      |
| multiple_failures |
| translated        |
| xml-tags          |
+-------------------+
11 rows in set (0.00 sec)

every check I can find in the list of choices.

#7 Updated by intrigeri 2 months ago

  • Related to Bug #16943: Upgrade to Weblate 3.x added

#8 Updated by u 2 months ago

  • Subject changed from weblate cannot update the database schemas to Weblate cannot update some database schemes when upgrading

#9 Updated by intrigeri 2 months ago

u and I propose that when we upgrade to Weblate 3.x, we evaluate the practical impact of this bug and the benefits we would get from fixing it. Depending on this, we'll reprioritize or reject this ticket.

Also available in: Atom PDF