Skip to content

st2-track-result is not picking up auth credentials #4109

@nmaludy

Description

@nmaludy

Problem

When running the st2-track-result command i'm receiving the following error:

[root@nickdevstd01 ~]# st2-track-result 5aeaf8d15954971fd3cc34db
2018-05-03 08:06:02,191 INFO [-] Connecting to database "st2" @ "127.0.0.1:27017" as user "None".
Traceback (most recent call last):
  File "/usr/bin/st2-track-result", line 110, in <module>
    setup()
  File "/usr/bin/st2-track-result", line 43, in setup
    script_setup.setup(config, register_mq_exchanges=False)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/script_setup.py", line 92, in setup
    db_setup()
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/database_setup.py", line 56, in db_setup
    connection = db_init.db_setup_with_retry(**db_cfg)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/persistence/db_init.py", line 75, in db_setup_with_retry
    ssl_match_hostname=ssl_match_hostname)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/persistence/db_init.py", line 59, in db_func_with_retry
    return retrying_obj.call(db_func, *args, **kwargs)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/retrying.py", line 206, in call
    return attempt.get(self._wrap_exception)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/models/db/__init__.py", line 131, in db_setup
    db_ensure_indexes()
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/models/db/__init__.py", line 166, in db_ensure_indexes
    raise e
pymongo.errors.OperationFailure: not authorized on st2 to execute command { createIndexes: "user_d_b", indexes: [ { unique: true, background: false, sparse: false, key: { name: 1 }, name: "name_1" } ], writeConcern: {} }
[root@nickdevstd01 ~]# st2 whoami
Currently logged in as "st2admin".

Authentication method: authentication token
Authentication token expire time: 2018-05-03T18:24:44Z

RBAC:
 - Enabled: False
 - Roles:

It looks like the auth credentials are to being picked up by that command

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions