Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

LXC driver failure: error setting network type configuration: setting config item for the container failed #16

@yum-install-brains

Description

@yum-install-brains

Nomad version

Nomad v0.9.6 (1f8eddf2211d064b150f141c86e30d9fceabec89)

Operating system and Environment details

OS name and verison:

Distributor ID:	Debian
Description:	Debian GNU/Linux 9.9 (stretch)
Release:	9.9
Codename:	stretch

Kerner version:

4.19.0-0.bpo.2-amd64

LXC version

ii  liblxc1                          1:3.1.0+really3.0.4-2          amd64        Linux Containers userspace tools (library)
ii  libpam-cgfs                      1:3.1.0+really3.0.4-2          amd64        PAM module for managing cgroups for LXC
ii  lxc                              1:3.1.0+really3.0.4-2          amd64        Linux Containers userspace tools
ii  lxcfs                            3.0.4-2                        amd64        FUSE based filesystem for LXC

Issue

lxc-driver throws an error: Driver Failure rpc error: code = Unknown desc = error setting network type configuration: setting config item for the container failed

Reproduction steps

  1. Install nomad
curl -O https://releases.hashicorp.com/nomad/0.9.6/nomad_0.9.6_linux_amd64.zip
unzip nomad_0.9.6_linux_amd64.zip
sudo mv nomad /usr/local/bin
rm nomad_0.9.6_linux_amd64.zip
  1. Install lxc driver
sudo apt install -y lxc
sudo mkdir -p /opt/nomad/data/plugins
curl -O https://releases.hashicorp.com/nomad-driver-lxc/0.1.0-rc2/nomad-driver-lxc_0.1.0-rc2_linux_amd64.zip
unzip nomad-driver-lxc_0.1.0-rc2_linux_amd64.zip
sudo mv nomad-driver-lxc /opt/nomad/data/plugins
rm ./nomad-driver-lxc*.zip
  1. Define server.hcl and run sudo nomad agent -config server.hcl
# Increase log verbosity
log_level = "DEBUG"

datacenter = "DC1"

# Setup data dir
data_dir = "/tmp/server1"

# Enable the server
server {
    enabled = true

    # Self-elect, should be 3 or 5 for production
    bootstrap_expect = 1
}
  1. Define client.hcl and run sudo nomad agent -config client.hcl
# Increase log verbosity
log_level = "DEBUG"

datacenter = "DC1"

# Setup data dir
data_dir = "/opt/nomad/data"

# Give the agent a unique name. Defaults to hostname
name = "nomad-agent"

# Enable the client
client {
    enabled = true

    # For demo assume we are talking to server1. For production,
    # this should be like "nomad.service.consul:4647" and a system
    # like Consul used for service discovery.
    servers = ["nomad-server:4647"]
}

# Modify our port to avoid a collision with server1
ports {
    http = 5656
}

plugin "nomad-driver-lxc" {
  config {
    enabled = true
    lxc_path = "/var/lib/lxc"
  }
}
  1. Create job
job "example-lxc" {
  datacenters = ["DC1"]
  type        = "service"

  group "lxc" {
    task "busybox" {
      driver = "lxc"

      config {
        log_level = "trace"
        verbosity = "verbose"
        template  = "/usr/share/lxc/templates/lxc-busybox"
      }

      resources {
        cpu    = 500
        memory = 256
      }
    }
  }
}
  1. Run job
    nomad job run -address nomad-server:4646

And it will fail

ID                     = 3e12b0e1
Eval ID                = a0f6d22d
Name                   = example-lxc.lxc4[0]
Node ID                = 28751cda
Node Name              = nomad-agent
Job ID                 = example-lxc
Job Version            = 824638796448
Client Status          = failed
Client Description     = Failed tasks
Desired Status         = run
Desired Description    = <none>
Created                = 12s ago
Modified               = 8s ago
Reschedule Eligibility = 18s from now

Task "busybox" is "dead"
Task Resources
CPU      Memory   Disk     Addresses
500 MHz  256 MiB  300 MiB

Task Events:
Started At     = N/A
Finished At    = 2019-10-14T15:30:59Z
Total Restarts = 0
Last Restart   = N/A

Recent Events:
Time                       Type            Description
2019-10-14T18:30:59+03:00  Killing         Sent interrupt. Waiting 5s before force killing
2019-10-14T18:30:59+03:00  Not Restarting  Error was unrecoverable
2019-10-14T18:30:59+03:00  Driver Failure  rpc error: code = Unknown desc = error setting network type configuration: setting config item for the container failed
2019-10-14T18:30:58+03:00  Task Setup      Building Task Directory
2019-10-14T18:30:58+03:00  Received        Task received by client

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions