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

azure.core.exceptions.DeserializationError: Cannot deserialize content-type: text/html #2178

Open
Vignesh-JP opened this issue Oct 18, 2024 · 1 comment
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.

Comments

@Vignesh-JP
Copy link

Vignesh-JP commented Oct 18, 2024

Version

4.16.2

Describe the bug

I'm trying to test a python based MS azure bot using a webchat emulator.. i couldn't get the response from the bot..
When i try it locally with the bot emulator, i could a successful connection establishment between bot and emulator and getting an expected responses.. And when both the bot and webchat emulator runs in my local, i'm even 200 response.

Problem is when I deploy the bot, and use this service url and test on the local emulator i'm getting responses like

Error while invoking bot API - Response{protocol=http/1.1, code=500, message=Internal Server Error, url=http://xxxxxxxxxxxx:3972/bot}
        at com.mase.webchat.client.AzureClient.postActivity(AzureClient.java:104) ~[classes/:na]
        at com.mase.webchat.controller.ChatController.addUser(ChatController.java:86) ~[classes/:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_202]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_202]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_202]

And from the bot end, I could see

 File "/usr/local/lib/python3.9/site-packages/botbuilder/core/cloud_adapter_base.py", line 93, in send_activities
    response = await connector_client.conversations.reply_to_activity(
  File "/usr/local/lib/python3.9/site-packages/botframework/connector/aio/operations_async/_conversations_operations_async.py", line 524, in reply_to_activity
    response = await self._client.async_send(
  File "/usr/local/lib/python3.9/site-packages/msrest/async_client.py", line 115, in async_send
    pipeline_response = await self.config.pipeline.run(request, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/msrest/pipeline/async_abc.py", line 159, in run
    return await first_node.send(pipeline_request, **kwargs)  # type: ignore
  File "/usr/local/lib/python3.9/site-packages/msrest/pipeline/async_abc.py", line 79, in send
    response = await self.next.send(request, **kwargs)  # type: ignore
  File "/usr/local/lib/python3.9/site-packages/msrest/pipeline/async_requests.py", line 106, in send
    return await self.next.send(request, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/msrest/pipeline/async_abc.py", line 84, in send
    self._policy.on_response(request, response, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/msrest/pipeline/universal.py", line 250, in on_response
    response.context[self.CONTEXT_NAME] = self.deserialize_from_http_generics(
  File "/usr/local/lib/python3.9/site-packages/msrest/pipeline/universal.py", line 226, in deserialize_from_http_generics
    return cls.deserialize_from_text(body_bytes, content_type)
  File "/usr/local/lib/python3.9/site-packages/msrest/pipeline/universal.py", line 203, in deserialize_from_text
    raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))
azure.core.exceptions.DeserializationError: Cannot deserialize content-type: text/html

Even cross-verified the content-type in the request payload and it is set as application/json as expected.. and also verified the versions between local and deployed server.

I'm not sure why is this Cannot deserialize content-type: text/html occurs..

Used versions,
aiohttp - 3.10.5
azure-core - 1.30.2
botbuilder-core - 4.16.2
botbuilder-integration-aiohttp - 4.16.2
botbuilder-schema - 4.16.2
botframework-streaming - 4.16.2
urllib3 - 1.26.19
yarl - 1.9.4

@Vignesh-JP Vignesh-JP added bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team. labels Oct 18, 2024
@sachinanto
Copy link

sachinanto commented Oct 18, 2024

@Stevenic @pcostantini @mgiovani Can someone help with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.
Projects
None yet
Development

No branches or pull requests

2 participants