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
When running in docker, get_item_by_title using new_client_from_environment results in timeout value raising TypeError: 'UseClientDefault' object cannot be interpreted as an integer most likely due to the new get_timeout function returning httpx.USE_CLIENT_DEFAULT (instance of UseClientDefault) when environment variable ENV_CLIENT_REQUEST_TIMEOUT ("OP_CONNECT_CLIENT_REQ_TIMEOUT") is not present.
What did you expect to happen?
No error.
Steps to reproduce
Minimal example:
In Dockerfile:
FROM python:3.12-slim
WORKDIR /app
COPY . /app
RUN pip install --no-cache-dir onepasswordconnectsdk
CMD ["python3", "app.py"]
Traceback (most recent call last):
File "/app/app.py", line 7, in <module>
item_by_title = client.get_item_by_title('...', '....')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/onepasswordconnectsdk/client.py", line 156, in get_item_by_title
response = self.build_request("GET", url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/onepasswordconnectsdk/client.py", line 374, in build_request
response = self.session.request(method, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 821, in request
return self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 908, in send
response = self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 936, in _send_handling_auth
response = self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 973, in _send_handling_redirects
response = self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1009, in _send_single_request
response = transport.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 218, in handle_request
resp = self._pool.handle_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 253, in handle_request
raise exc
File "/usr/local/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 237, in handle_request
response = connection.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 86, in handle_request
raise exc
File "/usr/local/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 63, in handle_request
stream = self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 111, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/httpcore/backends/sync.py", line 94, in connect_tcp
sock = socket.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/socket.py", line 834, in create_connection
sock.settimeout(timeout)
TypeError: 'UseClientDefault' object cannot be interpreted as an integer
Docker version:
Client: Docker Engine - Community
Version: 25.0.4
API version: 1.44
Go version: go1.21.8
Git commit: 1a576c5
Built: Wed Mar 6 16:32:14 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 25.0.4
API version: 1.44 (minimum version 1.24)
Go version: go1.21.8
Git commit: 061aa95
Built: Wed Mar 6 16:32:14 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.28
GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
The text was updated successfully, but these errors were encountered:
Your environment
SDK Version: 1.5.0
Connect Server Version: unk.
OS: Linux (Ubuntu 20.04.6 LTS)
Python Version: 3.12
What happened?
When running in docker,
get_item_by_title
usingnew_client_from_environment
results intimeout
value raisingTypeError: 'UseClientDefault' object cannot be interpreted as an integer
most likely due to the newget_timeout
function returninghttpx.USE_CLIENT_DEFAULT
(instance ofUseClientDefault
) when environment variableENV_CLIENT_REQUEST_TIMEOUT
("OP_CONNECT_CLIENT_REQ_TIMEOUT"
) is not present.What did you expect to happen?
No error.
Steps to reproduce
Minimal example:
Dockerfile
:app.py
:docker build -t "test-image" .
docker container run "test-image"
Notes & Logs
Full traceback:
Docker version:
The text was updated successfully, but these errors were encountered: