certat/intelmq-webinput-csv

Show submission errors

Opened this issue · 0 comments

Return error to frontend (currently displays the 500's HTML page in an alert box) and write to stderr for the logs.

Example to reproduce: Set a redis password, but do not configure it.

[2019-01-07 16:09:53,903] ERROR in app: Exception on /submit [POST]
Traceback (most recent call last):
  File ".../intelmq/intelmq/lib/pipeline.py", line 136, in send
    self.pipe.lpush(destination_queue, message)
  File "/usr/lib/python3/dist-packages/redis/client.py", line 1154, in lpush
    return self.execute_command('LPUSH', name, *values)
  File "/usr/lib/python3/dist-packages/redis/client.py", line 528, in execute_command
    connection.send_command(*args)
  File "/usr/lib/python3/dist-packages/redis/connection.py", line 532, in send_command
    self.send_packed_command(self.pack_command(*args))
  File "/usr/lib/python3/dist-packages/redis/connection.py", line 508, in send_packed_command
    self.connect()
  File "/usr/lib/python3/dist-packages/redis/connection.py", line 416, in connect
    self.on_connect()
  File "/usr/lib/python3/dist-packages/redis/connection.py", line 490, in on_connect
    if nativestr(self.read_response()) != 'OK':
  File "/usr/lib/python3/dist-packages/redis/connection.py", line 550, in read_response
    raise response
redis.exceptions.ResponseError: NOAUTH Authentication required.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sebastianw/venv/lib/python3.4/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/sebastianw/venv/lib/python3.4/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/sebastianw/venv/lib/python3.4/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/sebastianw/venv/lib/python3.4/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/home/sebastianw/venv/lib/python3.4/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/sebastianw/venv/lib/python3.4/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/eventdbui/intelmq-webinput-csv/intelmq_webinput_csv/bin/backend.py", line 413, in submit
    destination_pipeline.send(raw_message)
  File "/home/aaron/intelmq/intelmq/lib/pipeline.py", line 143, in send
    raise exceptions.PipelineError(exc)
intelmq.lib.exceptions.PipelineError: pipeline failed - ResponseError('NOAUTH Authentication required.',)