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

Fix TypeError: 'NoneType' object is not iterable #2103

Merged
merged 2 commits into from
Jan 10, 2024
Merged

Fix TypeError: 'NoneType' object is not iterable #2103

merged 2 commits into from
Jan 10, 2024

Conversation

sbrunner
Copy link
Member

@sbrunner sbrunner commented Jan 10, 2024

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>

and


06:02:03.509568 W c2cwsgiutils.redis_utils Redis connection problem
Traceback (most recent call last):

  File "/usr/local/lib/python3.10/dist-packages/c2cwsgiutils/redis_utils.py", line 115, in run
    pubsub.get_message(ignore_subscribe_messages=True, timeout=1)

  File "/usr/local/lib/python3.10/dist-packages/redis/client.py", line 1013, in get_message
    response = self.parse_response(block=(timeout is None), timeout=timeout)

  File "/usr/local/lib/python3.10/dist-packages/redis/client.py", line 824, in parse_response
    response = self._execute(conn, try_read)

  File "/usr/local/lib/python3.10/dist-packages/redis/client.py", line 800, in _execute
    return conn.retry.call_with_retry(

  File "/usr/local/lib/python3.10/dist-packages/redis/retry.py", line 49, in call_with_retry
    fail(error)

  File "/usr/local/lib/python3.10/dist-packages/redis/client.py", line 802, in <lambda>
    lambda error: self._disconnect_raise_connect(conn, error),

  File "/usr/local/lib/python3.10/dist-packages/redis/client.py", line 789, in _disconnect_raise_connect
    raise error

  File "/usr/local/lib/python3.10/dist-packages/redis/retry.py", line 46, in call_with_retry
    return do()

  File "/usr/local/lib/python3.10/dist-packages/redis/client.py", line 801, in <lambda>
    lambda: command(*args, **kwargs),

  File "/usr/local/lib/python3.10/dist-packages/redis/client.py", line 818, in try_read
    if not conn.can_read(timeout=timeout):

  File "/usr/local/lib/python3.10/dist-packages/redis/connection.py", line 478, in can_read
    return self._parser.can_read(timeout)

  File "/usr/local/lib/python3.10/dist-packages/redis/_parsers/base.py", line 128, in can_read
    return self._buffer and self._buffer.can_read(timeout)

  File "/usr/local/lib/python3.10/dist-packages/redis/_parsers/socket.py", line 95, in can_read
    return bool(self.unread_bytes()) or self._read_from_socket(

  File "/usr/local/lib/python3.10/dist-packages/redis/_parsers/socket.py", line 68, in _read_from_socket
    raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)

redis.exceptions.ConnectionError: Connection closed by server.

06:02:04.042653 I c2cwsgiutils.redis_utils Redis is back

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 sbrunner added the backport master Backport the pull request to the 'master' branch label Jan 10, 2024
@sbrunner sbrunner marked this pull request as ready for review January 10, 2024 11:54
@sbrunner sbrunner merged commit 1261a92 into 6.0 Jan 10, 2024
2 checks passed
@sbrunner sbrunner deleted the fix-none branch January 10, 2024 11:54
@c2c-bot-gis-ci c2c-bot-gis-ci removed the backport master Backport the pull request to the 'master' branch label Jan 10, 2024
@geo-ghci-int geo-ghci-int bot added this to the 6.0.8 milestone Apr 11, 2024
@sbrunner sbrunner added bug Something isn't working and removed bug Something isn't working labels Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants