Skip to content

Troubleshooting Upgrades

Jon Crain edited this page Apr 19, 2019 · 1 revision

When coming from older versions of MunkiReport, there are a few common errors that you may see and things you may miss.

Wrong Serving Directory

Issue

Not Found  
The requested resource /index.php? was not found on this server.

Explanation

Document root is now in a directory called /public. The best practice is to serve your MunkiReport instance from this directory or make a symlink to this directory.

Fix

Serve the public directory not the MunkiReport root.

General error 17

Issue

ERROR: SQLSTATE[HY000]: General error: 17 database schema has changed...

Explanation

The schema change error means literally that, the schema of the table has changed and you can’t alter the table anymore without reloading.

Fix

Rerun the migration.

Failed Migration - no such column

Issue

ERROR: SQLSTATE[HY000]: General error: 1 no such column: ...

Explanation

There may be a column that the migration wants to update that was never in the original table and the sql query is failing. (someone have a better explanation for this one?)

Fix

Drop the failed migration table or manually convert the data. It will be named table-name_orig. This table holds the old data that is being migrated. If it is a table you don't mind losing, it is much simpler to drop and start over. In tests, 2.7.3 -> 4.x had trouble with bluetooth and munkireport tables and 2.13 -> 4.x had troubles with the smart_stats table.

Index Already Exists

Issue

ERROR: SQLSTATE[HY000]: General error: 1 index power_manufacture_date already exists

Explanation

The index already exists. SQL indexing is not my strong point. I'm not sure why this is happening TBH.

Fix

Edit the database and drop the indexes for the table with the issue.

Contribute

If you'd like to contribute, here is the pseudo-code I used for testing. https://gist.github.com/joncrain/a1ae1e35bd4d2d1c0ada2dca23e27b24 It would be helpful to have more tests with actual data.

Clone this wiki locally