Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.

Howto in case of upgrade ERROR: relation "cost_object_journals_pkey" does not exist"

  • If you use OpenProject and the update throws an error, follow this short howto:

    • enable recovery mode for the app
    • open the terminal
    • switch to postgres
    • have a look at the Indexes
    \d+ cost_object_journals
    • write down your "idx_12345_primary" key
    • alter the index
    ALTER INDEX "idx_12345_primary" RENAME TO "cost_object_pkey";
    • open a second terminal and do a manual migration
    • disable recovery mode and restart the app.


  • Thank you for sharing.

    There's a lot to unpack there, especially the postgres stuff.
    I can see how many users wouldn't know what to do there.

    Can you expand on all those 'postgres' parts and what to look for?

    The 'manual migration' may not be needed since the app will do that on restart exiting recovery mode.

Log in to reply