News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Upgraded from 1.1.21 to 2.1.3 - DB error won't allow posts, blows up on checking

Started by Cal O'Shaw, April 12, 2023, 01:52:32 AM

Previous topic - Next topic

Cal O'Shaw

We just upgraded from SMF 1.1.21 to 2.1.3, using the smf_2-1-3_upgrade.zip package.
ISP php is version 8.1.17

Our ISP dropped support for the version of php we operated on, so we were unable to go in and from SMF delete MODs or take any other actions.

I uploaded the upgrade file, expanded it, and was able to access the upgrade screen, and ran it.  The upgrade reported no errors and i fired up 2.1.3.  I had manually enabled Maintenance Mode in settings.php to prevent any users coming in.

Used the Package manager to delete all the MODs,

Ran Maintenance to check versions, all were at 2.1.3.

Ran Maintenance rebuild settings.php, no issues.

Mail could be read, sent, received.

Posts could be read.

I went to test writing a post and it refused to post and threw an error (Error 4 from log, see file ScreenCaps.docx)

I then ran a Maintenance task (I think it was Find any errors) which generated this error (sorry, I didn't start logging the steps at this point so I don't remember which task threw Error 5 from log, see file ScreenCaps.pdf).

So I thought I'd better run Maintenance 'Find any errors' again.

It ran for awhile, was at 19% total completion, the bottom progress bar was checking "Topics with incorrect first or last message entries (12.7%)" and blew, clearing the screen and displayed the last image in ScreenCaps.pdf
I tried a few more times and blew at about the same place.

I haven't worked on this stuff in over 10 years (I bet SMF 1.1.21 gave that away) and SQL at least 20 years.

I've attached settings.php, and the two files that are listed in the error log, /Sources/Sub-Post.php and /Sources/ManageMaintenance.php

The screen captures of the two error log messages and the crash message from checking the database are in ScreenCaps.pdf

Your advice and assistance will be most welcome.

Aleksi "Lex" Kilpinen

Error 4: That's probably a left over field from a mod you used to use, and isn't configured properly for your current server setup. The "doesn't have a default value" is usually easy to fix by giving it a default value through PhpMyAdmin or a similar tool. In most cases NULL will work just fine.
If you are sure you don't need the field anymore, you can remove it as well.

Error 5: I'm not sure about this, but maybe try to fix the one error first, clean your error logs, and try again?
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Illori

i have removed your Settings.php file attachment. please do not attach that in public again. i would also recommend you to change your database password as it is contained in that file.

Doug Heffernan

Quote from: Cal O'Shaw on April 12, 2023, 01:52:32 AMI've attached settings.php

Did you remove the database details before attaching it? For future reference, you should never attach this file in its original form in the open as it poses a huge security risk.

Regarding the Field 'ua_os' doesn't have a default value error, as mentioned above, most likely it comes from a user agent mod. We 've seen that error often and if I recall it correctly, the aforementioned field can be found in the smf_messages table.

Can you also post a screenshot of the structure area for the smf_messages table?

Sir Osis of Liver

Sounds like upgrade didn't complete successfully.  Running maintenance task may have caused more damage.  Can you revert to an earlier php version?

When in Emor, do as the Snamors.
                              - D. Lister

Doug Heffernan

Quote from: Sir Osis of Liver on April 12, 2023, 12:54:43 PMSounds like upgrade didn't complete successfully. 

According to the op:

Quote from: Cal O'Shaw on April 12, 2023, 01:52:32 AMI uploaded the upgrade file, expanded it, and was able to access the upgrade screen, and ran it.  The upgrade reported no errors and i fired up 2.1.3. 

@Cal O'Shaw, can you check your server error log and see if any errors have been logged there from the time after you finished the upgrade?

Cal O'Shaw

Doug,

Thank you, you were right.  There was a cascading series of fields from the MODs that used to show browser and os, and another MOD that allowed adding a reason for editing.  The fields have been set to default=NULL.

I want to look over the files that would have used them before deleting them from the smf_messages table.

Now to see if I can run the check for errors.

Many thanks!!

Cal O'Shaw

I have the site operational, everything seems to be working, but I haven't left Maintenance Mode yet.

Two things still concerned about:

1) When I try to check for errors, at about 19% completion, where it checks "Topics with incorrect first or last message entries" at (15.9%), it blows up and the browser shows
array(2) {
 
=>
  array(3) {
    ["file"]=>
    string(52) "/home2/mcgarden/public_html/forum/Sources/Errors.php"
    ["line"]=>
    int(301)
    ["function"]=>
    string(9) "log_error"
  }
  [1]=>
  array(1) {
    ["function"]=>
    string(17) "smf_error_handler"
  }
}
Error loop.

2) Can I delete from the database all the ".backup" tables?  My available storage is getting a bit tight.


Thank you very much!

Sesquipedalian

Quote from: Cal O'Shaw on April 17, 2023, 03:41:41 PM2) Can I delete from the database all the ".backup" tables?  My available storage is getting a bit tight.

Don't delete them until all your current issues have been solved. You might need to restore the data from those backups at some point while trying to fix the issues.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Cal O'Shaw

Would it be possible for someone to tell what that code is that gets displayed?  It might help figure out what is blowing up and a possible fix.

Otherwise my site seems to be operating fine, as long as I don't try to check for errors, which seems to be asking for trouble.  In cPanel, MySQLDatabases says the database is fine.

I do thank everyone here for your suggestions and advice.  Grazie mille!

Arantor

The blow up is that an error occurred trying to log an error to the database...
Holder of controversial views, all of which my own.


shawnb61

To get past that error, I would try:
 - temporarily cutting over to file based sessions
 - running the error check
 - switching back to database sessions after it completes successfully

That error message is usually accompanied with a session error when running the error check.

It saves work to do in the session.  If there is a lot of work to do, it sometimes doesn't fit in a database session.  Using file based sessions temporarily works around that.
A question worth asking is born in experience & driven by necessity. - Fripp

Cal O'Shaw

Thank you for the suggestion, I do want to try it.

What do I need to do to do as you suggest?  Sorry, but it's been a real long time since I worked with SMF (1.x days).

Many thanks!

Advertisement: