Database SP-7 Error: Table doesn't exist!

Hello,
I had issues with my DB (Important: Specify Database Backups Can Fail - #2 by Heryk) so I decided to restore a previous version. However now I’m getting a new error message when authenticating in SP-7:

{"exception": "ProgrammingError", "message": "1146", "data": "Table 'mycology.spuserpolicy' doesn't exist",...

I thought it was may be linked to a sp-7 upgrading issue so as indicated in another ticket (Upgrading to Specify 7.7+: HTTP 500 error - Documentation / Configuration & Installation - Specify Community Forum (specifysoftware.org)), I used my DB root credentials as my master credentials when starting the containers (Sp-7). But I’m still having the same issue error message. The missing tables are not added.

I also tried this sql command and starting over but it did not change anything:

delete from django_migrations where app = 'permissions';

Any suggestions would be very appreciated.
Thanks

PS. I created a new local dummy DB on SP-6. Then I made a backup of it and restored on my server DB. However, I’m still stuck with the same SP-7 error message…

{"exception": "ProgrammingError", "message": "1146", "data": "Table 'mycology.spuserpolicy' doesn't exist", 

BTW, the table spuserpolicy is missing in both my local and server DB.

If I understand it correctly, SP 7.9.6.2 is supposed to add certain new tables to the SP-6 created database… but it doesn’t seem to be working here despite using my DB root credentials as my master credentials when starting the containerized Sp-7.

I read this post describing a similar “Table doesn’t exist” error message… Data Export for Webportal / Specify 7.7 Upgrade - Get Help - Specify Community Forum (specifysoftware.org)

So I manually modify the DB AppVersion to 6.8.01 in the spversion table and redeployed SP-7. Unfortunately, it not solve my problem (same error message) so I put it back to 6.8.03. BTW, my SchemaVersion is 2.9.

I finally got it to work… I’m not sure what fixed it. I had to restart from scratch! I deleted the mycology DB and the SP-7 docker instance (including the volumes) on my web server. Then I created a new backup file of mycology DB located on my computer and restored it on the server DB. And finally, I recreated all the SP-7 containers on the web server. There was something blocking me from deploying with SP-7. Probably something to do with an SP-7 (7.9) update not able to add its necessary new tables to my SP-6 created DB. BTW. I temporally used my DB root credentials in my container config for initial startup of the container. I will now put back the DB master credentials in my SP-7 config. Cheers

1 Like

You run the container the first time. Then you have to restart it a second time for it to create that table.