cgwire / kitsu

Collaboration Platform for Animation and VFX Productions
https://kitsu.cg-wire.com
GNU Affero General Public License v3.0
368 stars 101 forks source link

Having some trouble with migrating the database #588

Closed da-am closed 3 years ago

da-am commented 3 years ago

Hi all, I moved servers and am hitting a roadblock with the database. I'm a postgres beginner... Originally I created a dump with pg_dump and then restored it using pg_restore. This was before I saw there is a dump_database command in zou. Had some success with the pg_tools in that everything shows up and I can log in as my user but now when I try to make anything new - production, asset, etc - I get "An error occured while .... Please contact our support team. ". The weird part is that if I refresh the page it does get made. So is this a postgres issue, a redis issue, or some sort of permissions thing? Or something completely different :). I've granted all to the postgres user just in case but everything seems right. I can do an upgrade_db just fine. I redid all my permissions to the folders. I revoked tokens, I cleared old data... I'm stumped.

Any thoughts? Thank you!

LarsCawley commented 3 years ago

If you haven't checked the logs that would be where to look for clues. You will probably see something helpful there. Is everything the same on the new server? If Kitsu tries to send an email notification but the email config is not set up you can get errors like this.

frankrousseau commented 3 years ago

I don't know what's wrong. Maybe that you can try to clear your navigator cache too.

da-am commented 3 years ago

Oh, dang. It was late when I wrote that and I forgot about logs. So the gunicorn_error_log shows this:

psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "ix_project_name" DETAIL: Key (name)=(uygh) already exists.

Something that caught my eye:

ERROR in base: (psycopg2.errors.UndefinedColumn) column "project_id" of relat ion "api_event" does not exist

Is there something there?

Here are the logs if you'd like to poke through: https://files.da-am.com/d/9783d5aab7ee4a3fb9d7/

frankrousseau commented 3 years ago

Ok some tables and columns are missing.

da-am commented 3 years ago

That was it! I was missing project_id column with type uuid in the api_event table. Added that and everything works. Weird that it didn't get dumped. Thanks! Love the project!

frankrousseau commented 3 years ago

By the way @da-am if you can tell us which studios and which production you track with Kitsu, it would help to fill our portfolio page: https://www.cg-wire.com/en/studios.html

da-am commented 3 years ago

Well currently its just for myself when I work as a studio to clients. Whenever I work in a studio though I try to get them to switch :). I mostly do commercials with it on my own. If you want to check out what I have on my site: www.da-am.com. I did use Kitsu for most of the more recent jobs.

frankrousseau commented 3 years ago

Ok great, thank you @da-am!