zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.11k stars 949 forks source link

UI can't list any of the clusters #2674

Open droslean opened 1 week ago

droslean commented 1 week ago
127.0.0.1 - - [2024-06-26 14:10:39] "GET /postgresqls HTTP/1.1" 200 109 0.008343
{"asctime": "2024-06-26 14:10:42,131", "levelname": "ERROR", "message": "Exception on /stored_clusters [GET]", "exc_info": "Traceback (most recent call last):
  File \"/usr/local/lib/python3.11/site-packages/flask/app.py\", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/usr/local/lib/python3.11/site-packages/flask/app.py\", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/usr/local/lib/python3.11/site-packages/flask/app.py\", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File \"/usr/local/lib/python3.11/site-packages/flask/app.py\", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/app/operator_ui/main.py\", line 767, in get_stored_clusters
    read_stored_clusters(
      File \"/app/operator_ui/spiloutils.py\", line 274, in read_stored_clusters
    client('s3', endpoint_url=AWS_ENDPOINT).list_objects(
      File \"/usr/local/lib/python3.11/site-packages/botocore/client.py\", line 565, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/usr/local/lib/python3.11/site-packages/botocore/client.py\", line 958, in _make_api_call
    api_params = self._emit_api_params(
                     ^^^^^^^^^^^^^^^^^^^^^^
  File \"/usr/local/lib/python3.11/site-packages/botocore/client.py\", line 1084, in _emit_api_params
    self.meta.events.emit(
      File \"/usr/local/lib/python3.11/site-packages/botocore/hooks.py\", line 412, in emit
    return self._emitter.emit(aliased_event_name, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/usr/local/lib/python3.11/site-packages/botocore/hooks.py\", line 256, in emit
    return self._emit(event_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/usr/local/lib/python3.11/site-packages/botocore/hooks.py\", line 239, in _emit
    response = handler(**kwargs)
               ^^^^^^^^^^^^^^^^^
  File \"/usr/local/lib/python3.11/site-packages/botocore/handlers.py\", line 282, in validate_bucket_name
    if not VALID_BUCKET.search(bucket) and not VALID_S3_ARN.search(bucket):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'NoneType'"}
127.0.0.1 - - [2024-06-26 14:10:42] "GET /stored_clusters HTTP/1.1" 500 401 0.034071

image

FxKu commented 1 week ago

You've selected the Backups tab in UI. If you have neither configured a backup location nor set the required environment variable for UI deployment these errors are expected.

droslean commented 1 week ago

well, the clusters are completely missing. It's not the specific backups tab. The UI can't find any of the clusters that haven't been created by the UI.

droslean commented 1 week ago

To replicate this, just create a cluster manually and you will see that the UI won't be able to find it. If you create a cluster through the UI, the cluster will be listed as normal. This is 100% a BUG in the UI.