Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value specified in CPUWeight is out of range: unknown #12266

Closed
denogio opened this issue Mar 11, 2022 · 4 comments
Closed

Value specified in CPUWeight is out of range: unknown #12266

denogio opened this issue Mar 11, 2022 · 4 comments
Labels

Comments

@denogio
Copy link

denogio commented Mar 11, 2022

Nomad version

Nomad v1.2.6 (a6c6b47)

Operating system and Environment details

Ubuntu 22.04 Jammy Jellyfish

Issue

When running a docker job with CPU resources set the allocation fails with an API error

Reproduction steps

Define job with docker as task driver and resources { cpu = 1 } set

Expected Result

The docker container will be allocated 1 CPU

Actual Result

The allocation fails.

Job file (if appropriate)

job "whoami" {
datacenters = ["dc1"]

group "demo" {
count = 2

network {
  port  "http"{
    to = -1
  }
}

service {
  name = "whoami"
  port = "http"

  tags = [
        "traefik.enable=true",
        "traefik.http.routers.whoami.rule=Host(`test2.nomad.cluster.local`)",
        "traefik.http.routers.whoami.entrypoints=https",
        "traefik.http.routers.whoami.tls=true"
  ]

  check {
    type     = "http"
    path     = "/"
    interval = "2s"
    timeout  = "2s"
  }
}

task "server" {
  env {
    PORT    = "${NOMAD_PORT_http}"
    NODE_IP = "${NOMAD_IP_http}"
  }

  resources {
    cpu    = 1
    memory = 1024
  }

  driver = "docker"

  config {
    image = "hashicorp/demo-webapp-lb-guide"
    ports = ["http"]
  }
}

}
}

Nomad Client logs (if appropriate)

Mar 11 11:40:54 nomad-client03 nomad[60435]:     2022-03-11T11:40:54.264Z [ERROR] client.driver_mgr.docker: failed to start container: driver=docker container_id=6cbeea5659fbf70443b94b863854df99e1cc90662d29cf33c2c4a4c022f1943a error="API error (500): failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: error while setting unit properties: Value specified in CPUWeight is out of range: unknown"
@denogio
Copy link
Author

denogio commented Mar 11, 2022

My bad. settin cpu to 1 is not a good idea

@tgross
Copy link
Member

tgross commented Mar 11, 2022

Hi @dhpowrhost! Yeah the minimum value was set to 1 in #8996 but whether a given task driver can handle that is up to the third-party engine (Docker in this case), which we don't currently have a way of validating.

@denogio
Copy link
Author

denogio commented Mar 14, 2022

Yeah, you are right. The thing is however that it did work in Debian 11 and Ubuntu 20.04, so docker must have changed something. Thank you for the clairification.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Development

No branches or pull requests

2 participants