julien-nc / cospend-nc

💰 💲hared budget manager Nextcloud app
GNU Affero General Public License v3.0
238 stars 29 forks source link

Failed to create project #299

Closed admorgan closed 2 months ago

admorgan commented 2 months ago

When trying to create a new project I get a popup error stating the title with Internal Error 500.

I am on Nextcloud: 29.0.4.1 Cospend App Version: 1.6.1 PostgreSQL: 13.12

Log from Nextcloud: Error: An exception occurred while executing a query: SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint "oc_cospend_categories_pkey" DETAIL: Key (id)=(14) already exists. POST /ocs/v2.php/apps/cospend/api/v1/projects from 204.77.163.109 by admorgan at Aug 28, 2024, 2:19:20 PM

julien-nc commented 2 months ago

Have you ever made manual operations to your database?

I'm only guessing here: oc_cospend_categories_pkey is the internal name for the primary key of the oc_cospend_categories table. This is an auto incremented integer. There should never be a unique constraint violation on autoincrement IDs unless something confused Postgres which tries to use a number that is already used in another row.

admorgan commented 2 months ago

I have not. I haven't tried to use this app in a long time, but recently needed to. I seem to be able to modify existing projects, just not create new ones.

julien-nc commented 2 months ago

You can try:

If my assumption is correct, Postgre should be fine from there.

I have no idea what could have messed with your autoincrement value for this table.

admorgan commented 2 months ago

That worked great. Thank you!