postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

[UI] Backups tab: Error loading stored clusters. Please try again or start over.

Open bergkvist opened this issue 5 years ago • 26 comments

When opening the "Backup tab" in the operator ui, I get a message "Error loading stored clusters. Please try again or start over." Retrying doesn't help.

The UI makes a request to http://localhost:8081/stored_clusters, which returns 500 Internal Server Error.

Output from kubectl logs deployment/postgres-operator-ui:

--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/operator_ui/main.py", line 190, in wrapper
    return f(*args, **kwargs)
  File "/operator_ui/main.py", line 741, in get_stored_clusters
    prefix=SPILO_S3_BACKUP_PREFIX,
  File "/operator_ui/spiloutils.py", line 252, in read_stored_clusters
    Prefix=prefix,
  File "/usr/lib/python3.6/site-packages/botocore/client.py", line 276, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/lib/python3.6/site-packages/botocore/client.py", line 559, in _make_api_call
    api_params, operation_model, context=request_context)
  File "/usr/lib/python3.6/site-packages/botocore/client.py", line 605, in _convert_to_request_dict
    api_params, operation_model, context)
  File "/usr/lib/python3.6/site-packages/botocore/client.py", line 637, in _emit_api_params
    params=api_params, model=operation_model, context=context)
  File "/usr/lib/python3.6/site-packages/botocore/hooks.py", line 356, in emit
    return self._emitter.emit(aliased_event_name, **kwargs)
  File "/usr/lib/python3.6/site-packages/botocore/hooks.py", line 228, in emit
    return self._emit(event_name, kwargs)
  File "/usr/lib/python3.6/site-packages/botocore/hooks.py", line 211, in _emit
    response = handler(**kwargs)
  File "/usr/lib/python3.6/site-packages/botocore/handlers.py", line 223, in validate_bucket_name
    if not VALID_BUCKET.search(bucket) and not VALID_S3_ARN.search(bucket):
TypeError: expected string or bytes-like object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/logging/handlers.py", line 936, in emit
    self.socket.send(msg)
  File "/usr/lib/python3.6/site-packages/gevent/_socket3.py", line 390, in send
    return _socket.socket.send(self._sock, data, flags)
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/logging/handlers.py", line 857, in _connect_unixsocket
    self.socket.connect(address)
  File "/usr/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
    raise error(result, strerror(result))
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/logging/handlers.py", line 939, in emit
    self._connect_unixsocket(self.address)
  File "/usr/lib/python3.6/logging/handlers.py", line 868, in _connect_unixsocket
    self.socket.connect(address)
  File "/usr/lib/python3.6/site-packages/gevent/_socket3.py", line 307, in connect
    raise error(result, strerror(result))
FileNotFoundError: [Errno 2] No such file or directory
Call stack:
  File "/usr/lib/python3.6/site-packages/gevent/greenlet.py", line 536, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/gevent/baseserver.py", line 26, in _handle_and_close_when_done
    return handle(*args_tuple)
  File "/usr/lib/python3.6/site-packages/gevent/pywsgi.py", line 1482, in handle
    handler.handle()
  File "/usr/lib/python3.6/site-packages/gevent/pywsgi.py", line 454, in handle
    result = self.handle_one_request()
  File "/usr/lib/python3.6/site-packages/gevent/pywsgi.py", line 671, in handle_one_request
    self.handle_one_response()
  File "/usr/lib/python3.6/site-packages/gevent/pywsgi.py", line 935, in handle_one_response
    self.run_application()
  File "/usr/lib/python3.6/site-packages/gevent/pywsgi.py", line 908, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 2463, in __call__
    return self.wsgi_app(environ, start_response)
  File "/operator_ui/main.py", line 160, in __call__
    return self.app(environ, start_response)
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 2449, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1870, in handle_exception
    self.log_exception((exc_type, exc_value, tb))
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1891, in log_exception
    "Exception on %s [%s]" % (request.path, request.method), exc_info=exc_info
Message: 'Exception on /stored_clusters [GET]'
Arguments: ()
127.0.0.1 - - [2020-04-27 16:55:29] "GET /stored_clusters HTTP/1.1" 500 411 2.097737
10.1.6.1 - - [2020-04-27 16:55:32] "GET /health HTTP/1.1" 200 117 0.001161
10.1.6.1 - - [2020-04-27 16:55:42] "GET /health HTTP/1.1" 200 117 0.002137
10.1.6.1 - - [2020-04-27 16:55:52] "GET /health HTTP/1.1" 200 117 0.001463
10.1.6.1 - - [2020-04-27 16:56:02] "GET /health HTTP/1.1" 200 117 0.000974
10.1.6.1 - - [2020-04-27 16:56:12] "GET /health HTTP/1.1" 200 117 0.001322
10.1.6.1 - - [2020-04-27 16:56:22] "GET /health HTTP/1.1" 200 117 0.001323
10.1.6.1 - - [2020-04-27 16:56:32] "GET /health HTTP/1.1" 200 117 0.001397
10.1.6.1 - - [2020-04-27 16:56:42] "GET /health HTTP/1.1" 200 117 0.001307
10.1.6.1 - - [2020-04-27 16:56:52] "GET /health HTTP/1.1" 200 117 0.001155
10.1.6.1 - - [2020-04-27 16:57:02] "GET /health HTTP/1.1" 200 117 0.001214
10.1.6.1 - - [2020-04-27 16:57:12] "GET /health HTTP/1.1" 200 117 0.002490
10.1.6.1 - - [2020-04-27 16:57:22] "GET /health HTTP/1.1" 200 117 0.001992
10.1.6.1 - - [2020-04-27 16:57:32] "GET /health HTTP/1.1" 200 117 0.001392
10.1.6.1 - - [2020-04-27 16:57:42] "GET /health HTTP/1.1" 200 117 0.002429
10.1.6.1 - - [2020-04-27 16:57:52] "GET /health HTTP/1.1" 200 117 0.001851
10.1.6.1 - - [2020-04-27 16:58:02] "GET /health HTTP/1.1" 200 117 0.003601
10.1.6.1 - - [2020-04-27 16:58:12] "GET /health HTTP/1.1" 200 117 0.001118
10.1.6.1 - - [2020-04-27 16:58:22] "GET /health HTTP/1.1" 200 117 0.001185
10.1.6.1 - - [2020-04-27 16:58:32] "GET /health HTTP/1.1" 200 117 0.001606
10.1.6.1 - - [2020-04-27 16:58:42] "GET /health HTTP/1.1" 200 117 0.001739
operator_ui.main ERROR    Exception on /stored_clusters [GET]
        Traceback (most recent call last):
          File "/usr/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
            response = self.full_dispatch_request()
          File "/usr/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
            rv = self.handle_user_exception(e)
          File "/usr/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
            reraise(exc_type, exc_value, tb)
          File "/usr/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
            raise value
          File "/usr/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
            rv = self.dispatch_request()
          File "/usr/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
            return self.view_functions[rule.endpoint](**req.view_args)
          File "/operator_ui/main.py", line 190, in wrapper
            return f(*args, **kwargs)
          File "/operator_ui/main.py", line 741, in get_stored_clusters
            prefix=SPILO_S3_BACKUP_PREFIX,
          File "/operator_ui/spiloutils.py", line 252, in read_stored_clusters
            Prefix=prefix,
          File "/usr/lib/python3.6/site-packages/botocore/client.py", line 276, in _api_call
            return self._make_api_call(operation_name, kwargs)
          File "/usr/lib/python3.6/site-packages/botocore/client.py", line 559, in _make_api_call
            api_params, operation_model, context=request_context)
          File "/usr/lib/python3.6/site-packages/botocore/client.py", line 605, in _convert_to_request_dict
            api_params, operation_model, context)
          File "/usr/lib/python3.6/site-packages/botocore/client.py", line 637, in _emit_api_params
            params=api_params, model=operation_model, context=context)
          File "/usr/lib/python3.6/site-packages/botocore/hooks.py", line 356, in emit
            return self._emitter.emit(aliased_event_name, **kwargs)
          File "/usr/lib/python3.6/site-packages/botocore/hooks.py", line 228, in emit
            return self._emit(event_name, kwargs)
          File "/usr/lib/python3.6/site-packages/botocore/hooks.py", line 211, in _emit
            response = handler(**kwargs)
          File "/usr/lib/python3.6/site-packages/botocore/handlers.py", line 223, in validate_bucket_name
            if not VALID_BUCKET.search(bucket) and not VALID_S3_ARN.search(bucket):
        TypeError: expected string or bytes-like object

My environment:

# How I created the postgres-operator
kubectl apply -f manifests/configman.yaml
kubectl apply -f manifests/api-service.yaml
kubectl apply -f manifests/operator-service-account-rbac.yaml
kubectl apply -f manifests/postgres-operator.yaml

# How I created the UI:
kubectl apply -f ui/manifests

Everything except backups seem to work.

bergkvist avatar Apr 27 '20 17:04 bergkvist