Why is there a database integrity error message during the system check page of the upgrade?

During the system check page the upgrader will detect what version of OpenX you are currently running and will compare the structure of the database versus the standard database schema for the detected version.

If it detects any differences it will halt the upgrade and report to you the fact that such differences need to be researched and fixed. It will not continue because the upgrade may need to alter the database in a way which may fail because of such differences.

If you view the openx/var/install.log file it will provide you details of what needs changing. For example:

task found: doRemoveIndex__audit__account_id
task found: doRemoveIndex__audit__advertiser_account_id
task found: doRemoveIndex__audit__website_account_id
#! database integrity check detected problems with the database
#! 3 indexes to remove

In this install.log it is saying that 3 indexes need removing.
task found: doRemoveIndex__audit__account_id
This shows you that the task is 'doRemoveIndex' the table is 'audit' and the index name is 'account_id'.

There could be many causes for an integrity issue.
The changes could be minor, like altering indexes, or could be major. Review the list of changes required and it should be possible to put your database back to a standard layout. If critical tables are missing, it may mean your current install is not fully correct and some parts of the program may not function properly.
If you install a new copy of OpenX, the same version of which you are trying to upgrade, into an empty database you will be able to compare the database structure to assist with fixing your database.

NOTE: If you attempted an upgrade which did not give an integrity issue but failed for some other reason and then did not properly rollback, your second upgrade attempt may give you the integrity error. In this case an upgrade has been only partially performed on your database without a proper rollback and the structure could be heavily altered. It would be recommended to restart with a backup of your database from before the upgrade attempt.