question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Attempt to decode JSON with unexpected mimetype: text/html

See original GitHub issue

Rasa version:

rasa --version Rasa 1.0.0

Rasa X version (if used & relevant):

rasa/rasa-x:stable from docker

Python version: python3 --version Python 3.6.8

Operating system (windows, osx, …):

Linux 7e5eb7ff3f80 4.4.0-1083-aws #93-Ubuntu SMP Wed May 8 16:08:41 UTC 2019 x86_64 GNU/Linux

Issue:

  1. Run rasa-x, login
  2. select an model that has already been trained
  3. click “talk to your bot” and enter text

ERROR: nothing happens. Log of production container shows the following:

$ docker logs -f rasa_rasa-production_1
[...]
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 917, in handle_request
    response = await response
  File "/usr/local/lib/python3.6/site-packages/rasa/core/channels/channel.py", line 430, in receive
    sender_id = await self._extract_sender(request)
  File "/usr/local/lib/python3.6/site-packages/rasa/core/channels/rasa_chat.py", line 50, in _extract_sender
    user = await self._check_token(req.headers.get("Authorization"))
  File "/usr/local/lib/python3.6/site-packages/rasa/core/channels/rasa_chat.py", line 38, in _check_token
    return await resp.json()
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 1027, in json
    headers=self.headers)
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html'

Is this a known issue? This is using the following versions of aiohttp

$ pip3 list | grep aio
aiofiles                0.4.0   
aiohttp                 3.5.4  

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
ricwocommented, Jun 7, 2019

@ddombrowsky It’s probably due to a wrong entry in credentials.yml - this will be fixed in the next release. in the meantime, can you change the contents of the /etc/rasa/credentials.yml to

rasa:
  url: ${RASA_X_HOST}/api

and try again?

1reaction
akeladcommented, Jun 13, 2019

i’m gonna close this issue now, a fix will be part of an upcoming release

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python - Attempt to decode JSON with unexpected mimetype
Pass expected content type to json() method: data = await resp.json(content_type='text/html'). or disable the check entirely:
Read more >
Attempt to decode JSON with unexpected mimetype: text/html ...
The server is obviously incorrect, as the error says it is sending a content-type of text/html. You can customise the check with content_type...
Read more >
0, message='Attempt to decode JSON with unexpected ...
Hi all, I am getting the above-mentioned error when try CallbackInput method. Rasa version is : Rasa 1.0.6 Here is my code, credentials.yml ......
Read more >
aio-libs/Lobby - Gitter
I have this error where this json on the web is like ... ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; ......
Read more >
Google Home Error log "Attempt to decode JSON with ...
I have a dozen of these error logs all of a sudden, i think after latest update 2019-06-28 16:35:28 ERROR (MainThread) [googledevices] ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found