Docker Python SDK .- Killed by Signal 15

Hello,

I’m currently playing around with the docker SDK for python and I’m running into an issue where I’m getting some additional, unexpected output from a basic python script using the docker library.

Sample output -

[user@localhost dir]$ poetry run python main.py
Killed by signal 15.
Killed by signal 15.
{'Platform': {'Name': 'Docker Engine - Community'},...

The code I’m using is pretty simple -

import docker

ssh_string = "ssh://user@remote-host.domain"

client = docker.DockerClient(base_url=ssh_string,use_ssh_client=True, version='auto')
print(client.version())

I still get the expected output from client.version(), I’m just not sure where the killed by signal 15 is coming from. It seems to be coming from localhost and it’s not an error/exception as I’ve modified the script to use a try/catch and there’s no exception to print.

Does anyone know where this is coming from and if there is any way to suppress this output?

In terms of configuration - remote-host is configured for sudoless docker access (can access the daemon without sudo since it’s part of the docker group)

The host I am on - (localhost), has it’s ssh key passed to the remote-host for password-less login

I’m using poetry for my dependency management and pyenv with python 3.12.1

Only libraries I’ve added are paramiko and docker

Any input or advice would be appreciated

ChatGPT says “Signal 15” is SIGTERM.

What’s your environment, is enough RAM available? Monitor it with htop in parallel during start.

As Google :slight_smile: Just in case someone prefer that. I thought I replied here yesterday, but now because of the new post I found it again.

I don’t know the answer, but I found on Google yesterday that it is probably related to SSH. I tried to search for specific issues like “paramiko killed by signal 15” or the same with SSH and python, but I couldn’t find anything that really helps.

I would probably try to run the same command without the SDK, just using the docker cli and the an SSH context. You could also check timeouts, because I saw references to timeouts. It is possible that something indeed times out and you get a json but not the full version. If that is the case, the docker cli would give you a more obvious error message.

I actually forgot you could do that so I went and created a context via the following commands:

docker context create remote-host --docker host=ssh://user@remote-host.domain

Then I switched context and I’m able to execute arbitrary docker commands (ps, containers, logs) and there’s no ssh timeouts or SIGTERM signals being generated anywhere from what I can see.

I also checked the systemd logs and dmesg and ya, nada.

Thanks for the input, I forgot about contexts lol

I’m curious to see if this is just some weird issue with the machine so I might give it a try on another machine.

Tried the same script on a different machine, however this was on WSL with python 3.10.2 so different OS (ubuntu vs centos in the original OP) and a different version of python.

Anyways, it’s not the biggest deal because this was just one of several dev machines I have so I can just continue on with a different machine.

You mean you don’t see the signal lines on the other machine?

Opps I forgot to include that bit.

Ya, there’s no Killed by Signal 15 in the output

Snippet -

user@local-host-2:dir$ poetry run python main/main.py
{'Platform': {'Name': 'Docker Engine - Community'},....
user@local-host-2:dir$