studio
studio copied to clipboard
Unable to process `count` query undefined
When trying to use Studio this error happens:
Since we're open source we can share our prisma schema without problems:
https://github.com/calcom/cal.com/blob/main/packages/prisma/schema.prisma
We can run queries just fine, it just crashes when trying to open up Studio.
To Reproduce Steps to reproduce the behavior:
- Go to https://cloud.prisma.io
- Fork this repo and setup a new project with it
- Set
packages/prisma/schema.prisma
as schema path. - Go to Studio
- See error
Originally posted by @zomars in https://github.com/prisma/studio/issues/871#issuecomment-1075347171
We can run queries just fine
What exactly does this refer to? The Query Console of Prisma Data Platform?
Can you maybe share your project name and URL on cloud.prisma.io?
We can run queries just fine
What exactly does this refer to? The Query Console of Prisma Data Platform?
The Data Browser specifically is the one failing
Can you maybe share your project name and URL on cloud.prisma.io?
Sure thing, it is https://cloud.prisma.io/zomars/calcom/staging/databrowser
This only seems to happen when provisioning my own DB url, generating one from Heroku doesn't have this problem.
Using a DB url with this format: postgresql://user:[email protected]:5432/calendso?schema=public
Interesting :/
Where do you host that database? Anything special about it or the user you use to connect to it? Do you have any output in the developer console when opening the data browser? Maybe the specific "query" that fails... Are you sure the database is fully migrated to the state of the schema file that the data browser is using (via the repo that you connected)?
We recently upgraded from prisma 3.2. So it May have something to do with it
Running into this issue too.
The full error message in the browser console says:
The provided database string is invalid. Error parsing connection string: empty host in database URL. Please refer to the documentation in https://www.prisma.io/docs/reference/database-reference/connection-urls for constructing a correct connection string. In some cases, certain characters must be escaped. Please check the string for any illegal characters.
The way we're setting our database URL is a little funky because we're using Doppler to manage secrets. Our schema.prisma
file looks like this:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
And our .env
file looks like this:
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
Where those POSTGRES_
environment variables are defined in Doppler.
If I hard-code the url
in schema.prisma
to be a fully-defined database URL, then I'm able to load Prisma Studio.
Max, I think that sounds like an unrelated problem that just surfaces the same way. Can you please open a new issue? (Are you trying to start Studio locally, or are you on cloud.prisma.io in the Data Browser as Omar?)
@zomars are you by any chance using Safari? I had this error, and it only appears in Safari. works ok in Chrome
@zomars are you by any chance using Safari? I had this error, and it only appears in Safari. works ok in Chrome
Yes I'm using Safari. Didn't mention it since I don't think it should affect, but seems I'm wrong.
@zomars are you by any chance using Safari? I had this error, and it only appears in Safari. works ok in Chrome
switching from Safari to chrome fixed this issue for me
Yes using Safari. Not a Chrome user here
I found this is only happening if my database is misaligned with my Prisma schema β are you sure yours are in sync?
I found this is only happening if my database is misaligned with my Prisma schema β are you sure yours are in sync?
Yes. They are in sync. It seems this happens when a record has a large amount of relationships (More than 10k). Filtering out those columns works as a workaround.
Still happening. Confirming that this happens in Safari, but not in Chrome. Seems like a critical bug to me.
@neoromantic, are you also using the Data Browser in Prisma Data Platform (if yes, could you share the owner and project name)? What database are you using? Do you have a large number of relationships?
This is still happening on latest prisma BTW:
same here, but using a custom folder for Prisma, for MongoDB. The nodejs application works fine, but Prisma Studio show this error when it start Prisma studio.
βοΈ Note: This error occurs only on Safari. Opening the same URL/project in Chrome, error disappear
Thanks for the extra info! Do you have a relatively large number of relationships?
npx prisma db push
solved it for me
npx prisma db push <- solved safari issue for me too.
This error occurred to me while trying to run it on a local version of mongodb that wasn't a replica set, as soon as I ran it on my replica set it worked in safari without issue.
This might happen while trying to load non existing tables on current database but existing on Prisma's schema. As mentioned above, make sure to npx prisma db push
and then re-launch studio. Solved it for me too.
Happened to me if you set the mongo url in env() function
url = env("DATABASE_URL")
should be :
url = "DATABASE_URL"
@zomars are you by any chance using Safari? I had this error, and it only appears in Safari. works ok in Chrome
That is weird. Didn't know this could have been a problem
Still happening. Confirming that this happens in Safari, but not in Chrome. Seems like a critical bug to me.
Same for me today. Safari showed error above, while Firefox did not.
Additional console error context:
Firefox shows the same console errors, but doesn't "Fatal error" like Safari
Either way, db push
fixed the issue.
Maybe you should try using dotenv
cli to provide correct environment variables to Studio
yarn global add dotenv-cli
dotenv -e .env.local -- npx prisma studio
Can confirm.
npx prisma db push
fixed it for Safari. Chrome already worked.
If anyone's encountering this with supabase and pgbouncer, and using different ports for pooling and non-pooling, try changing the port numbers, that fixed it for me. Now I just need to check if the port actually pools or if my code reversed the two.
same here, but using a custom folder for Prisma, for MongoDB. The nodejs application works fine, but Prisma Studio show this error when it start Prisma studio.
βοΈ Note: This error occurs only on Safari. Opening the same URL/project in Chrome, error disappear
drum bro, Thanks
I found this is only happening if my database is misaligned with my Prisma schema β are you sure yours are in sync?
This is the case with me too. Running prisma db push
fixes itπ.