You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues and added correct labels.
Description
Current Behavior
When running ayon-python-api v1.2.7 versus a server running 1.13.6+202512171758 and calling ayon_api.download_file(file_url, destination) I get a KeyError on 'content-length'
src/rvx_syndic/note.py:105: in path
ayon_api.download_file(
.venv/lib/python3.13/site-packages/ayon_api/_api.py:987: in download_file
return con.download_file(
.venv/lib/python3.13/site-packages/ayon_api/server_api.py:1489: in download_file
self.download_file_to_stream(
.venv/lib/python3.13/site-packages/ayon_api/server_api.py:1437: in download_file_to_stream
self._download_file_to_stream(
.venv/lib/python3.13/site-packages/ayon_api/server_api.py:1381: in _download_file_to_stream
response.headers["Content-length"]
I tried running my tests using the pull request revision as my ayon-python-api source in uv. and I think it pulled it in correctly. However I got the same key error. It's weird that this request object does not have content-length in it however it does have these keys
Ok, so this is because of fixed bug that was in the download logic. It does not prefill api by default in endpoint. If you pre-pend api/ to the url it should work.
Activity
iLLiCiTiT commentedon Jan 5, 2026
May I ask what are you downloading (url example)? Did it work with older ayon api or server?
iLLiCiTiT commentedon Jan 5, 2026
This might resolve the issue, but I can't test it #295 .
sjt-rvx commentedon Jan 5, 2026
Yeah, it worked with the api version 1.2.6 (on 1.13.6 server as well)
it was a note attachment something similar to:
ayon_api.download_file(f"projects/{self._project_name}/files/{attachment_id}", "/path/to/destination.jpg")sjt-rvx commentedon Jan 5, 2026
I tried running my tests using the pull request revision as my
ayon-python-apisource in uv. and I think it pulled it in correctly. However I got the same key error. It's weird that this request object does not havecontent-lengthin it however it does have these keyssjt-rvx commentedon Jan 5, 2026
Ah, the request is doing something wonky. The contents of the response are:
so it seems the request is failing.
and the kwargs for the 1.2.7 request (from
with get_func(url, **kwargs) as response:fame)however the kwargs for the 1.2.6 request is:
so it's the request itself that's failing
iLLiCiTiT commentedon Jan 5, 2026
Ok, let me try.
iLLiCiTiT commentedon Jan 5, 2026
Ok, so this is because of fixed bug that was in the download logic. It does not prefill
apiby default in endpoint. If you pre-pendapi/to the url it should work.EDITED:
For compatibility with both new and old
ayon_apiyou can use thissjt-rvx commentedon Jan 6, 2026
Bingo. Works like a charm. Thanks!