faas-containerd icon indicating copy to clipboard operation
faas-containerd copied to clipboard

Containers with stopped tasks cannot be scaled up

Open carlosedp opened this issue 5 years ago • 1 comments

If a container has it's task as "STOPPED", scaling it back generates an error and the task does not run.

Expected Behaviour

Have the task in RUNNING state.

Current Behaviour

Show function and it's container and task:

❯ faas-cli list
Function                      	Invocations    	Replicas
figlet1                       	0              	0

❯ sudo ctr -n openfaas-fn container ls
CONTAINER    IMAGE                                RUNTIME
figlet1      docker.io/functions/figlet:0.13.0    io.containerd.runc.v2

❯ sudo ctr -n openfaas-fn task ls
TASK       PID     STATUS
figlet1    6760    STOPPED

Try to scale it back to 1 replica:

❯ curl http://127.0.0.1:8081/system/scale-function/figlet1 -d '{"serviceName":"figlet1", "replicas": 1}'
cannot scale task for figlet1, error: cannot resume a stopped container: unknown

Generates error:

Jan 17 16:32:51 debian10 faas-containerd[6669]: 2020/01/17 16:32:51 Resolve: "figlet1"
Jan 17 16:32:51 debian10 faas-containerd[6669]: 2020/01/17 16:32:51 error with proxy request to: http://:8080, Post http://:8080: dial tcp :8080: connect: connection refused
Jan 17 16:32:56 debian10 faas-containerd[6669]: 2020/01/17 16:32:56 [Scale] request: {"serviceName":"figlet1", "replicas": 1}
Jan 17 16:32:56 debian10 faas-containerd[6669]: 2020/01/17 16:32:56 [Scale] cannot scale task for figlet1, error: cannot resume a stopped container: unknown

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

  • OS and architecture:

Latest built from persistence branch.

  • Versions:
go version

containerd -version

uname -a

cat /etc/os-release

carlosedp avatar Jan 17 '20 21:01 carlosedp

Fixed - please retest with latest versions

alexellis avatar Jan 20 '20 10:01 alexellis