man-group / arctic

High performance datastore for time series and tick data
https://arctic.readthedocs.io/en/latest/
GNU Lesser General Public License v2.1
3.05k stars 583 forks source link

How to disable warning from list_libraries()? #872

Closed rtadewald closed 3 years ago

rtadewald commented 4 years ago

Arctic Version

1.79.3

Arctic Store

All of them

Description of problem and/or code sample that reproduces the issue

How can I disable the warning from store.list_libraries()?

WARNING:root:Could not read from cache due to: not authorized on meta_db to execute command { find: "cache", filter: { type: "list_libraries" }, limit: 1, singleBatch: true, lsid: { id: UUID("68522509-d7cb-46b5-aad6-2ce56242914a") }, $db: "meta_db", $readPreference: { mode: "primaryPreferred" } }. Ask your admin to give read permissions on meta_db:cache

shashank88 commented 4 years ago

Can you grant yourself read perms on that db?

rtadewald commented 4 years ago

Hi, @shashank88. Thanks for the answer.

I've already tried but I got a strange issue. I have 3 different arctic databases (each of them with it's own user). image

I granted permission to each user, in it's own database, using:

use "[db]"
db.getSiblingDB('[db]').grantRolesToUser("user", [{role: "readWrite", db: "meta_db"}])

But, when I did that, the command list_libraries() started to show (sometimes) the other databases's libraries. I think it's related to the cache, but I dunno how to deal with it.

That's why I decided to revoke that permission and ask how to disable the warning.

rtadewald commented 4 years ago

Any idea?

shashank88 commented 3 years ago

@rtadewald sorry, forgot about this. Have pushed in a PR to not throw this warning and just fall back to the uncached version