Make WordPress Core

Opened 10 years ago

Last modified 2 months ago

#36887 new defect (bug)

Database upgrades should fail gracefully

Reported by: pento's profile pento Owned by:
Milestone: Future Release Priority: low
Severity: normal Version:
Component: Upgrade/Install Keywords: needs-patch
Focuses: administration Cc:

Description

Currently, wp-admin/upgrade.php and wp_upgrade() don't check that the database has actually upgraded properly, before returning a success message.

Making them fail gracefully would be nice.

Change History (3)

#1 @BobNwp
10 years ago

  • Severity changed from minor to normal
  • Type changed from enhancement to defect (bug)

Any one wishing to know more about this issue should read the original ticket #36886

Also - I changed the "type" of this ticket from enhancement to defect (bug). There is no way that it can be considered an enhancement to fix code which issues a message saying that the database update was successful when an error occurred - and the error is displayed right above the false positive message.

It is a defect, a bug.

I've also changed it from resolve as invalid to leave open.

I have no idea what invalid means but I would think the report should be left open until the issue is actually resolved.

I also changed it from minor to normal.

Last edited 4 years ago by SergeyBiryukov (previous) (diff)

#2 @desrosj
3 years ago

  • Milestone set to Future Release

Looks like the milestone was removed on this one. Re-adding as this still seems like a worthy improvement.

#3 @jdeep
2 months ago

I am planning to work on this ticket. I had a few questions regarding the fix.

  1. Should the fix use explicit validation after every upgrade_xxx() function to verify that the expected schema changes were applied?
  1. Do we want to log detailed debug information (e.g., failed SQL statement, stack trace) to a log file, or keep the error message shown to the user minimal for security reasons?
  1. Should the process halt immediately on the first failure, or should it attempt to run all steps (can cause cascading errors) and report a summary of all failures at the end?

My thought process is, having a Higher Order Function like safe_upgrade() which will call one of the upgrade functions and log errors if there are any.

Note: See TracTickets for help on using tickets.