Closed RyanTsang closed 2 months ago
error trace
jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | Traceback (most recent call last): jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/celery/app/trace.py", line 405, in trace_task jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | R = retval = fun(*args, **kwargs) jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/celery/app/trace.py", line 697, in __protected_call__ jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | return self.run(*args, **kwargs) jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/jasmin/protocols/rest/tasks.py", line 105, in httpapi_send jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | batch_callback.delay( jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/celery/app/task.py", line 421, in delay jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | return self.apply_async(args, kwargs) jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/celery/app/task.py", line 561, in apply_async jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | return app.send_task( jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/celery/app/base.py", line 749, in send_task jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | amqp.send_task_message(P, name, message, **options) jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/celery/app/amqp.py", line 523, in send_task_message jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | ret = producer.publish( jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/kombu/messaging.py", line 164, in publish jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | body, content_type, content_encoding = self._prepare( jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/kombu/messaging.py", line 249, in _prepare jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | body) = dumps(body, serializer=serializer) jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/kombu/serialization.py", line 220, in dumps jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | payload = encoder(data) jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/contextlib.py", line 135, in __exit__ jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | self.gen.throw(type, value, traceback) jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/kombu/serialization.py", line 53, in _reraise_errors jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | reraise(wrapper, wrapper(exc), sys.exc_info()[2]) jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/kombu/exceptions.py", line 21, in reraise jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | raise value.with_traceback(tb) jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/kombu/serialization.py", line 49, in _reraise_errors jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | yield jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/kombu/serialization.py", line 220, in dumps jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | payload = encoder(data) jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/kombu/utils/json.py", line 65, in dumps jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | return _dumps(s, cls=cls or _default_encoder, jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/json/__init__.py", line 234, in dumps jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | return cls( jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/json/encoder.py", line 199, in encode jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | chunks = self.iterencode(o, _one_shot=True) jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/json/encoder.py", line 257, in iterencode jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | return _iterencode(o, 0) jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/site-packages/kombu/utils/json.py", line 55, in default jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | return super().default(o) jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | File "/usr/local/lib/python3.9/json/encoder.py", line 179, in default jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | raise TypeError(f'Object of type {o.__class__.__name__} ' jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | kombu.exceptions.EncodeError: Object of type bytes is not JSON serializable jasmin_jasmin.1.6am9feewjand@ryanzeng-Desktop | [2022-04-28 23:15:14,646: ERROR/ForkPoolWorker-5] Task [e3ba7a53-eea0-4bfc-8e4b-034bff8d5613] failed: Object of type bytes is not JSON serializable
the cause: at https://github.com/jookies/jasmin/blob/master/jasmin/protocols/rest/tasks.py#L105 , r.content returns bytes, instead of string reference: https://docs.python-requests.org/en/master/api/#requests.Response.content
I will create a PR to fix this.
Thanks
Stale issue detected, remove stale label or comment or this will be closed soon.
This issue was closed because it has been stalled more than a year with no activity.
error trace
the cause: at https://github.com/jookies/jasmin/blob/master/jasmin/protocols/rest/tasks.py#L105 , r.content returns bytes, instead of string reference: https://docs.python-requests.org/en/master/api/#requests.Response.content
I will create a PR to fix this.
Thanks