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

Maintaining downtime on Icinga2 fragile #106

Open
stdevel opened this issue Oct 3, 2018 · 1 comment
Open

Maintaining downtime on Icinga2 fragile #106

stdevel opened this issue Oct 3, 2018 · 1 comment
Assignees
Labels
bug confirmed Confirmed behaviour
Milestone

Comments

@stdevel
Copy link
Owner

stdevel commented Oct 3, 2018

Describe the bug
Scheduling downtimes on Icinga2 works, but katprep crashes with an BadStatusLine error.

To Reproduce
Steps to reproduce the behavior:

  1. Schedule downtime, e.g.: katprep_maintenance *.json prepare
  2. See error

Expected behavior
Downtime should be scheduled without crashing katprep.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS version: CentOS 7.5
  • Red Hat Satellite or Foreman/Katello version: 1.19.0/3.8.0
  • Icinga2 version: 2.8.4-1

Additional context
Could also be an upstream issue: Icinga/icinga2#6635

Stacktrace:

$ katprep_maintenance -C katprep.auth 
  File "/usr/local/bin/katprep_maintenance", line 11, in <module>
    load_entry_point('katprep==0.5.0', 'console_scripts', 'katprep_maintenance')()
  File "build/bdist.linux-x86_64/egg/katprep/maintenance.py", line 884, in cli
  File "build/bdist.linux-x86_64/egg/katprep/maintenance.py", line 863, in main
  File "build/bdist.linux-x86_64/egg/katprep/maintenance.py", line 251, in prepare
  File "build/bdist.linux-x86_64/egg/katprep/maintenance.py", line 196, in manage_host_preparation
  File "build/bdist.linux-x86_64/egg/katprep/clients/Icinga2APIClient.py", line 278, in schedule_downtime
  File "build/bdist.linux-x86_64/egg/katprep/clients/Icinga2APIClient.py", line 248, in __manage_downtime
  File "build/bdist.linux-x86_64/egg/katprep/clients/Icinga2APIClient.py", line 160, in __api_post
  File "build/bdist.linux-x86_64/egg/katprep/clients/Icinga2APIClient.py", line 118, in __api_request
  File "/home/vagrant/.local/lib/python2.7/site-packages/requests/sessions.py", line 559, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/home/vagrant/.local/lib/python2.7/site-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/vagrant/.local/lib/python2.7/site-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/home/vagrant/.local/lib/python2.7/site-packages/requests/adapters.py", line 495, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))
@stdevel stdevel added bug confirmed Confirmed behaviour labels Oct 3, 2018
@stdevel stdevel added this to the 0.5.x milestone Oct 3, 2018
@stdevel stdevel self-assigned this Oct 3, 2018
@stdevel
Copy link
Owner Author

stdevel commented Oct 17, 2018

Received the hint, that the API is not designed for serving multiple requests in one session. So the workaround would be to close the API session after every request and re-establish it afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed Confirmed behaviour
Projects
None yet
Development

No branches or pull requests

1 participant