I want to preface by saying that I might be doing something wrong here but I can't figure it out...
I'm trying to set one of my pets as indoor only, my call looks something like this:
url: http://tower:8080/pets/316743/state
method: patch
content_type: "application/json"
payload: '{ "position": 0, "indoor_only": true }'
In the logs, here is the result:
2026-05-14T08:48:44 | TRACE | uvicorn.error | 172.17.0.1:51714 - HTTP connection made
2026-05-14T08:48:44 | TRACE | uvicorn.asgi | 172.17.0.1:51714 - ASGI [3] Started scope={'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.7', 3001), 'client': ('172.17.0.1', 51714), 'scheme': 'http', 'method': 'PATCH', 'root_path': '', 'path': '/pets/316743/state', 'raw_path': b'/pets/316743/state', 'query_string': b'', 'headers': '<...>', 'state': {}}
2026-05-14T08:48:44 | TRACE | uvicorn.asgi | 172.17.0.1:51714 - ASGI [3] Receive {'type': 'http.request', 'body': '<38 bytes>', 'more_body': False}
2026-05-14T08:48:44 | INFO | surehub_api.utils.logger | "POST https://app-api.production.surehub.io/api/auth/login HTTP/1.1" 200 OK
2026-05-14T08:48:44 | ERROR | surehub_api.utils.logger | "POST https://app-api.production.surehub.io/api/pet/316743/position HTTP/1.1" 422 Unprocessable Entity
2026-05-14T08:48:44 | TRACE | uvicorn.asgi | 172.17.0.1:51714 - ASGI [3] Send {'type': 'http.response.start', 'status': 422, 'headers': '<...>'}
2026-05-14T08:48:44 | INFO | uvicorn.access | 172.17.0.1:51714 - "PATCH /pets/316743/state HTTP/1.1" 422 Unprocessable Content
2026-05-14T08:48:44 | TRACE | uvicorn.asgi | 172.17.0.1:51714 - ASGI [3] Send {'type': 'http.response.body', 'body': '<100 bytes>'}
2026-05-14T08:48:44 | TRACE | uvicorn.asgi | 172.17.0.1:51714 - ASGI [3] Completed
2026-05-14T08:48:49 | TRACE | uvicorn.error | 172.17.0.1:51714 - HTTP connection lost
I do not know why the surehub api is returning 422. To make sure my pet ID was valid, I made a state request which returns the information. Here's the log of that:
2026-05-14T08:50:02 | TRACE | uvicorn.error | 192.168.0.13:4787 - HTTP connection made
2026-05-14T08:50:02 | TRACE | uvicorn.asgi | 192.168.0.13:4787 - ASGI [4] Started scope={'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.7', 3001), 'client': ('192.168.0.13', 4787), 'scheme': 'http', 'method': 'GET', 'root_path': '', 'path': '/pets/316743/state', 'raw_path': b'/pets/316743/state', 'query_string': b'', 'headers': '<...>', 'state': {}}
2026-05-14T08:50:02 | INFO | surehub_api.utils.logger | "GET https://app-api.production.surehub.io/api/pet/316743 HTTP/1.1" 200 OK
2026-05-14T08:50:02 | TRACE | uvicorn.asgi | 192.168.0.13:4787 - ASGI [4] Send {'type': 'http.response.start', 'status': 200, 'headers': '<...>'}
2026-05-14T08:50:02 | INFO | uvicorn.access | 192.168.0.13:4787 - "GET /pets/316743/state HTTP/1.1" 200 OK
2026-05-14T08:50:02 | TRACE | uvicorn.asgi | 192.168.0.13:4787 - ASGI [4] Send {'type': 'http.response.body', 'body': '<122 bytes>'}
2026-05-14T08:50:02 | TRACE | uvicorn.asgi | 192.168.0.13:4787 - ASGI [4] Completed
2026-05-14T08:50:07 | TRACE | uvicorn.error | 192.168.0.13:4787 - HTTP connection lost
I want to preface by saying that I might be doing something wrong here but I can't figure it out...
I'm trying to set one of my pets as indoor only, my call looks something like this:
url: http://tower:8080/pets/316743/state
method: patch
content_type: "application/json"
payload: '{ "position": 0, "indoor_only": true }'
In the logs, here is the result:
2026-05-14T08:48:44 | TRACE | uvicorn.error | 172.17.0.1:51714 - HTTP connection made
2026-05-14T08:48:44 | TRACE | uvicorn.asgi | 172.17.0.1:51714 - ASGI [3] Started scope={'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.7', 3001), 'client': ('172.17.0.1', 51714), 'scheme': 'http', 'method': 'PATCH', 'root_path': '', 'path': '/pets/316743/state', 'raw_path': b'/pets/316743/state', 'query_string': b'', 'headers': '<...>', 'state': {}}
2026-05-14T08:48:44 | TRACE | uvicorn.asgi | 172.17.0.1:51714 - ASGI [3] Receive {'type': 'http.request', 'body': '<38 bytes>', 'more_body': False}
2026-05-14T08:48:44 | INFO | surehub_api.utils.logger | "POST https://app-api.production.surehub.io/api/auth/login HTTP/1.1" 200 OK
2026-05-14T08:48:44 | ERROR | surehub_api.utils.logger | "POST https://app-api.production.surehub.io/api/pet/316743/position HTTP/1.1" 422 Unprocessable Entity
2026-05-14T08:48:44 | TRACE | uvicorn.asgi | 172.17.0.1:51714 - ASGI [3] Send {'type': 'http.response.start', 'status': 422, 'headers': '<...>'}
2026-05-14T08:48:44 | INFO | uvicorn.access | 172.17.0.1:51714 - "PATCH /pets/316743/state HTTP/1.1" 422 Unprocessable Content
2026-05-14T08:48:44 | TRACE | uvicorn.asgi | 172.17.0.1:51714 - ASGI [3] Send {'type': 'http.response.body', 'body': '<100 bytes>'}
2026-05-14T08:48:44 | TRACE | uvicorn.asgi | 172.17.0.1:51714 - ASGI [3] Completed
2026-05-14T08:48:49 | TRACE | uvicorn.error | 172.17.0.1:51714 - HTTP connection lost
I do not know why the surehub api is returning 422. To make sure my pet ID was valid, I made a state request which returns the information. Here's the log of that:
2026-05-14T08:50:02 | TRACE | uvicorn.error | 192.168.0.13:4787 - HTTP connection made
2026-05-14T08:50:02 | TRACE | uvicorn.asgi | 192.168.0.13:4787 - ASGI [4] Started scope={'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.7', 3001), 'client': ('192.168.0.13', 4787), 'scheme': 'http', 'method': 'GET', 'root_path': '', 'path': '/pets/316743/state', 'raw_path': b'/pets/316743/state', 'query_string': b'', 'headers': '<...>', 'state': {}}
2026-05-14T08:50:02 | INFO | surehub_api.utils.logger | "GET https://app-api.production.surehub.io/api/pet/316743 HTTP/1.1" 200 OK
2026-05-14T08:50:02 | TRACE | uvicorn.asgi | 192.168.0.13:4787 - ASGI [4] Send {'type': 'http.response.start', 'status': 200, 'headers': '<...>'}
2026-05-14T08:50:02 | INFO | uvicorn.access | 192.168.0.13:4787 - "GET /pets/316743/state HTTP/1.1" 200 OK
2026-05-14T08:50:02 | TRACE | uvicorn.asgi | 192.168.0.13:4787 - ASGI [4] Send {'type': 'http.response.body', 'body': '<122 bytes>'}
2026-05-14T08:50:02 | TRACE | uvicorn.asgi | 192.168.0.13:4787 - ASGI [4] Completed
2026-05-14T08:50:07 | TRACE | uvicorn.error | 192.168.0.13:4787 - HTTP connection lost