job failed / cannot assign requested address (nomad error, doesn't appear to be a docker error?)

813 views
Skip to first unread message

Jay Christopherson

unread,
Nov 17, 2016, 3:35:42 PM11/17/16
to Nomad
I'm trying to launch a simple "hello-world" style job, but there seems to be a problem with the job submission - the job fails with this error:

ID                 = 5a58e4da
Eval ID            = e9c3f525
Name               = hello.servers[1]
Node ID            = 91e8b203
Job ID             = hello
Client Status      = failed
Client Description = <none>
Created At         = 11/17/16 12:04:37 PST

Task "hello" is "dead"
Task Resources
CPU      Memory   Disk  IOPS  Addresses
500 MHz  256 MiB  0 B   0     http: 192.168.56.103:11080

Recent Events:
Time                   Type            Description
11/17/16 12:04:38 PST  Not Restarting  Error was unrecoverable
11/17/16 12:04:38 PST  Driver Failure  failed to start task 'hello' for alloc '5a58e4da-d7a6-9512-1dbc-d944ffd2b54c': Failed to start container f19d1e34872d9368d7556d7d01e642072b6500b080d8f22a33e56976fd05b67a: API error (500): {"message":"driver failed programming external connectivity on endpoint hello-5a58e4da-d7a6-9512-1dbc-d944ffd2b54c (2431f2a6bc1b91b1ac0bf13ea9ed3665df879b3a17308f7cfcd171c20c025529): Error starting userland proxy: listen tcp 192.168.56.103:11080: bind: cannot assign requested address"}
11/17/16 12:04:37 PST  Received        Task received by client
the problem is, that no such address"192.168.56.103" exists anywhere on the system it's attempting to deploy to.  I thought maybe this was a Docker issue, but I was able to submit my job via Docker API (docker run...) with no issues.

Here's my job:

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

  type = "service"

  constraint {
    distinct_hosts = true
  }

  update {
    stagger = "30s"
    max_parallel = 1
  }

  group "servers" {
    count = 2

    task "hello" {
      driver = "docker"

      config {
        image = "tutum/hello-world:latest"
        port_map = {
          http = 80
        }
      }

      service {
        name = "hello-test"
        tags = ["urlprefix-hello.test/"]
        port = "http"
        check {
          type = "http"
          path = "/"
          interval = "10s"
          timeout = "4s"
        }
      }

      resources {
        cpu = 500
        memory = 256
        network {
          mbits = 10
          port "http" {
            static = 11080
          }
        }
      }
    }
  }

}


Any ideas as to what is going on here?  I don't see an obvious issue.  Running "Nomad v0.5.0-rc1".


Jay Christopherson

unread,
Nov 17, 2016, 4:22:35 PM11/17/16
to Nomad
OK - it looks like Vagrant assigned two IP's to eth1.  Nomad server/client are bound to a specific IP (bind_addr), but Nomad jobs that are submitted appear to be getting assigned the other IP.

Is there a way to force a Nomad-launched to use a specific interface/ip?  Like, I want it to port bind to address A and not address B.  I know the *range* for address A, but being Nomad, the actual client IP will by dynamic since it'll pick a node on deploy.

Jay Christopherson

unread,
Nov 17, 2016, 5:14:17 PM11/17/16
to Nomad
Even when eth1 only contains *one* IP (172.17.8.XXX in this case), "nomad run..." still seems to try to assign the port map to "192.168.56.XXX", even though the address does not physically exist.

Alex Dadgar

unread,
Nov 17, 2016, 6:13:55 PM11/17/16
to Jay Christopherson, Nomad
Hey Jay,

Please specify the network_interface you want Nomad to use in the client configuration: https://www.nomadproject.io/docs/agent/configuration/client.html#network_interface

Thanks,
Alex

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/nomad/issues
IRC: #nomad-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Nomad" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nomad-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nomad-tool/65102cb2-bf7a-4e07-838a-c42580db2abb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jay Christopherson

unread,
Nov 17, 2016, 6:25:52 PM11/17/16
to Nomad
What if the network interface contains two IP's (as is happening here)?  This might be a Vagrant issue, rather than a Nomad issue I guess as the interface in question (eth1, which is a hostonlyif) should only have one IP assigned to it.  But it appears to be getting a dynamic IP, in addition to the static IP I defined in the Vagrantfile.  So I'm asking over on the Vagrant group about it.
To unsubscribe from this group and stop receiving emails from it, send an email to nomad-tool+...@googlegroups.com.

Alex Dadgar

unread,
Nov 17, 2016, 6:43:14 PM11/17/16
to Jay Christopherson, Nomad
Hey,

If you are just playing with Nomad, try the Vagrantfile we have in the repo. Nomad currently does not support multiple IPs per interface. It will just pick one.

Thanks,
Alex

To unsubscribe from this group and stop receiving emails from it, send an email to nomad-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nomad-tool/304ce942-f09f-4b6e-8dea-6ac58ec5fd48%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages