View Issue Details

IDProjectCategoryView StatusLast Update
0029039mantisbtupgradepublic2021-10-01 15:52
ReporterZazzarim Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionno change required 
Summary0029039: Upgrade from 2.15 to 2.25 (DB Schema 209 auf 211) fails
Description

Hi,
das Update bricht ab: BAD ALTER TABLE mantis_bug_file_table ADD bugnote_id INTEGER UNSIGNED DEFAULT 0 Duplicate column name 'bugnote_id'

Die Tabelle hat 31.800 Einträge und 10.4 GiB.
Vielleicht dauert das Statement beim ersten mal zu lange und nun ist die Spalte halt da.

Irgendwelche Tipps wie ich nun weitermachen soll?
Die weiteren Statements:
-- Schema step 210
ALTER TABLE mantis_bug_file_table ADD bugnote_id INTEGER UNSIGNED DEFAULT 0;
-- Schema step 211
ALTER TABLE mantis_email_table MODIFY COLUMN email VARCHAR(191) NOT NULL DEFAULT '';
-- Set database version
UPDATE mantis_config_table SET value = 211 WHERE config_id = 'database_version' AND project_id = 0 AND user_id = 0;
wurden noch nicht ausgeführt.

TagsNo tags attached.

Activities

dregad

dregad

2021-09-03 10:21

developer   ~0065811

First of all, kindly post in English.

Anyway, based on my limited German skills and with the help of Google translate, I think I understand enough to answer you:

Duplicate column name 'bugnote_id'

This should not happen, unless the upgrade script somehow crashed while running step 210, and you ran it again.
If that is the case, it would be useful to know what error(s) occurred causing the initial ALTER TABLE statement to fail.

-- Schema step 210
ALTER TABLE mantis_bug_file_table ADD bugnote_id INTEGER UNSIGNED DEFAULT 0;
-- Schema step 211
ALTER TABLE mantis_email_table MODIFY COLUMN email VARCHAR(191) NOT NULL DEFAULT '';
-- Set database version
UPDATE mantis_config_table SET value = 211 WHERE config_id = 'database_version' AND project_id = 0 AND user_id = 0;

It looks like you're generating SQL, did you actually run these statements manually to upgrade, or did you let the installer execute them ?

If the former, I draw your attention to the warning that gets displayed when using this option, it is there for good reason:
_Please note that executing the generated script below may not result in a fully functional database, particularly in upgrade scenarios. This is due to the fact that some upgrade steps require the execution of PHP code; these Upgrade Functions are defined in install_helper_functionsapi.php and cannot be translated to SQL statements. Use at your own risk.

I would recommend to restore the DB from backup and run the installer again.

As a manual fix (at your own risk !), if the bug_file table has been successfully altered (i.e. the new bugnote_id column is present and correctly initialized with the default value for all existing rows), you can try to execute the following statement

UPDATE mantis_config_table SET value = 210 WHERE config_id = 'database_version' AND project_id = 0 AND user_id = 0;

Then resume with normal upgrade process.

Zazzarim

Zazzarim

2021-09-03 10:41

reporter   ~0065813

Last edited: 2021-09-03 10:45

Hi Dregad,
sorry I guessed atrol would answer and i think he speaks german too. ;-)
I ran the upgrade script 3 times. I can´t remember exatly the first error message. I think it was a 500 error as a result of php fast cgi timeout configuration. I tried to start the upgrade again and got the message "duplicte column name". Then i logged into phpmyadmin and there was no column " bugnote_id" in bug_file_table.
Perhaps the task ran i background and was not completed.
I ran the upgrade again and now i selected "generate sql statements". I resumed the files back to 2.15 and checked the db for changes the upgrade may have caused. Now the table mantis_bug_file_table has the new column! Anyway i stopped the upgrade and wrote this issue.
Thank you for the manual fix. I will try it next friday.
Best regards,
zazzarim

atrol

atrol

2021-09-03 11:25

developer   ~0065814

sorry I guessed atrol would answer and i think he speaks german too. ;-)

No one should rely on getting answers from me ;-)

Futhermore it's good for other international users that might encounter similar issues if they find some information about that in English.

Zazzarim

Zazzarim

2021-09-03 11:35

reporter   ~0065815

Hi Atrol,
LOL! That´s right... both ;-)

zazza

Zazzarim

Zazzarim

2021-09-04 08:13

reporter   ~0065817

Hi Dregad,
your manual fix worked! I resumed the upgrade process and this time it was successfully. mantis_email_table was altered and the new schema is 211.
Thanks a lot!

Hoch die Tassen! (Cheers!)
zazzarim

dregad

dregad

2021-09-04 13:58

developer   ~0065818

Thanks for the feedback, glad to hear that I helped you fix the problem!