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

Invalid job file passes validation (w/ example) #642

Closed
sheerun opened this issue Jan 3, 2016 · 4 comments
Closed

Invalid job file passes validation (w/ example) #642

sheerun opened this issue Jan 3, 2016 · 4 comments

Comments

@sheerun
Copy link
Contributor

sheerun commented Jan 3, 2016

Hey,

I'm trying to run one-off task on nomad, but it keeps restarting over and over again.. Also the status is "failed" even return code from shell command is 0. How to schedule one-off shell job? My job description:

job "example" {
    datacenters = ["parallels"]

    group "shell" {
        task "ls" {
      type = "batch"

      driver = "raw_exec"

      config {
        command = "/bin/date"
      }

      resources {
        cpu = 250
        memory = 128
      }
    }
  }
}
nomad alloc-status d16257ae-8009-d31c-857f-cf6e192bb675
ID                = d16257ae-8009-d31c-857f-cf6e192bb675
EvalID            = 350b78e1-e25c-3fbb-1fe4-f8ae7d05e825
Name              = example.shell[0]
NodeID            = 5867e0a9-9b30-7bae-8e75-58116c1a0890
JobID             = example
ClientStatus      = running
NodesEvaluated    = 1
NodesFiltered     = 0
NodesExhausted    = 0
AllocationTime    = 75.475µs
CoalescedFailures = 0

==> Task "ls" is "pending"
Recent Events:
Time               Type        Description
04:49:20 01/03/16  Terminated  Exit Code: 0
04:49:20 01/03/16  Started     <none>
04:49:05 01/03/16  Terminated  Exit Code: 0
04:49:05 01/03/16  Started     <none>

==> Status
Allocation "d16257ae-8009-d31c-857f-cf6e192bb675" status "running" (0/1 nodes filtered)
  * Score "5867e0a9-9b30-7bae-8e75-58116c1a0890.binpack" = 3.522951
    2016/01/03 03:51:20 [INFO] client: Restarting Task: ls
    2016/01/03 03:51:20 [DEBUG] client: Sleeping for 15s before restarting Task ls
    2016/01/03 03:51:20 [DEBUG] client: updated allocations at index 488 (5 allocs)
    2016/01/03 03:51:20 [DEBUG] client: allocs: (added 0) (removed 0) (updated 5) (ignore 0)
    2016/01/03 03:51:20 [ERR] client: dropping update to alloc '4b8a0f98-1514-4581-1407-980cf0449f06'
    2016/01/03 03:51:20 [ERR] client: dropping update to alloc '60cb45be-0ec6-bd20-a5db-cd72b9a92676'
    2016/01/03 03:51:20 [ERR] client: dropping update to alloc '17f00d2f-78c4-f275-a61a-63a027b27081'
    2016/01/03 03:51:20 [ERR] client: dropping update to alloc '15268bbf-3df3-c3db-7e4d-07354231e9ea'
    2016/01/03 03:51:20 [DEBUG] client: updated allocations at index 489 (5 allocs)
    2016/01/03 03:51:20 [DEBUG] client: allocs: (added 0) (removed 0) (updated 5) (ignore 0)
    2016/01/03 03:51:20 [ERR] client: dropping update to alloc '17f00d2f-78c4-f275-a61a-63a027b27081'
    2016/01/03 03:51:20 [ERR] client: dropping update to alloc '15268bbf-3df3-c3db-7e4d-07354231e9ea'
    2016/01/03 03:51:20 [ERR] client: dropping update to alloc '4b8a0f98-1514-4581-1407-980cf0449f06'
    2016/01/03 03:51:20 [ERR] client: dropping update to alloc '60cb45be-0ec6-bd20-a5db-cd72b9a92676'
    2016/01/03 03:51:35 [INFO] client: completed task 'ls' for alloc 'd16257ae-8009-d31c-857f-cf6e192bb675'
    2016/01/03 03:51:35 [INFO] client: Restarting Task: ls
    2016/01/03 03:51:35 [DEBUG] client: Sleeping for 29.977831766s before restarting Task ls
    2016/01/03 03:51:35 [DEBUG] client: updated allocations at index 490 (5 allocs)
    2016/01/03 03:51:35 [DEBUG] client: allocs: (added 0) (removed 0) (updated 5) (ignore 0)
    2016/01/03 03:51:35 [ERR] client: dropping update to alloc '17f00d2f-78c4-f275-a61a-63a027b27081'
    2016/01/03 03:51:35 [ERR] client: dropping update to alloc '15268bbf-3df3-c3db-7e4d-07354231e9ea'
    2016/01/03 03:51:35 [ERR] client: dropping update to alloc '4b8a0f98-1514-4581-1407-980cf0449f06'
    2016/01/03 03:51:35 [ERR] client: dropping update to alloc '60cb45be-0ec6-bd20-a5db-cd72b9a92676'
    2016/01/03 03:51:35 [DEBUG] client: updated allocations at index 491 (5 allocs)
    2016/01/03 03:51:35 [DEBUG] client: allocs: (added 0) (removed 0) (updated 5) (ignore 0)
    2016/01/03 03:51:35 [ERR] client: dropping update to alloc '17f00d2f-78c4-f275-a61a-63a027b27081'
    2016/01/03 03:51:35 [ERR] client: dropping update to alloc '15268bbf-3df3-c3db-7e4d-07354231e9ea'
    2016/01/03 03:51:35 [ERR] client: dropping update to alloc '4b8a0f98-1514-4581-1407-980cf0449f06'
    2016/01/03 03:51:35 [ERR] client: dropping update to alloc '60cb45be-0ec6-bd20-a5db-cd72b9a92676'
@sheerun
Copy link
Contributor Author

sheerun commented Jan 3, 2016

Hmm. I think it's because type = "batch" belongs to job, not group.

Why nomad doesn't validate key names?

@dadgar
Copy link
Contributor

dadgar commented Jan 4, 2016

Hey @sheerun. You are right the type belongs at the top. This is an invalid job file and it should have a validation error. I am going to keep this issue open till this job file fails validation.

As for running a job one-off. batch is the correct way.

@dadgar dadgar changed the title How to run one-off tasks? Invalid job file passes validation (w/ example) Jan 4, 2016
@dadgar
Copy link
Contributor

dadgar commented Mar 22, 2016

#900 fixes this

@dadgar dadgar closed this as completed Mar 22, 2016
@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 Dec 25, 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

2 participants