umami
umami copied to clipboard
Event data and chart not appearing.
Vercel function logs error:
ERROR PrismaClientKnownRequestError: Raw query failed. Code: `42703`. Message: `column "event_name" does not exist`
at RequestHandler.handleRequestError (/var/task/node_modules/@prisma/client/runtime/index.js:28658:13)
at RequestHandler.request (/var/task/node_modules/@prisma/client/runtime/index.js:28640:12)
at async consumer (/var/task/node_modules/@prisma/client/runtime/index.js:29618:18)
at async Proxy._request (/var/task/node_modules/@prisma/client/runtime/index.js:29639:16)
at async __WEBPACK_DEFAULT_EXPORT__ (/var/task/.next/server/pages/api/website/[id]/events.js:153:24)
at async Object.apiResolver (/var/task/node_modules/next/dist/server/api-utils/node.js:184:9)
at async NextNodeServer.runApi (/var/task/node_modules/next/dist/server/next-server.js:381:9)
at async Object.fn (/var/task/node_modules/next/dist/server/base-server.js:491:37)
at async Router.execute (/var/task/node_modules/next/dist/server/router.js:213:36)
at async NextNodeServer.run (/var/task/node_modules/next/dist/server/base-server.js:610:29) { code: 'P2010', clientVersion: '4.1.1', meta: { code: '42703', message: 'column "event_name" does not exist' }}
ERROR PrismaClientKnownRequestError: Raw query failed. Code: `42703`. Message: `column "event_name" does not exist`
at RequestHandler.handleRequestError (/var/task/node_modules/@prisma/client/runtime/index.js:28658:13)
at RequestHandler.request (/var/task/node_modules/@prisma/client/runtime/index.js:28640:12)
at async consumer (/var/task/node_modules/@prisma/client/runtime/index.js:29618:18)
at async Proxy._request (/var/task/node_modules/@prisma/client/runtime/index.js:29639:16)
at async __WEBPACK_DEFAULT_EXPORT__ (/var/task/.next/server/pages/api/website/[id]/events.js:153:24)
at async Object.apiResolver (/var/task/node_modules/next/dist/server/api-utils/node.js:184:9)
at async NextNodeServer.runApi (/var/task/node_modules/next/dist/server/next-server.js:381:9)
at async Object.fn (/var/task/node_modules/next/dist/server/base-server.js:491:37)
at async Router.execute (/var/task/node_modules/next/dist/server/router.js:213:36)
at async NextNodeServer.run (/var/task/node_modules/next/dist/server/base-server.js:610:29) { code: 'P2010', clientVersion: '4.1.1', meta: { code: '42703', message: 'column "event_name" does not exist' }}
Screenshot

Can you try running yarn check-db against your database?
Same issue here after upgrading to 1.37.0 (running the postgres variant).
Output from check-db:
/app $ yarn check-db
yarn run v1.22.19
$ node scripts/check-db.js
✓ DATABASE_URL is defined.
✓ Database connection successful.
✓ Database tables found.
✓ Database is up to date.
Done in 1.40s.
/app $
same "something went wrong" error message
Can you try running
yarn check-dbagainst your database?
$ yarn check-db
yarn run v1.22.19
$ node scripts/check-db.js
✓ DATABASE_URL is defined.
✓ Database connection successful.
✓ Database tables found.
✓ Database is up to date.
Done in 9.01s.
I was able to resolve this issue by manually applying the 02_add_event_data migration.
Shouldn't this be done automatically?
You can also migrate your old event data to the new event table by using the migration in this comment https://github.com/umami-software/umami/issues/1406#issuecomment-1213355769.
I am getting an error with the migration:
Database error:
ERROR: relation "account.username_unique" does not exist
However it seems there was an IF EXISTS added here, which doesnt exist in the image I am using: https://github.com/umami-software/umami/blob/master/db/postgresql/migrations/02_add_event_data/migration.sql#L57
So maybe that is already fixed?
@matthiasharrer At one point, there was a state where the migration file did not have the "IF EXISTS". I imagine you're on that version. Please pull the latest version and try again.
That indeed worked for me. Thanks @briancao :) I would however have expected the image tag to somehow change when the contents change (e.g. a new bugfix release 1.37.1). Otherwise it's hard to know what you are actually running.