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

Getting Error with robot framework listener -Calling method 'log_message' of listener 'robotframework_reportportal.listener' failed: TypeError: Object of type _PresenceSentinel is not JSON serializable #189

Open
Akaaav opened this issue May 24, 2024 · 2 comments
Labels

Comments

@Akaaav
Copy link

Akaaav commented May 24, 2024

Error information
TypeError: Object of type _PresenceSentinel is not JSON serializable

[ ERROR ] Calling method 'log_message' of listener 'robotframework_reportportal.listener' failed: TypeError: Object of type _PresenceSentinel is not JSON serializable

Errorstack :

Traceback (most recent call last):
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\reportportal_client\core\rp_requests.py", line
128, in make
return RPResponse(self.session_method(self.url, data=self.data, json=self.json, files=self.files,

File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 637, in post
return self.request("POST", url, data=data, json=json, **kwargs)

File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 575, in request
prep = self.prepare_request(req)

File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 486, in prepare_request
p.prepare(
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\models.py", line 371, in prepare
self.prepare_body(data, files, json)
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\models.py", line 511, in prepare_body
body = complexjson.dumps(json, allow_nan=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\json_init_.py", line 238, in dumps
**kw).encode(obj)
^^^^^^^^^^^
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\json\encoder.py", line 200, in encode
chunks = self.iterencode(o, _one_shot=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\json\encoder.py", line 258, in iterencode
return _iterencode(o, 0)
^^^^^^^^^^^^^^^^^
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\json\encoder.py", line 180, in default
raise TypeError(f'Object of type {o.class.name} '

TypeError: Object of type _PresenceSentinel is not JSON serializable

[ ERROR ] Calling method 'log_message' of listener 'robotframework_reportportal.listener' failed: TypeError: Object of type _PresenceSentinel is not JSON serializable
[ WARN ] ReportPortal None request failed

Command passed:
py run.py -i tag -v SUT_HOST_IP:x.x.x.x -L TRACE --listener robotframework_reportportal.listener -v RP_ENDPOINT:"https://hostname" -v RP_API_KEY:"key" -v RP_LAUNCH:"Testing" -v RP_PROJECT:"Test"

Version used:

Python : 3.12.0
Robot framework: 7.0
robotframework-reportportal : 5.5.3
reportportal-client: 5.5.6

@Akaaav Akaaav added the bug label May 24, 2024
@HardNorth
Copy link
Member

@Akaaav Usually this means the Agent received not a JSON in response. Most likely it's incorrect configuration, or ReportPortal server issue.

@Akaaav
Copy link
Author

Akaaav commented May 27, 2024

I have report portal-UI of version 5.11.0 version and I can manually access portal and it is in a working state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants