toniebox-reverse-engineering/teddycloud

Failed to read HTTP response header!

Closed this issue · 2 comments

mf1x commented

Hi,

I successfully flashed my ESP32 box a couple of weeks ago.

Today I tried adding new Tonies to the box. They show up in the Teddycloud server UI and are added to the my.tonies.com portal.

Unfortunately, I get the "Owl" error after placing new Tonies on top of the box and it fails to download/play the new content.

I am using the latest Teddycloud Docker image.

The logs say the following:

INFO |server.c:0430:httpServerRequestCallback| UA=toniebox-esp32-eu/v5.233.0, ESPFW=eu/v5.233.0
INFO |mqtt.c:0699:mqtt_init_box| Registered new box 'teddyCloud Box' (cn: '34B7DA4E893C')
INFO |mqtt.c:0700:mqtt_init_box| Using base path 'teddyCloud/box/34B7DA4E893C' and id 'teddyCloud_Box_34B7DA4E893C'
INFO |handler_cloud.c:0448:handleCloudContent|  >> client requested content for rUID 7d99b520500304e0, auth E43E3174...
INFO |handler_cloud.c:0724:handleCloudContent| Serve cloud content from /v2/content/7d99b520500304e0
INFO |cloud_request.c:0200:web_request| Connecting to HTTP server prod.de.tbs.toys:443...
INFO |cloud_request.c:0252:web_request|   trying IP: 16.51.73.60
ERROR|cloud_request.c:0344:web_request| Failed to read HTTP response header!
INFO |server.c:0959:server_init| 1 open HTTPS API connections

I checked and the Teddycloud server can make outgoing connections. Also checked my firewall and requests to IPs behind prod.de.tbs.toys go out as well.

INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.custom.json with size 2
INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.json with size 5051123
src/cache.c:194:35: runtime error: left shift of 183 by 24 places cannot be represented in type 'int'
INFO |toniesJson.c:0100:tonies_update| Updating tonies.json from api.revvox.de...
INFO |cloud_request.c:0200:web_request| Connecting to HTTP server api.revvox.de:443...
INFO |cloud_request.c:0252:web_request|   trying IP: 157.90.183.226
INFO |cloud_request.c:0382:web_request| Redirecting to: https://raw.githubusercontent.com/toniebox-reverse-engineering/tonies-json/release/tonies.json
INFO |cloud_request.c:0200:web_request| Connecting to HTTP server raw.githubusercontent.com:443...
INFO |cloud_request.c:0252:web_request|   trying IP: 185.199.110.133
INFO |toniesJson.c:0124:tonies_update| ... success updating tonies.json from api.revvox.de, reloading
INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.custom.json with size 2
INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.json with size 5051123
INFO |toniesJson.c:0211:tonieboxes_update| Updating tonies.json from api.revvox.de...
INFO |cloud_request.c:0200:web_request| Connecting to HTTP server api.revvox.de:443...
INFO |cloud_request.c:0252:web_request|   trying IP: 157.90.183.226
INFO |cloud_request.c:0382:web_request| Redirecting to: https://raw.githubusercontent.com/toniebox-reverse-engineering/tonies-json/release/tonieboxes.json
INFO |cloud_request.c:0200:web_request| Connecting to HTTP server raw.githubusercontent.com:443...
INFO |cloud_request.c:0252:web_request|   trying IP: 185.199.110.133
INFO |toniesJson.c:0238:tonieboxes_update| ... success updating tonieboxes.json from api.revvox.de, reloading
INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.custom.json with size 2
INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.json with size 5051123

Does someone have any ideas?

Thanks in advance.

I don't think this is a problem with teddyCloud but with your environment.
Please enable the pcap dump and then you may check which kind of data teddyCloud receives and cannot handle.

mf1x commented

I get the 304 error when using Ubuntu Docker and Teddycloud for Windows. At first, I thought it was my firewall but after testing the Windows version with a mobile hotspot I got the same error.

My next thought was that my certificates were not valid. After setting up multiple containers and a lot of testing, I used the ESPTool to flash the original unpatched firmware back onto the Toniebox.
The certificates I used for all my tests were the ones from the original unpatched firmware.

With Wireshark, I can only see a couple of TCP Retransmission and Port Reused errors.

Reverting the box to the original firmware worked without problems and I can get new content from the Tonies cloud again, so my certificates must be fine.

I might try it again in a few months, and I hope the issue is gone.