[BUG] Version 3.1.0 PHP error (corrupted database few days after update)

Ask for help or provide support to other members.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Version 3.1.0 PHP error

Post by wiz »

Hi Void, welcome to the community!

Did this happen after upgrading to 3.1.1 or whilst upgrading?
How far was the database cut off?

Is there any more details you could provide in regards to which version of WCMS you ever using?
Was this after upgrading to 3.1.1 or did you have a clean install? If you upgraded, how many days approximately passed before this happened?
User avatar
VoidConflict
Posts: 3
Joined: Sat Aug 01, 2020 2:23 pm

Re: Version 3.1.0 PHP error

Post by VoidConflict »

wiz wrote: Tue Aug 04, 2020 8:53 am Hi Void, welcome to the community!

Did this happen after upgrading to 3.1.1 or whilst upgrading?
How far was the database cut off?

Is there any more details you could provide in regards to which version of WCMS you ever using?
Was this after upgrading to 3.1.1 or did you have a clean install? If you upgraded, how many days approximately passed before this happened?
It was not during the upgrade, I upgraded to 3.1.1 the day it released and the issue happened the day I posted to this forum. I started on the version before that with a clean install some time in July. My database file went from 27.3 KB to 16.1KB.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Version 3.1.0 PHP error

Post by wiz »

Thanks for the additional feedback, this is one of those things what will be absolutely prioritised, as we don't want users databases to be corrupting.
We believed we fixed this with version 3.1.1, but obviously this doesn't seem to be the case.

Thank you very much for your feedback, helps a lot!
jbwonderadmin
Posts: 12
Joined: Sun Jul 12, 2020 4:59 pm

Re: [BUG] Version 3.1.0 PHP error (corrupted database few days after update)

Post by jbwonderadmin »

Should I expect this issue is resolved now and should not be expected to recur right now?

How can I collect e.g. logs to provide more info in case this somehow happens again?
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: [BUG] Version 3.1.0 PHP error (corrupted database few days after update)

Post by wiz »

This issue has still happened on 2 ocassions and we are still actively trying to debug the bug.
Any PHP logs when this happens would be immensley helpful. How experienced are you with logging errors? (Not much experience on my end, tbh)
jbwonderadmin
Posts: 12
Joined: Sun Jul 12, 2020 4:59 pm

Re: [BUG] Version 3.1.0 PHP error (corrupted database few days after update)

Post by jbwonderadmin »

I just observed that my database again blanked on 9/27. I restored it from a backup but this is getting frustrating.

I haven't found logs for this time period on my server so I am a bit confused.
jbwonderadmin
Posts: 12
Joined: Sun Jul 12, 2020 4:59 pm

Re: [BUG] Version 3.1.0 PHP error (corrupted database few days after update)

Post by jbwonderadmin »

This seems to be a very difficult bug to work out. In the meantime, may I make the following suggestion:
-periodically backup just the database.js file to somewhere
-if the site hits the no database error and/or sees a database.js of 0 bytes, rather than returning the messy PHP string, have it restore database.js from the backup
This is obviously a dangerous kludge and not a long-term solution but it would make the software functional at a basic level, which has been an issue with this 3.x.x release due to this fatal error.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: [BUG] Version 3.1.0 PHP error (corrupted database few days after update)

Post by wiz »

Hi everyone.

Slaven has just created a pull request which I will review and test today and tomorrow.

Subsequently, I'll create a new release so this issue can be debugged and the fix can be upgraded if necessary.

The new fix will check if the database is corrupted or too small in size and not overwrite the database.

Additionally, it will create an error log in the data folder, which should give us insight (for those users that will share their logs) where the issue relies. JB, please share it since you seem to be able to reproduce the issue quite often.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: [BUG] Version 3.1.0 PHP error (corrupted database few days after update)

Post by wiz »

3.1.2 has just been released. Please update to the latest version to prevent the database from being corrupt.
We have enabled the debugging - JB, please check your data folder often to see if there's an error log explaining why the database is being corrupted?

The log will tell us more, and the database will not be overwritten as Slaven implemented a fail safe to prevent it from being overwritten with 0 bytes.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: [BUG] Version 3.1.0 PHP error (corrupted database few days after update)

Post by wiz »

Hey JB.

Would you mind checking your /data folder for any logs which might help up debug this?
This will only appear if you're on the latest version of WonderCMS (3.1.2) where we included this debugging.
Post Reply