Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please make failed migrations give a different error than 'could not connect to db' #1645

Open
goetzk opened this issue Nov 5, 2024 · 0 comments

Comments

@goetzk
Copy link
Contributor

goetzk commented Nov 5, 2024

I was trying to run the Providence migrations from 195 to 197 via web and due to the issue reported in #1644 the migration was failing.

On the frontend CA reported "Could not connect to database. Check your database configuration in setup.php: 1061" but that wasn't actually the problem.

In CA logs was the actual problem:

app/log/log_db_errors_2024-11-05.txt <==

2024-11-05 21:01:05 - ERROR --> [1::1954859] {"code":245,"errorNumber":1061,"errorMessage":"Duplicate key name 'i_created_on'","sql":"\/*\n\tDate: 29 May 2024\n\tMigration: 197\n\tDescription: Add indexes to improve performance of created: and modified: searches\n*\/\n\n\/*==========================================================================*\/\n\ncreate index i_created_on on ca_change_log(logged_table_num, changetype, log_datetime);\n","stacktrace":"\/srv\/example.collectiveaccess.au\/providence\/app\/lib\/Db\/mysqli.php::caPrintStacktrace@356<br\/>\n\n\/srv\/example.collectiveaccess.au\/providence\/app\/lib\/Db\/DbStatement.php:Db_mysqli:execute@150<br\/>\n\n\/srv\/example.collectiveaccess.au\/providence\/app\/lib\/Db.php:DbStatement:executeWithParamsAsArray@261<br\/>\n\n\/srv\/example.collectiveaccess.au\/providence\/app\/lib\/BaseVersionUpdater.php:Db:query@128<br\/>\n\n\/srv\/example.collectiveaccess.au\/providence\/app\/lib\/BaseVersionUpdater.php:BaseVersionUpdater:performDatabaseUpdate@91<br\/>\n\n\/srv\/example.collectiveaccess.au\/providence\/app\/lib\/ConfigurationCheck.php:BaseVersionUpdater:applyDatabaseUpdate@617<br\/>\n\n\/srv\/example.collectiveaccess.au\/providence\/themes\/default\/views\/system\/configuration_error_schema_update_html.php:ConfigurationCheck:performDatabaseSchemaUpdate@48<br\/>\n\n\/srv\/example.collectiveaccess.au\/providence\/app\/lib\/ConfigurationCheck.php::require_once@123<br\/>\n\n\/srv\/example.collectiveaccess.au\/providence\/index.php:ConfigurationCheck:updateDatabaseSchema@51<br\/>\n"}

After modifying the migration I refreshed the CA frontend (which was showing that error) and the site appeared to hang - but it was due to CA actually starting the migration and the DB getting to work.

@goetzk goetzk changed the title Please make failed migrations give a different error than 'could not connect to db'. Please make failed migrations give a different error than 'could not connect to db' Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant