toniebox-reverse-engineering / teddycloud

teddyCloud is an open source server replacement for the Boxine Cloud
https://toniebox-reverse-engineering.github.io/docs/tools/teddycloud/
GNU General Public License v2.0
487 stars 36 forks source link

HTTP code 401 when I place a figure on the Toniebox #192

Closed flofricke closed 5 months ago

flofricke commented 5 months ago

Hi,

i always get a 401 if i place a figure on the box:

teddycloud | INFO |server.c:0673:server_init| 2 open HTTPS connections teddycloud | INFO |server.c:0281:httpServerRequestCallback| UA=TB/xxx SP/yyy HW/aaa, FW=bbb, SP=ccc, HW=ddd teddycloud | INFO |handler_cloud.c:0346:handleCloudClaim| >> client claim requested rUID eee, auth fff... teddycloud | INFO |cloud_request.c:0162:web_request| Connecting to HTTP server prod.de.tbs.toys:443... teddycloud | INFO |cloud_request.c:0212:web_request| trying IP: 18.156.186.144 teddycloud | INFO |cloud_request.c:0038:httpClientTlsInitCallbackBase| Initializing TLS... teddycloud | INFO |cloud_request.c:0073:httpClientTlsInitCallbackBase| Initializing TLS done teddycloud | INFO |cloud_request.c:0317:web_request| HTTP code: 401 teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: Server = openresty teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: Date = Tue, 02 Jul 2024 06:58:16 GMT teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: Content-Length = 0 teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: Connection = keep-alive teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: cache-control = max-age=0, private, must-revalidate teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: x-request-id = xxx teddycloud | INFO |handler.c:0229:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: NULL teddycloud | INFO |cloud_request.c:0387:web_request| Content-Type header field not found! teddycloud | INFO |cloud_request.c:0401:web_request| Binary data, not dumping body teddycloud | INFO |handler.c:0402:cbrCloudServerDiscoPassthrough| >> cbrCloudServerDiscoPassthrough teddycloud | INFO |cloud_request.c:0458:web_request| Connection closed

But the connection to the cloud seems to work because i can download the content for caching:

teddycloud | INFO |cloud_request.c:0162:web_request| Connecting to HTTP server prod.de.tbs.toys:443... teddycloud | INFO |cloud_request.c:0212:web_request| trying IP: 18.156.186.144 teddycloud | INFO |cloud_request.c:0038:httpClientTlsInitCallbackBase| Initializing TLS... teddycloud | INFO |cloud_request.c:0073:httpClientTlsInitCallbackBase| Initializing TLS done teddycloud | INFO |cloud_request.c:0317:web_request| HTTP code: 200 teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: Server = openresty teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: Date = Tue, 02 Jul 2024 06:57:51 GMT teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: Content-Type = binary/octet-stream teddycloud | INFO |cloud_request.c:0380:web_request| Content-Type is binary/octet-stream teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: Content-Length = xxx0 teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: Connection = keep-alive teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: Last-Modified = Thu, 29 Mar 2018 17:51:14 GMT teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: ETag = "xxx-4" teddycloud | INFO |handler.c:0223:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: Accept-Ranges = bytes teddycloud | INFO |handler.c:0229:cbrCloudHeaderPassthrough| >> cbrCloudHeaderPassthrough: NULL teddycloud | INFO |cloud_request.c:0401:web_request| Binary data, not dumping body teddycloud | INFO |handler.c:0267:cbrCloudBodyPassthrough| >> Start caching uri=/v2/content/xxx teddycloud | INFO |handler.c:0304:cbrCloudBodyPassthrough| >> Successfully cached /teddycloud/data/content/default/xxx/xxx2 teddycloud | INFO |handler.c:0788:moveTAF2Lib| >> Successfully set to library lib://by/audioID/xxx3.taf teddycloud | INFO |handler.c:0402:cbrCloudServerDiscoPassthrough| >> cbrCloudServerDiscoPassthrough teddycloud | INFO |cloud_request.c:0458:web_request| Connection closed

Is that "normal" behavior, is there something wrong on my side or maybe a bug? Is there maybe a way to increase the log level in order to see the request that is being made?

SciLor commented 5 months ago

Thank you for your report. The 401 on a claim is okay. Claiming means -> putting it into your household on tonies.com. If the tonie is either in use and marked as own in a different household or maybe if it is already in your household the 401 can occur. So no bug, it is a feature.

flofricke commented 5 months ago

Thanks for the quick answer, i close the issue.