Bug: SFTP Testcontainer Times out with default config / RSA key pair
維護者通常 12 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- docker, python
- 領域
- networking, testing
研究方向
從 testcontainers/sftp/init.py 開始,尤其檢查 SFTPContainer.start,並檢視 testcontainers/core/waiting_utils.py 中對 wait_for_logs 的呼叫。使用 RSA 金鑰對使用者重現預設設定,然後驗證啟動是否能在不觸發 120 秒逾時的情況下完成,並為該預設路徑新增涵蓋測試。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
Using the default config for the SFTP testcontainer, the Script raises a TimeoutError. Seems to only happen with an RSA keypair user, which is included by default.
To Reproduce
Provide a self-contained code snippet that illustrates the bug or unexpected behavior. Ideally, send a Pull Request to illustrate with a test that illustrates the problem.
from testcontainers.sftp import SFTPContainer
with SFTPContainer() as sftp_container:
print("Hello World")
Results in:
Pulling image testcontainers/ryuk:0.8.1
Container started: cffcdb6f31c4
Waiting for container <Container: cffcdb6f31c4> with image testcontainers/ryuk:0.8.1 to be ready ...
Pulling image atmoz/sftp:alpine
Container started: 170fb1ee983a
Traceback (most recent call last):
File "/.../minimum_example.py", line 3, in <module>
with SFTPContainer() as sftp_container:
File "/.../.venv/lib/python3.12/site-packages/testcontainers/core/container.py", line 134, in __enter__
return self.start()
^^^^^^^^^^^^
File "/.../.venv/lib/python3.12/site-packages/testcontainers/sftp/__init__.py", line 269, in start
wait_for_logs(self, f".*Server listening on 0.0.0.0 port {self.port}.*")
File "/.../.venv/lib/python3.12/site-packages/testcontainers/core/waiting_utils.py", line 125, in wait_for_logs
raise TimeoutError(f"Container did not emit logs satisfying predicate in {timeout:.3f} " "seconds")
TimeoutError: Container did not emit logs satisfying predicate in 120.000 seconds
Using only a user with a Password Authentication (no RSA key pairs) seems to work fine:
from testcontainers.sftp import SFTPContainer, SFTPUser
sftp_user = SFTPUser(name="user", password="Secret")
with SFTPContainer(users=[sftp_user]) as sftp_container:
print("Hello World")
Pulling image testcontainers/ryuk:0.8.1
Container started: 22ffa2ac108b
Waiting for container <Container: 22ffa2ac108b> with image testcontainers/ryuk:0.8.1 to be ready ...
Pulling image atmoz/sftp:alpine
Container started: a51c685e2d50
Hello World
Runtime environment
Provide a summary of your runtime environment. Which operating system, python version, and docker version are you using? What is the version of testcontainers-python you are using? You can run the following commands to get the relevant information.
# Get the operating system information (on a unix os).
$ uname -a
Linux aoudad 6.8.0-60-generic #63~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 22 19:00:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
# Get the python version.
$ python --version
Python 3.12.2
# Get the docker version and other docker information.
$ docker info
Client: Docker Engine - Community
Version: 28.1.1
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.23.0
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.35.1
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 4
Running: 0
Paused: 0
Stopped: 4
Images: 10
Server Version: 28.1.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: runc io.containerd.runc.v2
Default Runtime: runc
Init Binary: docker-init
containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
runc version:
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.8.0-60-generic
Operating System: Ubuntu Core 22
OSType: linux
Architecture: x86_64
CPUs: 16
Total Memory: 30.18GiB
Name: aoudad
ID: f82c9622-c54f-491c-b224-132a4c383cd9
Docker Root Dir: /var/snap/docker/common/var-lib-docker
Debug Mode: false
Experimental: false
Insecure Registries:
::1/128
127.0.0.0/8
Live Restore Enabled: false
# Get all python packages.
$ pip freeze
asttokens==3.0.0
certifi==2025.4.26
cffi==1.17.1
charset-normalizer==3.4.2
comm==0.2.2
cryptography==45.0.3
debugpy==1.8.14
decorator==5.2.1
docker==7.1.0
executing==2.2.0
idna==3.10
ipykernel==6.29.5
ipython==9.3.0
ipython_pygments_lexers==1.1.1
jedi==0.19.2
jupyter_client==8.6.3
jupyter_core==5.8.1
matplotlib-inline==0.1.7
nest-asyncio==1.6.0
packaging==25.0
parso==0.8.4
pexpect==4.9.0
platformdirs==4.3.8
prompt_toolkit==3.0.51
psutil==7.0.0
ptyprocess==0.7.0
pure_eval==0.2.3
pycparser==2.22
Pygments==2.19.1
python-dateutil==2.9.0.post0
python-dotenv==1.1.0
pyzmq==26.4.0
requests==2.32.3
six==1.17.0
stack-data==0.6.3
testcontainers==4.10.0
tornado==6.5.1
traitlets==5.14.3
typing_extensions==4.14.0
urllib3==2.4.0
wcwidth==0.2.13
wrapt==1.17.2
- 主要語言
- Python
- 星號
- 2.3k
- 分支
- 390
- 平均合併
- 11 天 16 小時
- 30 天內合併 PR
- 2
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
testcontainers/testcontainers-python 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 67/100
testcontainers/testcontainers-python#1086 · 1 則留言 ·
維護者通常 12 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
testcontainers/testcontainers-python#578 · 5 則留言 ·
維護者通常 12 天內回覆
-
Bug: `Reaper.delete_instance()` raises 409 and keeps the dead reaper when ryuk was killed from outside可能已有人在做 @RitiGrover 於 14 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 76/100
testcontainers/testcontainers-python#1125 ·
維護者通常 12 天內回覆
-
Bug: MongoDB container is reported ready before the server accepts connections可能已有人在做 @RitiGrover 於 18 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 65/100
testcontainers/testcontainers-python#1122 ·
維護者通常 12 天內回覆
-
Bug: Reaper reports success while the session filter never reaches Ryuk (silent leak on Linux/docker-proxy)可能已有人在做 @RitiGrover 於 18 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 68/100
testcontainers/testcontainers-python#1114 · 1 則留言 ·
維護者通常 12 天內回覆
查看 testcontainers/testcontainers-python 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
KalicoCrew/kalico#1012 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 82/100
esphome/esphome.io#7657 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
VNG-Realisatie/gemma-zaken#2658 ·
-
難度 1/5 1 小時以內 新手友好度 75/100
維護者通常 1 天內回覆
-
comp/gateway comp/plugins duplicate P3 type/bug
難度 2/5 1-3 小時 新手友好度 82/100
NousResearch/hermes-agent#137019 ·
維護者通常 1 天內回覆