-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Error in Connector on MongoDB executing listIndex: "system.views" #17006
Comments
This issue may be correlated to #16179 |
can confirm for Environment & setup
Prisma version
Any idea of working around it for now? |
You could try creating a role / adding privileges, so your user can read "system.views" like in https://dba.stackexchange.com/a/248945 |
I can confirm this exact same issue. Essentially, if you have any views in your database, it makes introspection impossible. I even tried the suggestion recommended by @Jolg42, but MongoDB Atlas version 5.0 and above does not allow configuring a Custom Role with access to system.views. |
Thx @Jolg42. I had to add the use admin
db.runCommand({ createRole: "readViewCollection",
privileges: [
{ resource: { db: "", collection: "system.views" }, actions: [ "find", "listIndexes"] }],
roles : []
})
db.grantRolesToUser('<your_user>', ['readViewCollection']); |
The admin user can no longer access this collection as it is internal. This is documented here. This is the error you get for MongoDB 5.0 or higher:
Therefore, I currently see no workaround for version 5.0+ unless I am missing something. |
@gfay63 hmm I see. I'm on 5.08 but I created the role as root user, maybe that's allowed still. But also I'm running a self-hosted replicaset instead of Atlas service. I'm curious what's the reason for the query to |
Yeah it’s an Atlas restriction beginning with 5.0.
I’m assuming it’s not intentional that it’s requiring a lookup to the
system.views. Even creating a special “prism” user that only has access to
the collections I want it to access, does not solve it.
Hopefully someone can respond re: when might be fixed. For now, I removed
all views. Needless to say, that is not desirable in the medium term.
…On Tue, Jan 10, 2023 at 10:05 AM Yannick Schuchmann < ***@***.***> wrote:
@gfay63 <https://github.com/gfay63> hmm I see. I'm on 5.08 but I created
the role as root user, maybe that's allowed still. But also I'm running a
self-hosted replicaset instead of Atlas service.
I'm curious what's the reason for the query to system.views by prisma
tho. Can somebody elaborate on this maybe?
—
Reply to this email directly, view it on GitHub
<#17006 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABC4PO57L3ZT3U4WD6TWMM3WRWCC3ANCNFSM6AAAAAATIJ4DGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Next step is for someone from our side to confirm this, and if we can (which I expect) to implement the changes necessary to not look at the views (or whatever it needs to avoid this). |
Have the same issue does any one know the status of getting a fix for this? |
If you're using Atlas, you can give your db user the Of course, this is a security issue and should not be considered a valid workaround. I hope a actual fix for this issue (and all other view related issues) will be available soon. |
Hi everyone, any news on this ? I've seen the views are in the pipe, and it seems to be already available for postgres with a preview flag, so I'm right by guessing it should come any time soon ? This bug and the #18424 are still pretty bloquing to work with mongo and introspection. |
Hi! Is there any info regarding this? Could we ask Prisma to skip the |
That sounds like a good idea to me. If you're interested, you could try to contribute, I think the relevant piece of code that needs a tweak is here: |
@Jolg42, will a trivial |
Note: this is now fixed in |
Seems to work for me! Thanks a lot for the fix =) |
I use |
Thanks for trying it out 🙌🏼 and Thanks to @christianledgard for the PR 💚 |
Bug description
I'm trying to run
npx prisma db pull
and getting the following error:The connection string is correct and the user has full DB admin privileges. I can't find mention of "system.views" in the Prisma codebase.
How to reproduce
4.8.0
on MongoDB4.4.18
Expected behavior
Expected to be able to import the Database
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: