Skip to content
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

[Bug]: Creation of Logstash Roles fails in some situations #335

Open
1 task done
widhalmt opened this issue Aug 8, 2024 · 1 comment
Open
1 task done

[Bug]: Creation of Logstash Roles fails in some situations #335

widhalmt opened this issue Aug 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@widhalmt
Copy link
Member

widhalmt commented Aug 8, 2024

Please try to fill out as much of the information below as you can. Thank you!

  • Yes, I've searched similar issues on GitHub and didn't find any.

Which version contains the bug?

No response

Describe the bug

I've used this collection in several setups and didn't have a problem with this so far. This time I came back to a system I set up several months ago. So I assume the problem was introduced with one of the last changes. I guess the roles and users were set up using the old "template" method and the current "module" method has a problem with them, now. I had to remove the tasks for logstash user and role to proceed. I didn't have the time to debug on the customers setup but I will be able to collect more information as needed.

TASK [netways.elasticstack.logstash : Create logstash role logstash_writer] *****************************************************************************************************************************************************************
fatal: [elastic01.xxx.at]: FAILED! => {"changed": false, "module_stderr": "Shared connection to elastic01.xxx.at closed.
", "module_stdout": "
/usr/lib/python3/dist-packages/elasticsearch/connection/http_urllib3.py:158: UserWarning: When using `ssl_context`, all other SSL related kwargs are ignored
  warnings.warn(
/tmp/ansible_netways.elasticstack.elasticsearch_role_payload_nz82s9i1/ansible_netways.elasticstack.elasticsearch_role_payload.zip/ansible_collections/netways/elasticstack/plugins/module_utils/elasticsearch_role.py:74: ElasticsearchWarning: The client is unable to verify that the server is Elasticsearch due security privileges on the server side
Traceback (most recent call last):
  File \"/home/elasticadmin/.ansible/tmp/ansible-tmp-1723016852.3606312-1319575-207084496982344/AnsiballZ_elasticsearch_role.py\", line 107, in <module>
    _ansiballz_main()
  File \"/home/elasticadmin/.ansible/tmp/ansible-tmp-1723016852.3606312-1319575-207084496982344/AnsiballZ_elasticsearch_role.py\", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File \"/home/elasticadmin/.ansible/tmp/ansible-tmp-1723016852.3606312-1319575-207084496982344/AnsiballZ_elasticsearch_role.py\", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.netways.elasticstack.plugins.modules.elasticsearch_role', init_globals=dict(_module_fqn='ansible_collections.netways.elasticstack.plugins.modules.elasticsearch_role', _modlib_path=modlib_path),
  File \"<frozen runpy>\", line 226, in run_module
  File \"<frozen runpy>\", line 98, in _run_module_code
  File \"<frozen runpy>\", line 88, in _run_code
  File \"/tmp/ansible_netways.elasticstack.elasticsearch_role_payload_nz82s9i1/ansible_netways.elasticstack.elasticsearch_role_payload.zip/ansible_collections/netways/elasticstack/plugins/modules/elasticsearch_role.py\", line 94, in <module>
  File \"/tmp/ansible_netways.elasticstack.elasticsearch_role_payload_nz82s9i1/ansible_netways.elasticstack.elasticsearch_role_payload.zip/ansible_collections/netways/elasticstack/plugins/modules/elasticsearch_role.py\", line 75, in run_module
  File \"/tmp/ansible_netways.elasticstack.elasticsearch_role_payload_nz82s9i1/ansible_netways.elasticstack.elasticsearch_role_payload.zip/ansible_collections/netways/elasticstack/plugins/module_utils/elasticsearch_role.py\", line 21, in __init__
  File \"/tmp/ansible_netways.elasticstack.elasticsearch_role_payload_nz82s9i1/ansible_netways.elasticstack.elasticsearch_role_payload.zip/ansible_collections/netways/elasticstack/plugins/module_utils/elasticsearch_role.py\", line 33, in handle
  File \"/tmp/ansible_netways.elasticstack.elasticsearch_role_payload_nz82s9i1/ansible_netways.elasticstack.elasticsearch_role_payload.zip/ansible_collections/netways/elasticstack/plugins/module_utils/elasticsearch_role.py\", line 51, in handle_present
  File \"/tmp/ansible_netways.elasticstack.elasticsearch_role_payload_nz82s9i1/ansible_netways.elasticstack.elasticsearch_role_payload.zip/ansible_collections/netways/elasticstack/plugins/module_utils/elasticsearch_role.py\", line 74, in get_all
  File \"/usr/lib/python3/dist-packages/elasticsearch/client/utils.py\", line 347, in _wrapped
    return func(*args, params=params, headers=headers, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/usr/lib/python3/dist-packages/elasticsearch/client/security.py\", line 351, in get_role
    return self.transport.perform_request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/usr/lib/python3/dist-packages/elasticsearch/transport.py\", line 466, in perform_request
    raise e
  File \"/usr/lib/python3/dist-packages/elasticsearch/transport.py\", line 427, in perform_request
    status, headers_response, data = connection.perform_request(\r\n                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/usr/lib/python3/dist-packages/elasticsearch/connection/http_urllib3.py\", line 291, in perform_request
    self._raise_error(response.status, raw_data)
  File \"/usr/lib/python3/dist-packages/elasticsearch/connection/base.py\", line 328, in _raise_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(
elasticsearch.exceptions.AuthenticationException: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/_security/role]')
", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

How to recreate the bug?

Did not find a way to reproduce it outside this environment so far.

@widhalmt widhalmt added bug Something isn't working needs-triage Needs to be triaged labels Aug 8, 2024
@widhalmt
Copy link
Member Author

widhalmt commented Aug 8, 2024

/ref/NC/807593

@martialblog martialblog removed the needs-triage Needs to be triaged label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants