ESP32 Box Flashing - Error 500 while uploading Flash Data

While trying to flash my Toniebox I can’t get past the second step. Reading ESP32 seems to work, it also saves a file in the firmwares folder but while uploading, something seems to go wrong. The error message is not that helpful, at least to me. This is the error:

[ERROR] 2026-01-14 23:31:17 [ESP32] uploadFlashData: server error {“status”:500,“body”:“{\“error\”:\“An unexpected error occurred.\”,\“message\”:{}}”}

Some information:
Ubuntu 24.04.3 LTS
Docker Version 20.10.17
TeddyCloud v0.6.7 (5b59a82)

docker-compose.yaml:

services:
  teddycloud:
    container_name: teddycloud
    hostname: teddycloud
    image: ghcr.io/toniebox-reverse-engineering/teddycloud:tc_v0.6.7
    user: "1000:1000"
    cap_add:
      - NET_ADMIN
    environment:
      - TZ=Europe/Berlin
    networks:
      macvlan_net:
        ipv4_address: 192.168.68.9
      traefik: {}
    # ports:
    #  - 80:80 #optional (for the webinterface)
    #  - 8443:8443 #optional (for the webinterface)
    #  - 443:443 #Port is needed for the connection for the box, must not be changed!
    volumes:
      - ./certs:/teddycloud/certs:rw #certificates of the server
      - ./config:/teddycloud/config:rw #config file for the server and the boxes
      - ./content:/teddycloud/data/content:rw #microSD representation for the boxes
      - ./library:/teddycloud/data/library:rw #library to manage content
      - ./custom_img:/teddycloud/data/www/custom_img:rw #location to store custom images for custom tonies json
      - ./firmware:/teddycloud/data/firmware:rw #firmware backups
      - ./cache:/teddycloud/data/cache:rw #img cache for content images
      - ./plugins:/teddycloud/data/www/plugins:rw #location to store web plugins for teddyCloud
    restart: unless-stopped
    labels:
      - "traefik.enable=true"
      - "traefik.http.services.teddycloud.loadbalancer.server.port=80"
      - "traefik.docker.network=traefik"

networks:
  macvlan_net:
    driver: macvlan
    driver_opts:
      parent: eno1
    ipam:
      config:
        - subnet: 192.168.68.0/22
          gateway: 192.168.68.1
          ip_range: 192.168.68.9/32
  traefik:
    external: true

Flash-Log:

[INFO] 2026-01-14 23:30:07 [ESP32][Revvox] readFlash: done {"bytes":8388608}
[INFO] 2026-01-14 23:30:07 [ESP32][Revvox] readFlash: integrity check...
[INFO] 2026-01-14 23:30:07 [ESP32] integrity: start {"bytes":8388608}
[INFO] 2026-01-14 23:30:07 [ESP32] integrity: flash not all 0xFF/0x00
[INFO] 2026-01-14 23:30:07 [ESP32] integrity: checking assets/certs partition...
[INFO] 2026-01-14 23:30:07 [ESP32] integrity: certs found {"ok":true,"partitionsFound":8,"assetsPartition":{"type":1,"subtype":129,"offset":61440,"size":1441792,"label":"assets","flags":0},"fsType":"fat","cert":{"foundCertDir":true,"found":{"CERT/CA.DER":true,"CERT/CLIENT.DER":true,"CERT/PRIVATE.DER":true}}}
[INFO] 2026-01-14 23:30:07 [ESP32] integrity: OK
[INFO] 2026-01-14 23:30:07 [ESP32][Revvox] readFlash: integrity OK
[INFO] 2026-01-14 23:30:07 [ESP32][Revvox] readFlash: download link created
[INFO] 2026-01-14 23:30:07 [ESP32][Revvox] readFlash: uploading to server... {"name":"ESP32_dcda0c045f18"}
[INFO] 2026-01-14 23:30:07 [ESP32] uploadFlashData: start {"name":"ESP32_dcda0c045f18","bytes":8388608}
[INFO] 2026-01-14 23:30:07 [ESP32] uploadFlashData: POST /api/esp32/uploadFirmware {"name":"ESP32_dcda0c045f18"}
[ERROR] 2026-01-14 23:31:17 [ESP32] uploadFlashData: server error {"status":500,"body":"{\"error\":\"An unexpected error occurred.\",\"message\":{}}"}
[INFO] 2026-01-14 23:31:17 [ESP32][Revvox] readFlash: upload finished
[INFO] 2026-01-14 23:31:17 [ESP32][Revvox] Disconnect requested
[INFO] 2026-01-14 23:31:17 [ESP32][Revvox] Disconnected OK

And teddycloud logs:

Running teddycloud...
TeddyCloud v0.6.7 (5b59a82) - 2026-01-11 11:47:28 +0000 ubuntu linux-x86_64(64)

INFO |settings.c:0872:settings_load_ovl| Load settings from /teddycloud/config/config.overlay.ini
INFO |settings.c:0872:settings_load_ovl| Load settings from /teddycloud/config/config.ini
INFO |tls_adapter.c:0204:read_certificate| File '/teddycloud/certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0204:read_certificate| File '/teddycloud/certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
ERROR|tls_adapter.c:0189:read_certificate| Failed to open '/teddycloud/certs/client/ca.der' for cert type detection
ERROR|tls_adapter.c:0376:load_cert| Loading cert '/teddycloud/certs/client/ca.der' failed
ERROR|tls_adapter.c:0189:read_certificate| Failed to open '/teddycloud/certs/client/client.der' for cert type detection
ERROR|tls_adapter.c:0376:load_cert| Loading cert '/teddycloud/certs/client/client.der' failed
ERROR|tls_adapter.c:0189:read_certificate| Failed to open '/teddycloud/certs/client/private.der' for cert type detection
ERROR|tls_adapter.c:0376:load_cert| Loading cert '/teddycloud/certs/client/private.der' failed
INFO |settings.c:0872:settings_load_ovl| Load settings from /teddycloud/config/config.overlay.ini
INFO |tls_adapter.c:0390:tls_adapter_init| Loading certificates...
INFO |tls_adapter.c:0204:read_certificate| File '/teddycloud/certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0204:read_certificate| File '/teddycloud/certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
ERROR|tls_adapter.c:0189:read_certificate| Failed to open '/teddycloud/certs/client/ca.der' for cert type detection
ERROR|tls_adapter.c:0376:load_cert| Loading cert '/teddycloud/certs/client/ca.der' failed
ERROR|tls_adapter.c:0189:read_certificate| Failed to open '/teddycloud/certs/client/client.der' for cert type detection
ERROR|tls_adapter.c:0376:load_cert| Loading cert '/teddycloud/certs/client/client.der' failed
ERROR|tls_adapter.c:0189:read_certificate| Failed to open '/teddycloud/certs/client/private.der' for cert type detection
ERROR|tls_adapter.c:0376:load_cert| Loading cert '/teddycloud/certs/client/private.der' failed
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 5843696
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:0389: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.108.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 5843696
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
ERROR|cloud_request.c:0262:web_request| Failed to connect to HTTP server! HTTP=Unknown HTTP Status Code error=Timeout [220]
ERROR|toniesJson.c:0244:tonieboxes_update| ... failed updating tonieboxes.json error=Timeout [220]
INFO |handler_api.c:2493:handleApiTonieboxJson| Trying to read /teddycloud/config/tonieboxes.json with size 3022
INFO |handler_cloud.c:0041:handleCloudTime|  >> respond with current time
INFO |mqtt.c:0691:mqtt_init_box| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_reverse.c:0177:handleReverseGeneric| Reverse proxying to: api.github.com/repos/toniebox-reverse-engineering/teddycloud/releases/latest
INFO |handler_reverse.c:0219:handleReverseGeneric| Serving from cache: /teddycloud/data/cache/reverse.teddycloud_release.DAA30602FE1E8CD77010A6CE72AC4F28739F03DA293BA92337A7ACB3B5CAD966.1768428939 (expires in 86150 seconds)
INFO |handler_api.c:1122:file_save_start_suffix| Writing to '/teddycloud/data/firmware/ESP32_dcda0c045f18_1.bin'
ERROR|server_helpers.c:0360:multipart_handle| httpReceive failed with error End of stream [512]
INFO |handler_api.c:2493:handleApiTonieboxJson| Trying to read /teddycloud/config/tonieboxes.json with size 3022
INFO |handler_cloud.c:0041:handleCloudTime|  >> respond with current time
INFO |mqtt.c:0691:mqtt_init_box| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_reverse.c:0177:handleReverseGeneric| Reverse proxying to: api.github.com/repos/toniebox-reverse-engineering/teddycloud/releases/latest
INFO |handler_reverse.c:0219:handleReverseGeneric| Serving from cache: /teddycloud/data/cache/reverse.teddycloud_release.DAA30602FE1E8CD77010A6CE72AC4F28739F03DA293BA92337A7ACB3B5CAD966.1768428939 (expires in 85694 seconds)
INFO |handler_api.c:1122:file_save_start_suffix| Writing to '/teddycloud/data/firmware/ESP32_dcda0c045f18_2.bin'
ERROR|server_helpers.c:0360:multipart_handle| httpReceive failed with error End of stream [512]

Starting the process over, restarting teddycloud and changing browsers didn’t help and now I am a bit stumped on what it could be. The error in the flash log is a bit unspecific and I am not sure how relevant the errors in the teddycloud logs are. Anyway if someone can help me out, that would be great. If more information is needed let me know.

Maybe your reverse proxy makes trouble? You may also check its logs and also your browsers dev console