添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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

Hello team,

Checking one of the environments of a cloud client, we found this error in the API logs of its master manager. After restarting the manager everything worked correctly again.

2021/05/18 06:35:21 ERROR: Error handling request
Traceback (most recent call last):
  File "/var/ossec/framework/python/lib/python3.9/site-packages/connexion/apis/aiohttp_api.py", line 50, in problems_middleware
    response = yield from handler(request)
  File "/var/ossec/framework/python/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 110, in impl
    return await handler(request)
  File "/var/ossec/framework/python/lib/python3.9/site-packages/api-4.1.5-py3.9.egg/api/middlewares.py", line 139, in response_postprocessing
    return await handler(request)
  File "/var/ossec/framework/python/lib/python3.9/site-packages/api-4.1.5-py3.9.egg/api/middlewares.py", line 31, in set_user_name
    return await handler(request)
  File "/var/ossec/framework/python/lib/python3.9/site-packages/api-4.1.5-py3.9.egg/api/middlewares.py", line 114, in security_middleware
    return await handler(request)
  File "/var/ossec/framework/python/lib/python3.9/site-packages/api-4.1.5-py3.9.egg/api/middlewares.py", line 87, in request_logging
    return await handler(request)
  File "/var/ossec/framework/python/lib/python3.9/site-packages/api-4.1.5-py3.9.egg/api/middlewares.py", line 36, in set_secure_headers
    resp = await handler(request)
  File "/var/ossec/framework/python/lib/python3.9/site-packages/aiohttp_cache/middleware.py", line 59, in cache_middleware
    return await handler(request)
  File "/var/ossec/framework/python/lib/python3.9/site-packages/connexion/decorators/coroutine_wrappers.py", line 23, in wrapper
    connexion_response = yield from connexion_response
  File "/var/ossec/framework/python/lib/python3.9/site-packages/api-4.1.5-py3.9.egg/api/controllers/cluster_controller.py", line 75, in get_cluster_nodes
    nodes = raise_if_exc(await get_system_nodes())
  File "/var/ossec/framework/python/lib/python3.9/site-packages/wazuh-4.1.5-py3.9.egg/wazuh/core/cluster/control.py", line 180, in get_system_nodes
    result = await get_nodes(lc)
  File "/var/ossec/framework/python/lib/python3.9/site-packages/wazuh-4.1.5-py3.9.egg/wazuh/core/cluster/control.py", line 52, in get_nodes
    result = json.loads(await lc.execute(command=b'get_nodes',
  File "/var/ossec/framework/python/lib/python3.9/json/__init__.py", line 359, in loads
    return cls(**kw).decode(s)
  File "/var/ossec/framework/python/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/var/ossec/framework/python/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Checks

wazuh/wazuh

  • Unit tests without failures. Updated and/or expanded if there are new functions/methods/outputs:
  • Cluster ( framework/wazuh/core/cluster/tests/ & framework/wazuh/core/cluster/dapi/tests/ )
  • Core ( framework/wazuh/core/tests/ )
  • SDK ( framework/wazuh/tests/ )
  • RBAC ( framework/wazuh/rbac/tests/ )
  • API ( api/api/tests/ )
  • API tavern integration tests without failures. Updated and/or expanded if needed ( api/test/integration/ ):
  • Affected tests
  • Affected RBAC (black and white) tests
  • Review integration test mapping using the script ( api/test/integration/mapping/integration_test_api_endpoints.json )
  • Review of spec.yaml examples and schemas ( api/api/spec/spec.yaml )
  • Review exceptions remediation when any endpoint path changes or is removed ( framework/wazuh/core/exception.py )
  • Changelog ( CHANGELOG.md )
  • wazuh/wazuh-documentation

  • Migration from 3.X for changed endpoints ( source/user-manual/api/equivalence.rst )
  • Update RBAC reference with new/modified actions/resources/relationships ( source/user-manual/api/rbac/reference.rst )
  • >>> import json
    >>> json.loads(b'Error sending request: timeout expired.')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib64/python3.9/json/__init__.py", line 346, in loads
        return _default_decoder.decode(s)
      File "/usr/lib64/python3.9/json/decoder.py", line 337, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/usr/lib64/python3.9/json/decoder.py", line 355, in raw_decode
        raise JSONDecodeError("Expecting value", s, err.value) from None
    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    

    Regards,
    Víctor Fernández

    API Error: json.loads cannot decode bytesarray API Error: json.loads does not receive a valid JSON Jun 1, 2021