Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Pastroious on February 22, 2022, 01:02:50 PM

Title: Error upgrading 2.0.19 to 2.1.1 - "credits" of relation "smf_log_packages" (Postgre)
Post by: Pastroious on February 22, 2022, 01:02:50 PM
I got error message:
Overall Progress
41%
Step Progress
56%
Time Elapsed: 0 mins, 57 seconds.
Database Changes
Executing database changes
Please be patient - this may take some time on large forums. The time elapsed increments from the server to show progress is being made.
Executing upgrade script 2 of 2.
Executing: "Package Manager New Features" (9 of 78 - of this script)
Error!
ERROR: column "credits" of relation "smf_log_packages" contains null values

Column "credits" in table "smf_log_packages"  does not exist in database from version 2.0.19.

SMF upgaraded from 2.0.15 -> 2.0.16 -> 2.0.17 -> 2.0.18 -> 2.0.19
PostgreSQL 14.1,  PHP 8.0.15
Title: Re: Error upgrading 2.0.19 to 2.1.1 - "credits" of relation "smf_log_packages"
Post by: Aleksi "Lex" Kilpinen on February 22, 2022, 01:07:05 PM
If it's a new column, and this is happening during the upgrade process - This sounds like a possible PostgreSQL specific bug to me. Going to move this to bug reports pending confirmation one way or another.
Title: Re: Error upgrading 2.0.19 to 2.1.1 - "credits" of relation "smf_log_packages" (Postgre)
Post by: Pastroious on February 22, 2022, 01:37:38 PM
Some more informations.

Upgrading from clean installation 2.0.19 to 2.1.1  works flawless

So I did dirty trick - before upgrade process i deleted all records from "log_packages" and upgrade process finished without errors
Title: Re: Error upgrading 2.0.19 to 2.1.1 - "credits" of relation "smf_log_packages" (Postgre)
Post by: Aleksi "Lex" Kilpinen on February 22, 2022, 01:40:24 PM
Okay, so we know it's something in log_packages that couldn't be handled correctly.
Title: Re: Error upgrading 2.0.19 to 2.1.1 - "credits" of relation "smf_log_packages" (Postgre)
Post by: Matthias on February 22, 2022, 02:27:18 PM
What modifications did you have installed at the 2.0.19 version?
Can you post the contents of the log_packages table here?
Maybe this will help to verify the error.
Title: Re: Error upgrading 2.0.19 to 2.1.1 - "credits" of relation "smf_log_packages" (Postgre)
Post by: Aleksi "Lex" Kilpinen on February 22, 2022, 02:31:42 PM
Actually ( Thanks albertlast ) it seems this may not be PostgreSQL specific.
There's a column added to a possibly prefilled table, with NOT NULL constraints - This if I understand everything correctly, should crap itself on MySQL just as well. But it doesn't, as MySQL works around this on it's own.

EDIT:
Logged https://github.com/SimpleMachines/SMF2.1/issues/7345
Title: Re: Error upgrading 2.0.19 to 2.1.1 - "credits" of relation "smf_log_packages" (Postgre)
Post by: Pastroious on February 23, 2022, 11:32:49 AM
Quote from: Matthias on February 22, 2022, 02:27:18 PMWhat modifications did you have installed at the 2.0.19 version?
Can you post the contents of the log_packages table here?
Maybe this will help to verify the error.

From DB backup:
COPY public.smf_log_packages (id_install, filename, package_id, name, version, id_member_installed, member_installed, time_installed, id_member_removed, member_removed, time_removed, install_state, failed_steps, themes_installed$
1       recount_member_posts_v1.1.zip   vbgamer45:RecountMemberPosts    Recount Member Posts    1.1     1       Admin   1569156535      0       0       0       1       a:0:{}  1
2       smf_patch_2.0.16.tar.gz smf:smf-2.0.16  SMF 2.0.16 Update       1.0     1       Admin   1587922800      0       0       0       1       a:0:{}  1
3       smf_patch_2.0.17.tar.gz smf:smf-2.0.17  SMF 2.0.17 Update       1.0     1       Admin   1587922931      0       0       0       1       a:0:{}  1
4       smf_patch_2.0.16.tar.gz smf:smf-2.0.16  SMF 2.0.16 Update       1.0     1       Admin   1641747864      0       0       0       2       a:0:{}  1
5       smf_patch_2.0.17.tar.gz smf:smf-2.0.17  SMF 2.0.17 Update       1.0     1       Admin   1641747904      0       0       0       2       a:0:{}  1
6       smf_patch_2.0.18.tar.gz smf:smf-2.0.18  SMF 2.0.18 Update       0.1.0   1       Admin   1641747938      0       0       0       1       a:0:{}  1
7       smf_patch_2.0.19.tar.gz smf:smf-2.0.19  SMF 2.0.19 Update       1.0     1       Admin   1641747977      0       0       0       1       a:0:{}  1
\.
Title: Re: Error upgrading 2.0.19 to 2.1.1 - "credits" of relation "smf_log_packages" (Postgre)
Post by: Aleksi "Lex" Kilpinen on February 23, 2022, 11:45:04 AM
Thank you for the report, this should be fixed with #7346 (https://github.com/SimpleMachines/SMF2.1/pull/7346) in the next version released.
Title: Re: Error upgrading 2.0.19 to 2.1.1 - "credits" of relation "smf_log_packages" (Postgre)
Post by: Matthias on February 23, 2022, 05:25:48 PM
Ok, seems like it's better to check things double at some cases.