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

Internal Server Error when resetting website #2915

Closed
ov3rk1ll opened this issue Aug 27, 2024 · 4 comments
Closed

Internal Server Error when resetting website #2915

ov3rk1ll opened this issue Aug 27, 2024 · 4 comments
Labels
bug Something isn't working fixed in dev Fixed in the dev branch

Comments

@ov3rk1ll
Copy link

Describe the Bug

I'm running the latest version in a docker environment.

When I try to reset a website, I only get a "Internal Server Error" on the page
image

as well as a prisma error on the container log

Database

PostgreSQL

Relevant log output

Invalid `prisma.session.deleteMany()` invocation:
The change you are trying to make would violate the required relation 'SessionToSessionData' between the `SessionData` and `Session` models.
    at _n.handleRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7749)
    at _n.handleAndLogRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7057)
    at _n.request (/app/node_modules/@prisma/client/runtime/library.js:121:6741)
    at async l (/app/node_modules/@prisma/client/runtime/library.js:130:9355) {
  code: 'P2014',
  clientVersion: '5.17.0',
{
    modelName: 'Session',
    relation_name: 'SessionToSessionData',
    model_a_name: 'SessionData',
    model_b_name: 'Session'
  }
}

Which Umami version are you using? (if relevant)

v2.13.1

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@franciscao633 franciscao633 added bug Something isn't working fixed in dev Fixed in the dev branch labels Aug 27, 2024
@franciscao633
Copy link
Collaborator

Forgot to add the cascading delete to prisma for session_data. If you need to reset the website in the meantime just delete all the data in that table for that specific website, then the reset should work.

@ThorANilsson
Copy link

Forgot to add the cascading delete to prisma for session_data. If you need to reset the website in the meantime just delete all the data in that table for that specific website, then the reset should work.

This solution works.

@dmonterde
Copy link

Hi, this is also present on the following relation:

The change you are trying to make would violate the required relation 'EventDataToWebsiteEvent' between the `EventData` and `WebsiteEvent` models.
    at _n.handleRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7749)
    at _n.handleAndLogRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7057)
    at _n.request (/app/node_modules/@prisma/client/runtime/library.js:121:6741)
    at async l (/app/node_modules/@prisma/client/runtime/library.js:130:9355) {
  code: 'P2014',
  clientVersion: '5.17.0',
  meta: {
    modelName: 'WebsiteEvent',
    relation_name: 'EventDataToWebsiteEvent',
    model_a_name: 'EventData',
    model_b_name: 'WebsiteEvent'
  }
}

@mikecao
Copy link
Collaborator

mikecao commented Nov 22, 2024

Fixed in v2.14.0.

@mikecao mikecao closed this as completed Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in dev Fixed in the dev branch
Projects
None yet
Development

No branches or pull requests

5 participants