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

port label not found error in case when ports are not needed #3673

Closed
pznamensky opened this issue Dec 19, 2017 · 7 comments
Closed

port label not found error in case when ports are not needed #3673

pznamensky opened this issue Dec 19, 2017 · 7 comments

Comments

@pznamensky
Copy link

Nomad version

Nomad v0.7.1-rc1 (b81a2b6)

Issue

Some of our jobs are don't bind any ports.
But with the latest version we started to get error:

unable to get address for service "job_name": invalid port "": port label not found

It seems that all work fine before this PR: #3619

Job file (if appropriate)

job "test-job" {
  datacenters = ["staging"]
  type = "service"

  update {
    max_parallel = 1
    min_healthy_time = "10s"
    healthy_deadline = "3m"
  }

  group "test-job" {
    count = 1
    restart {
      attempts = 10
      interval = "5m"
      delay = "20s"
      mode = "delay"
    }

    task "test-job" {
      driver = "docker"
      user = "test-user"
      config {
        image = "test-image"
        force_pull = true
        network_mode = "host"
      }

      env {
        APP_ENV = "staging"
      }

      resources {
        cpu    = 500
        memory = 128
      }

      service {
        name = "test-job"
        tags = ["test-job", "staging"]
      }
    }
  }
}
@chelseakomlo
Copy link
Contributor

Thanks for reporting this issue, and the PR that seems to introduce this break. Do you also have a jobspec where you do not see this error?

@dadgar
Copy link
Contributor

dadgar commented Dec 19, 2017

@pznamensky Why are you registering a service without specifying its port? The service stanza requires a port to be specified as documented here: https://www.nomadproject.io/docs/job-specification/service.html#port.

So if anything the bug is that we did not catch the invalid stanza on job submit

@pznamensky
Copy link
Author

Oops, I missed it.
Nevertheless, I think that it would be fine to register task without a port.
In our case we have some apps that just get some data from db/storage/mq then process it and put it back to db/storage/mq.
We're monitoring those apps using statistics which were sent to statsd and count of services which were registered in consul.
It's not usual case even for us, but it works fine.

@schmichael
Copy link
Member

Hi @pznamensky! I'm responsible for that validation change in #3619

We never intended to allow jobs to register services without a port, so that PR added validation to prevent it.

However after hearing your use case (and discussing some other potential uses I'm sure others' are using), we've decided to allow services without ports. I'll get a PR up ASAP and it will be included in 0.7.1 final.

@pznamensky
Copy link
Author

Thank you!

@schmichael
Copy link
Member

@pznamensky thanks for testing the rc and making 0.7.1 better! We really appreciate it!

@github-actions
Copy link

github-actions bot commented Dec 5, 2022

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 Dec 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants