Mongo : Problem with the roles configuration for the user of "fireworks" db

Hi,

I have a problem with roles on mongodb v3.4.4

I have created a use “a2s_FW” on the fireworks db in mongodb :

$ mongo fireworks -u “a2s_FW” -p “XXXXXXXXXXXXX”

MongoDB shell version v3.4.4

connecting to: mongodb://127.0.0.1:27017/fireworks

MongoDB server version: 3.4.4

db.getUsers()

[

    {
            "_id" : "fireworks.a2s_FW",
            "user" : "a2s_FW",
            "db" : "fireworks",
            "roles" : [
                    {
                            "role" : "dbOwner",
                            "db" : "fireworks"
                    },
                    {
                            "role" : "readWrite",
                            "db" : "fireworks"
                    }
            ]
    }

]

But the roles I have used seems not sufficient to use Firework, : launchpad.add_wf() ends up with errors like this one :

pymongo.errors.OperationFailure: not authorized on fireworks to execute command { findAndModify:

“fw_id_assigner”, query: {}, new: false, update: { $inc: { next_fw_id: 1 } }, upsert: false }

The fireworks documentation use an older version of the mongoDB shell, could you just tell me which roles are missing ?

Honestly with dbOwner & readWrite I thought I have total control on it, but I was obviously wrong …

Cheers,
David

Hi David

As far as I know, both dbOwner and readWrite users should be able to execute a findAndModify command. For example:

http://stackoverflow.com/questions/30973872/mongodb-how-to-add-findandmodify-privilege-to-a-user

If you are using a configuration file to instantiate the launchpad, can you double-check that:

  1. Your my_launchpad.yaml configuration file has the credentials for the a2s_FW user in the keys: “username” and “password”

  2. You are actually using that configuration file (and not some other one on your system) to load the LaunchPad. e.g., using Launchpad.from_file() and giving the explicit path to that configuration file.

If you are not using a configuration file, that when instantiating the LaunchPad object in Python that your username and password is correctly entered?

One other way to check this is, in that Mongo shell you opened, to execute a findAndModify command manually (perhaps modify one of the fw_id_assigner documents to add a new temp key and then remove it; backup the collection beforehand if you’re nervous about this). If you can do it in the mongo shell, the next step is to try that same operation in pymongo. If both those work I can’t see any reason why FWS wouldn’t also work.

Best,

Anubhav

···

On Fri, May 5, 2017 at 8:36 AM, [email protected] wrote:

Hi,

I have a problem with roles on mongodb v3.4.4

I have created a use “a2s_FW” on the fireworks db in mongodb :

$ mongo fireworks -u “a2s_FW” -p “XXXXXXXXXXXXX”

MongoDB shell version v3.4.4

connecting to: mongodb://127.0.0.1:27017/fireworks

MongoDB server version: 3.4.4

db.getUsers()

[

    {
            "_id" : "fireworks.a2s_FW",
            "user" : "a2s_FW",
            "db" : "fireworks",
            "roles" : [
                    {
                            "role" : "dbOwner",
                            "db" : "fireworks"
                    },
                    {
                            "role" : "readWrite",
                            "db" : "fireworks"
                    }
            ]
    }

]

But the roles I have used seems not sufficient to use Firework, : launchpad.add_wf() ends up with errors like this one :

pymongo.errors.OperationFailure: not authorized on fireworks to execute command { findAndModify:

“fw_id_assigner”, query: {}, new: false, update: { $inc: { next_fw_id: 1 } }, upsert: false }

The fireworks documentation use an older version of the mongoDB shell, could you just tell me which roles are missing ?

Honestly with dbOwner & readWrite I thought I have total control on it, but I was obviously wrong …

Cheers,
David

You received this message because you are subscribed to the Google Groups “fireworkflows” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

Visit this group at https://groups.google.com/group/fireworkflows.

To view this discussion on the web visit https://groups.google.com/d/msgid/fireworkflows/74f74a8c-827c-4538-a348-cda2d7bca8c9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Best,
Anubhav

Hi,

Using Launchpad.from_file() works, thank you very much !

I have configured fireworks using the “FW_config.yaml” file located at the install root of fireworks (as given by lpad version).
In this file, I have set :
CONFIG_FILE_DIR: /home/dmichea/Server/A2S/config

and I have a provided a “my_launchpad.yaml” file in this directory with all information needed inside. The config is well loaded when I use the shell command “lpad”, but not when I use it through python.

Just for my information, is there an alternative way to configure the python Launchpad without explicitly provide the configuration file with from_file() method ?

Best,
David

···

Le vendredi 5 mai 2017 17:36:32 UTC+2, [email protected] a écrit :

Hi,

I have a problem with roles on mongodb v3.4.4

I have created a use “a2s_FW” on the fireworks db in mongodb :

$ mongo fireworks -u “a2s_FW” -p “XXXXXXXXXXXXX”

MongoDB shell version v3.4.4

connecting to: mongodb://127.0.0.1:27017/fireworks

MongoDB server version: 3.4.4

db.getUsers()

[

    {
            "_id" : "fireworks.a2s_FW",
            "user" : "a2s_FW",
            "db" : "fireworks",
            "roles" : [
                    {
                            "role" : "dbOwner",
                            "db" : "fireworks"
                    },
                    {
                            "role" : "readWrite",
                            "db" : "fireworks"
                    }
            ]
    }

]

But the roles I have used seems not sufficient to use Firework, : launchpad.add_wf() ends up with errors like this one :

pymongo.errors.OperationFailure: not authorized on fireworks to execute command { findAndModify:

“fw_id_assigner”, query: {}, new: false, update: { $inc: { next_fw_id: 1 } }, upsert: false }

The fireworks documentation use an older version of the mongoDB shell, could you just tell me which roles are missing ?

Honestly with dbOwner & readWrite I thought I have total control on it, but I was obviously wrong …

Cheers,
David

Hi David,

LaunchPad.auto_load() should work - let me know if it doesn’t.

Best,

Anubhav

···

On Tuesday, May 9, 2017 at 4:32:47 AM UTC-7, [email protected] wrote:

Hi,

Using Launchpad.from_file() works, thank you very much !

I have configured fireworks using the “FW_config.yaml” file located at the install root of fireworks (as given by lpad version).
In this file, I have set :
CONFIG_FILE_DIR: /home/dmichea/Server/A2S/config

and I have a provided a “my_launchpad.yaml” file in this directory with all information needed inside. The config is well loaded when I use the shell command “lpad”, but not when I use it through python.

Just for my information, is there an alternative way to configure the python Launchpad without explicitly provide the configuration file with from_file() method ?

Best,
David

Le vendredi 5 mai 2017 17:36:32 UTC+2, [email protected] a écrit :

Hi,

I have a problem with roles on mongodb v3.4.4

I have created a use “a2s_FW” on the fireworks db in mongodb :

$ mongo fireworks -u “a2s_FW” -p “XXXXXXXXXXXXX”

MongoDB shell version v3.4.4

connecting to: mongodb://127.0.0.1:27017/fireworks

MongoDB server version: 3.4.4

db.getUsers()

[

    {
            "_id" : "fireworks.a2s_FW",
            "user" : "a2s_FW",
            "db" : "fireworks",
            "roles" : [
                    {
                            "role" : "dbOwner",
                            "db" : "fireworks"
                    },
                    {
                            "role" : "readWrite",
                            "db" : "fireworks"
                    }
            ]
    }

]

But the roles I have used seems not sufficient to use Firework, : launchpad.add_wf() ends up with errors like this one :

pymongo.errors.OperationFailure: not authorized on fireworks to execute command { findAndModify:

“fw_id_assigner”, query: {}, new: false, update: { $inc: { next_fw_id: 1 } }, upsert: false }

The fireworks documentation use an older version of the mongoDB shell, could you just tell me which roles are missing ?

Honestly with dbOwner & readWrite I thought I have total control on it, but I was obviously wrong …

Cheers,
David