Project

General

Profile

Bug #25260

Glideinmon: validate configuration before starting up

Added by Marco Mascheroni 5 months ago. Updated 11 days ago.

Status:
New
Priority:
Normal
Category:
-
Target version:
Start date:
11/27/2020
Due date:
% Done:

0%

Estimated time:
First Occurred:
Occurs In:
Stakeholders:
Duration:

Description

I got this error because the configuration file was missing the DisplayType option. This was not in the sample config file, and no default value is used. We should probably validate the configuration before starting the service, and give a proper error in case anything is missing.

188.185.91.237 - - [27/Nov/2020 09:51:53] "^[[33mGET /api/api/job_download/db_id/2632 HTTP/1.1^[[0m" 404 -
[2020-11-27 09:52:20,537] ERROR in app: Exception on /api/job_download/db_id/2632 [GET]
Traceback (most recent call last):
  File "/usr/local/lib64/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib64/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib64/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib64/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib64/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib64/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib64/python3.6/site-packages/flask_httpauth.py", line 164, in decorated
    return f(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/glideinmonitor/webserver/webserver.py", line 90, in flask_api_job_download_db
    return send_file(api_job_file(job_id, False), as_attachment=True)
  File "/usr/lib/python3.6/site-packages/glideinmonitor/webserver/rest_api.py", line 10, in api_job_file
    file_type = Config.get('DisplayType')
  File "/usr/lib/python3.6/site-packages/glideinmonitor/lib/config.py", line 85, in get
    return cls.config_data[key]
KeyError: 'DisplayType'

History

#1 Updated by Marco Mascheroni 5 months ago

  • Target version changed from v3_7_2 to v3_7_3

#2 Updated by Marco Mascheroni 11 days ago

  • Target version changed from v3_7_3 to v3_7_4

Also available in: Atom PDF