Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Bug: Running `.exec` on `SqlServerContainer` instance hangs indefinitely

未關閉
#910 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
42/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
docker, python, sql
領域
databases, devops

研究方向

從 SqlServerContainer 的 exec 進入點開始,重現 issue 中完全相同的 sqlcmd CREATE TABLE 命令,並將其與可正常運作的 SELECT 1 範例進行比較。當 CREATE TABLE 命令透過 exec 正常結束,就算完成,這與在容器內部執行時的情況相同。

由索引模型根據 Issue 內容生成。

描述

Describe the bug

I am trying to create a table within a SqlServer container during start up. I am running the necessary command via the exec method, but said method just hangs and never exits.

Additional info: When bashing into the container and running the command, it works just fine and the process does not hang. Furthermore, running a different SQL query via the exec method such as SELECT 1 works as well.

To Reproduce

with SqlServerContainer(image="mcr.microsoft.com/mssql/server:2022-CU12-ubuntu-22.04") as container:
   container.exec(
      "/opt/mssql-tools/bin/sqlcmd -U SA -P 1Secure*Password1 -d tempdb -Q 'CREATE TABLE test_table (id INT PRIMARY KEY)'"
   )

Runtime environment

OS: Windows 11
Python version: 3.12.10
Docker version: 28.4.0, build d8eb465
Testcontainers version: 4.13.2

主要語言
Python
星號
2.3k
分支
389
平均合併
4 小時 40 分鐘
30 天內合併 PR
1

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

testcontainers/testcontainers-python 的其他 Issue

查看 testcontainers/testcontainers-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。