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

Home Assistant Teddycloud flashing upload error #23

Closed
kevintornesch opened this issue Jan 28, 2025 · 6 comments
Closed

Home Assistant Teddycloud flashing upload error #23

kevintornesch opened this issue Jan 28, 2025 · 6 comments

Comments

@kevintornesch
Copy link

HI I get the error Upload failed when reading flash.

Use Home Assitant with Teddycloud via HTTPS.

Everything works without any problems on a Rasperry Pi with DEbian.

Can someone help me why the upload always fails with the Home Assitant Teddycloud?
Thanks

@marco79cgn
Copy link

marco79cgn commented Jan 28, 2025

Same thing for normal file uploads in the Teddycloud library (via GUI).

They lead to an HTTP 502 - Bad Gateway (nginx) error.

Image

This can be reproduced by opening Tonies → Library in the teddycloud GUI and then pushing the File Upload button to upload any file of your choice.

Plugin version: 0.4.1 (stable)

@mrueg
Copy link
Owner

mrueg commented Jan 28, 2025

Do you see anyhting in the logs of the teddycloud itself? It might show somehting about the bad gateway.

@marco79cgn
Copy link

marco79cgn commented Jan 28, 2025

@mrueg Yes, indeed.

2025/01/28 21:39:03 [error] 409#409: *133 upstream prematurely closed connection while reading response header from upstream, client: 172.30.32.2, server: ff7725ba-teddycloud, request: "POST /api/fileUpload?path=&special=library HTTP/1.1", upstream: "http://127.0.0.1:80/api/fileUpload?path=&special=library", host: "homeassistant.local:8123", referrer: "http://homeassistant.local:8123/api/hassio_ingress/obj1n56lgap-S3O0Sh61eYf7MencCWKzWfs-cOcbnQw/web/tonies/library"
WARN |mutex_manager.c:0153:mutex_manager_check()| Mutex 5 locked for 501
WARN |mutex_manager.c:0123:mutex_unlock()| <mutex 5 had a warning

Don't know if the last two warnings are also relevant. Never seen them until now.

This sounds like a problem of nginx and the maximum file size, doesn't it?

I opened Port 80 in your extension settings by the way. I can upload files from another Mac without problems using curl like this (with the static ip of my HA):

curl -F "[email protected]" "http://192.168.178.52/api/fileUpload?path=&special=library"

@mrueg
Copy link
Owner

mrueg commented Jan 28, 2025

Yes likely more on the nginx side.

@marco79cgn
Copy link

marco79cgn commented Jan 28, 2025

Maybe it's a problem with the allowed hosts?

ALLOWED_HOSTS = ['.mydomain.com', '127.0.0.1', 'localhost', 'homeassistant.local', '172.30.32.2']

Because in the error message it says first 127.0.0.1 and then homeassistant.local whereas the client is 172.30.32.2.

Or it is a problem with timeout/buffer settings?

@mrueg
Copy link
Owner

mrueg commented Jan 28, 2025

I think the issue is a duplicate of #18
Let's continue the conversation there.

@mrueg mrueg closed this as completed Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants