Reply To: Unable to apply patch 318. Found foreign key table


The error is explicit. There are values in the cron_log table where the cron_id is set to 2 and to 3, but there are no entries in the cron table with an id of 2 or 3. Two options are provided. Change the cron_id in the those cron_log records to a value that does exist in the cron table or delete those records.

The update command:
UPDATE si_cron_log SET cron_id = 6 WHERE cron_id IN (2,3);
will set the cron_id to 6 for these records. Or the delete command:
DELETE FROM si_cron_log WHERE cron_id IN (2,3);
will delete these orphaned records.

I recommend the delete command. These records probably were associated with cron table entries that you deleted in the past and the history in the cron_log table was not cleaned up.

To either update or delete the records copy the command, go to the phpMyAdmin console and do:

1) Access the cron_log table
2) Select the SQL tab
3) Select the Clear button to clear the default content in the text box
4) Paste your copied command into the Run SQL query text box
5) Finally select the Go button to execute the command.

At this point, the orphaned records should not be orphaned/exist any more.

I recommend that you delete the content of the tmp/log/php.log file before accessing SI again in case there is another error, so it will be at the top of the file.

  • This reply was modified 3 years, 9 months ago by RRowley.