Large Upgrade from 2.0.19 to 2.1.3 fails - undefined function allowedTo()

Started by OddballGreg, February 14, 2023, 03:18:56 PM

Previous topic - Next topic

OddballGreg

Hello there.

As the title says, I'm working on attempting to update a forum from SMF 2.0.19 to 2.1.3 via the large upgrade mechanism. However for some reason, every time the update comes to a table called `calendar_holidays_old`, it breaks as follows:

Converting table smf_calendar_holidays_old to UTF-8...PHP Fatal error:  Uncaught Error: Call to undefined function allowedTo() in /home/clients//web/blabla/Sources/Subs-Db-mysql.php:708
Stack trace:
#0 /home/clients//web/blabla/Sources/Subs-Db-mysql.php(494): smf_db_error('\n\t\t\t\t\tALTER TAB...', Object(mysqli))
#1 /home/clients//web/blabla/upgrade.php(3400): smf_db_query('', '\n\t\t\t\t\tALTER TAB...', Array)
#2 /home/clients//web/blabla/upgrade.php(3526): ConvertUtf8()
#3 /home/clients//web/blabla/upgrade.php(357): serialize_to_json()
#4 {main}
  thrown in /home/clients//web/blabla/Sources/Subs-Db-mysql.php on line 708

Fatal error: Uncaught Error: Call to undefined function allowedTo() in /home/clients/7cba3aafb453b09f2584595cb0e6a8cb/web/blabla/Sources/Subs-Db-mysql.php:708
Stack trace:
#0 /home/clients//web/blabla/Sources/Subs-Db-mysql.php(494): smf_db_error('\n\t\t\t\t\tALTER TAB...', Object(mysqli))
#1 /home/clients//web/blabla/upgrade.php(3400): smf_db_query('', '\n\t\t\t\t\tALTER TAB...', Array)
#2 /home/clients//web/blabla/upgrade.php(3526): ConvertUtf8()
#3 /home/clients//web/blabla/upgrade.php(357): serialize_to_json()
#4 {main}
  thrown in /home/clients//web/blabla/Sources/Subs-Db-mysql.php on line 708

I'm not sure what that this `smf_calendar_holidays_old` table is for, but for added context this forum is fairly long lived. I updated it via the Large Upgrade mechanism from a very old version of SMF back in 2018 as well.

One other interesting thing I did was attempt to modify the `Subs-Db-mysql.php` file by adding the line `require_once($sourcedir . '/Security.php');` to it.

That changed the failure to to be on the method `fatal_error()` rather than `allowedTo()`

Converting table smf_calendar_holidays_old to UTF-8...PHP Fatal error:  Uncaught Error: Call to undefined function fatal_error() in /home/clients//web/blabla/Sources/Subs-Db-mysql.php:721
Stack trace:
#0 /home/clients//web/blabla/Sources/Subs-Db-mysql.php(496): smf_db_error('\n\t\t\t\t\tALTER TAB...', Object(mysqli))
#1 /home/clients//web/blabla/upgrade.php(3400): smf_db_query('', '\n\t\t\t\t\tALTER TAB...', Array)
#2 /home/clients//web/blabla/upgrade.php(3526): ConvertUtf8()
#3 /home/clients//web/blabla/upgrade.php(357): serialize_to_json()
#4 {main}
  thrown in /home/clients//web/blabla/Sources/Subs-Db-mysql.php on line 721

Fatal error: Uncaught Error: Call to undefined function fatal_error() in /home/clients//web/blabla/Sources/Subs-Db-mysql.php:721
Stack trace:
#0 /home/clients//web/blabla/Sources/Subs-Db-mysql.php(496): smf_db_error('\n\t\t\t\t\tALTER TAB...', Object(mysqli))
#1 /home/clients//web/blabla/upgrade.php(3400): smf_db_query('', '\n\t\t\t\t\tALTER TAB...', Array)
#2 /home/clients//web/blabla/upgrade.php(3526): ConvertUtf8()
#3 /home/clients//web/blabla/upgrade.php(357): serialize_to_json()
#4 {main}
  thrown in /home/clients//web/blabla/Sources/Subs-Db-mysql.php on line 721

Is it possible that I could just drop this old calendar table or something to fix this? Appreciate your help greatly.

Arantor

Pretty sure you won't need smf_calendar_holidays_old - it's not a stock table. If you're not using the calendar you *definitely* don't care about it.
Holder of controversial views, all of which my own.


Sir Osis of Liver

I'd bet that's an old backup table that someone created manually.  Wonder why upgrader is bothering with it?
When in Emor, do as the Snamors.
                              - D. Lister

Arantor

Because the UTF-8 converter just does everything pretty blindly (it kinda has to, though)
Holder of controversial views, all of which my own.


Sir Osis of Liver

It's a bit too fussy, also causes upgrades to fail if not started in english.
When in Emor, do as the Snamors.
                              - D. Lister

Arantor

That's just your average bug - though I get how that can happen since by definition you'd need *all* the updated language strings for 2.1's upgrader to be available for a fully successful upgrade. Doesn't mean it can't be improved upon if it is actually acknowledged as room for improvement.
Holder of controversial views, all of which my own.


OddballGreg

Thanks for your speedy assistance once again everyone. :laugh: Just like last time as well. Can't say the SMF people aren't reliable. Dropping that table and making sure the language files was all it took. I did also update via the CLI if that's of any relevance for someone who happens across this thread, though I suspect the web upgrade would have been fine once the errant table was removed.

Thanks again!

Advertisement: