ambiata / atmosphere-python-sdk

Python sdk to create custom code interacting with Atmosphere
MIT License
0 stars 0 forks source link

Missing error logs #30

Closed gusmith closed 3 years ago

gusmith commented 3 years ago

In the motor quote activity v0.6.7 which is using the sdk v2.0.0, the activity does not return any logs when an error occur. What we observed in https://github.com/ambiata/iag-motor-quote/issues/30 was that when running a exclusion rule, and an error occur in the exclusion (in the case it should have been a type error raised), there are nothing logged in the container.

The only thing we can observe is that in atmosphereX, we got such log:

Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/app/app/models/activity_logic/custom_logic.py", line 37, in wrapper_custom_logic_request_error_handler
    return func(self, *args, **kwargs)
  File "/app/app/models/activity_logic/custom_logic.py", line 134, in get_applied_exclusion_conditions
    **requests.post(
  File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.8/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)
Custom Logic with base url default crashed
127.0.0.1:51974 - "POST /api/inferences/motor-quote/predictions?payload_format=default HTTP/1.1" 400
vQuagliaro commented 3 years ago

@gusmith I don't understand the issue so I can't propose a solution to fix it.

vQuagliaro commented 3 years ago

Screen Shot 2021-06-03 at 10 54 53 am

vQuagliaro commented 3 years ago

The configuration on iag/stage and iag/prod pointed to the iag/test custom activity.

vQuagliaro commented 3 years ago

@gusmith I let you close the PR.