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

[Backport master] Fix TypeError: 'NoneType' object is not iterable #2104

Merged
merged 2 commits into from
Jan 10, 2024

Commits on Jan 10, 2024

  1. Fix TypeError: 'NoneType' object is not iterable

    Traceback (most recent call last):
      File "/usr/lib/python3.10/wsgiref/handlers.py", line 137, in run
        self.result = application(self.environ, self.start_response)
      File "/usr/local/lib/python3.10/dist-packages/prometheus_client/exposition.py", line 129, in prometheus_app
        status, headers, output = _bake_output(registry, accept_header, accept_encoding_header, params, disable_compression)
      File "/usr/local/lib/python3.10/dist-packages/prometheus_client/exposition.py", line 105, in _bake_output
        output = encoder(registry)
      File "/usr/local/lib/python3.10/dist-packages/prometheus_client/openmetrics/exposition.py", line 21, in generate_latest
        for metric in registry.collect():
      File "/usr/local/lib/python3.10/dist-packages/prometheus_client/registry.py", line 97, in collect
        yield from collector.collect()
      File "/usr/local/lib/python3.10/dist-packages/c2cwsgiutils/prometheus.py", line 135, in _deserialize_collected_data
        for serialized_metric in serialized_collection:
    TypeError: 'NoneType' object is not iterable
    ----------------------------------------
    Exception occurred during processing of request from ('10.10.38.202', 55654)
    Traceback (most recent call last):
      File "/usr/lib/python3.10/wsgiref/handlers.py", line 137, in run
        self.result = application(self.environ, self.start_response)
      File "/usr/local/lib/python3.10/dist-packages/prometheus_client/exposition.py", line 129, in prometheus_app
        status, headers, output = _bake_output(registry, accept_header, accept_encoding_header, params, disable_compression)
      File "/usr/local/lib/python3.10/dist-packages/prometheus_client/exposition.py", line 105, in _bake_output
        output = encoder(registry)
      File "/usr/local/lib/python3.10/dist-packages/prometheus_client/openmetrics/exposition.py", line 21, in generate_latest
        for metric in registry.collect():
      File "/usr/local/lib/python3.10/dist-packages/prometheus_client/registry.py", line 97, in collect
        yield from collector.collect()
      File "/usr/local/lib/python3.10/dist-packages/c2cwsgiutils/prometheus.py", line 135, in _deserialize_collected_data
        for serialized_metric in serialized_collection:
    TypeError: 'NoneType' object is not iterable
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/lib/python3.10/socketserver.py", line 683, in process_request_thread
        self.finish_request(request, client_address)
      File "/usr/lib/python3.10/socketserver.py", line 360, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "/usr/lib/python3.10/socketserver.py", line 747, in __init__
        self.handle()
      File "/usr/lib/python3.10/wsgiref/simple_server.py", line 134, in handle
        handler.run(self.server.get_app())
      File "/usr/lib/python3.10/wsgiref/handlers.py", line 145, in run
        self.handle_error()
      File "/usr/lib/python3.10/wsgiref/handlers.py", line 382, in handle_error
        self.finish_response()
      File "/usr/lib/python3.10/wsgiref/handlers.py", line 184, in finish_response
        self.write(data)
      File "/usr/lib/python3.10/wsgiref/handlers.py", line 288, in write
        self.send_headers()
      File "/usr/lib/python3.10/wsgiref/handlers.py", line 346, in send_headers
        self.send_preamble()
      File "/usr/lib/python3.10/wsgiref/handlers.py", line 268, in send_preamble
        self._write(
      File "/usr/lib/python3.10/wsgiref/handlers.py", line 467, in _write
        result = self.stdout.write(data)
      File "/usr/lib/python3.10/socketserver.py", line 826, in write
        self._sock.sendall(b)
    BrokenPipeError: [Errno 32] Broken pipe
    ----------------------------------------
    HTTP/1.1 10.10.37.248:8080 GET /config/c2c/health_check? "-" "kube-probe/1.27" 200 30 2295 <9>
    HTTP/1.1 10.10.37.248:8080 GET /config/c2c/health_check? "-" "kube-probe/1.27" 200 30 2461 <9>
    sbrunner committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    994e458 View commit details
    Browse the repository at this point in the history
  2. Remove too many stack trace

    sbrunner committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    86ed537 View commit details
    Browse the repository at this point in the history