https://prefect.io logo
Title
b

Bob Colner

08/27/2020, 3:17 AM
After upgrading from prefect core
0.11.2
to
0.13.4
my flow is failing with an error related to 'Cloud' -which is strange since I'm not using prefect cloud (or local server/UI). Looks like it is related to the slack notifications. Any ideas? (full logs posted in the thread)
[2020-08-27 03:11:00] INFO - prefect.FlowRunner | Beginning Flow run for 'data-workflow'
Beginning Flow run for 'data-workflow'
[2020-08-27 03:11:00] DEBUG - prefect.FlowRunner | Flow 'data-workflow': Handling state change from Scheduled to Running
Flow 'data-workflow': Handling state change from Scheduled to Running
[2020-08-27 03:11:00] ERROR - prefect.FlowRunner | Unexpected error while calling state handlers: ClientError('Malformed response received from Cloud - please ensure that you have an API token properly configured.')
Traceback (most recent call last):
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/client/client.py", line 406, in _request
    json_resp = response.json()
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/requests/models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "/opt/conda/envs/flow/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/opt/conda/envs/flow/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/opt/conda/envs/flow/lib/python3.7/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)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/engine/runner.py", line 162, in handle_state_change
    new_state = self.call_runner_target_handlers(old_state, new_state)
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/engine/flow_runner.py", line 116, in call_runner_target_handlers
    new_state = handler(self.flow, old_state, new_state) or new_state
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/toolz/functoolz.py", line 303, in __call__
    return self._partial(*args, **kwargs)
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/utilities/notifications/notifications.py", line 310, in slack_notifier
    form_data = slack_message_formatter(tracked_obj, new_state, backend_info)
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/utilities/notifications/notifications.py", line 158, in slack_message_formatter
    "flow-run", prefect.context["flow_run_id"], as_user=False
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/client/client.py", line 813, in get_cloud_url
    tenant_slug = self.get_default_tenant_slug(as_user=as_user)
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/client/client.py", line 849, in get_default_tenant_slug
    res = self.graphql(query)
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/client/client.py", line 281, in graphql
    retry_on_api_error=retry_on_api_error,
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/client/client.py", line 237, in post
    retry_on_api_error=retry_on_api_error,
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/client/client.py", line 410, in _request
    "Malformed response received from Cloud - please ensure that you "
prefect.utilities.exceptions.ClientError: Malformed response received from Cloud - please ensure that you have an API token properly configured.
Unexpected error while calling state handlers: ClientError('Malformed response received from Cloud - please ensure that you have an API token properly configured.')
Traceback (most recent call last):
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/client/client.py", line 406, in _request
    json_resp = response.json()
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/requests/models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "/opt/conda/envs/flow/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/opt/conda/envs/flow/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/opt/conda/envs/flow/lib/python3.7/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)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/engine/runner.py", line 162, in handle_state_change
    new_state = self.call_runner_target_handlers(old_state, new_state)
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/engine/flow_runner.py", line 116, in call_runner_target_handlers
    new_state = handler(self.flow, old_state, new_state) or new_state
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/toolz/functoolz.py", line 303, in __call__
    return self._partial(*args, **kwargs)
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/utilities/notifications/notifications.py", line 310, in slack_notifier
    form_data = slack_message_formatter(tracked_obj, new_state, backend_info)
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/utilities/notifications/notifications.py", line 158, in slack_message_formatter
    "flow-run", prefect.context["flow_run_id"], as_user=False
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/client/client.py", line 813, in get_cloud_url
    tenant_slug = self.get_default_tenant_slug(as_user=as_user)
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/client/client.py", line 849, in get_default_tenant_slug
    res = self.graphql(query)
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/client/client.py", line 281, in graphql
    retry_on_api_error=retry_on_api_error,
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/client/client.py", line 237, in post
    retry_on_api_error=retry_on_api_error,
  File "/opt/conda/envs/flow/lib/python3.7/site-packages/prefect/client/client.py", line 410, in _request
    "Malformed response received from Cloud - please ensure that you "
prefect.utilities.exceptions.ClientError: Malformed response received from Cloud - please ensure that you have an API token properly configured.
[2020-08-27 03:11:00] ERROR - prefect.data-workflow | Unexpected error occured in FlowRunner: ClientError('Malformed response received from Cloud - please ensure that you have an API token properly configured.')
Unexpected error occured in FlowRunner: ClientError('Malformed response received from Cloud - please ensure that you have an API token properly configured.')
c

Chris White

08/27/2020, 3:25 AM
Hi @Bob Colner - I think this was a breaking change in one of the releases; you need to specify
backend_info=False
when you initialize the slack notifier
b

Bob Colner

08/27/2020, 3:35 AM
thanks, good to know. Where is the best place find info about breaking changes?
c

Chris White

08/27/2020, 3:45 AM
Great question - whenever we announce releases we link to the changelog, and we always include a
Breaking Changes
section in the changelog. Since we’re pre-1.0, whenever we have a minor version release (e.g., 0.11 -> 0.13) it’s generally a good idea to take a look for possible breaking changes
b

Bob Colner

08/27/2020, 3:52 AM
nice, I've have looked at that, maybe I'm missing somthing but I don't see anything related to slack the the breaking changes section FIY: https://github.com/PrefectHQ/prefect/blob/master/CHANGELOG.md
c

Chris White

08/27/2020, 4:17 AM
Oh interesting - it appears you’ve found a bug in our changelog! It looks like this was released in 0.13.2 but was not listed as a breaking change, my apologies