Skip to content

Python-based cBots deadlock during creation on Linux Docker (all versions) #12

@Bowen-Guo

Description

@Bowen-Guo

Summary

Any Python-based cBot run via ghcr.io/spotware/ctrader-console on Linux Docker
hangs indefinitely after printing Starting cBot.... The dotnet process stays
alive but never reaches the strategy's OnStartlibpython is never
dlopen'd, the strategy DLL is never loaded, and no per-run log file is
created under data/<strategy>/<guid>/RealTime/.

The same .algo works perfectly with the Windows-bundled ctrader-cli.exe,
so the strategy itself is fine.

Affected versions

Reproduced identically on every published tag tested:

  • latest
  • 5.4 (oldest stable on registry)
  • 5.6.8 (newest stable)
  • 5.7.5-alpha (newest alpha)

Environment

  • Host: Windows 11 with Docker Desktop (Hyper-V backend)
  • Image base: ghcr.io/spotware/ctrader-console:<version> (Debian 11, .NET 6.0.10)
  • Python: 3.12.7, compiled with --enable-shared, available at
    /usr/local/lib/libpython3.12.so.1.0, registered with ldconfig
  • Strategy: Benchmark_example (minimal Python cBot), built locally with
    pythonnet 3.0.5
  • Reproduces with any Python cBot, including a near-empty example.

Reproduction

Container is started with credentials in env vars (CTID, ACCOUNT, SYMBOL,
PERIOD) and a baked-in .algo. Output:

Running cBot with parameters: ...
| Symbol      | XAUUSD  | environment variable |
...
Establishing connection using ...
The connection has been established.
Login to <account>...
Logged in.
Starting cBot...     <-- last line, hangs forever

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions