No allocations for system job

Hi,

I’m trying to figure out why a job I’m deploying (using the system scheduler) is never placed. The job status is running but queued, starting, running, complete, failed and lost are all 0 in the web ui. Allocation failures is also false. Here’s the output of job inspect:

{
    "Job": {
        "Affinities": null,
        "AllAtOnce": false,
        "Constraints": [
            {
                "LTarget": "${meta.roles}",
                "Operand": "set_contains",
                "RTarget": "nats_server"
            }
        ],
        "ConsulToken": "",
        "CreateIndex": 147723,
        "Datacenters": [
            "dc1"
        ],
        "Dispatched": false,
        "ID": "nats",
        "JobModifyIndex": 147723,
        "Meta": null,
        "Migrate": null,
        "ModifyIndex": 147723,
        "Multiregion": null,
        "Name": "nats",
        "Namespace": "default",
        "NomadTokenID": "5b82aa6a-d368-3ea4-8e3f-570e659cdbb5",
        "ParameterizedJob": null,
        "ParentID": "",
        "Payload": null,
        "Periodic": null,
        "Priority": 50,
        "Region": "global",
        "Reschedule": null,
        "Spreads": null,
        "Stable": false,
        "Status": "running",
        "StatusDescription": "",
        "Stop": false,
        "SubmitTime": 1622215647462767478,
        "TaskGroups": [
            {
                "Affinities": null,
                "Constraints": null,
                "Count": 1,
                "EphemeralDisk": {
                    "Migrate": false,
                    "SizeMB": 300,
                    "Sticky": false
                },
                "Meta": null,
                "Migrate": null,
                "Name": "nats",
                "Networks": [
                    {
                        "CIDR": "",
                        "DNS": null,
                        "Device": "",
                        "DynamicPorts": null,
                        "IP": "",
                        "MBits": 0,
                        "Mode": "",
                        "ReservedPorts": [
                            {
                                "HostNetwork": "default",
                                "Label": "https",
                                "To": 0,
                                "Value": 443
                            },
                            {
                                "HostNetwork": "private",
                                "Label": "routing",
                                "To": 0,
                                "Value": 6222
                            }
                        ]
                    }
                ],
                "ReschedulePolicy": null,
                "RestartPolicy": {
                    "Attempts": 2,
                    "Delay": 15000000000,
                    "Interval": 1800000000000,
                    "Mode": "fail"
                },
                "Scaling": null,
                "Services": [
                    {
                        "AddressMode": "auto",
                        "CanaryMeta": null,
                        "CanaryTags": null,
                        "CheckRestart": null,
                        "Checks": [
                            {
                                "AddressMode": "",
                                "Args": null,
                                "CheckRestart": null,
                                "Command": "",
                                "Expose": false,
                                "FailuresBeforeCritical": 0,
                                "GRPCService": "",
                                "GRPCUseTLS": false,
                                "Header": null,
                                "Id": "",
                                "InitialStatus": "",
                                "Interval": 10000000000,
                                "Method": "",
                                "Name": "alive",
                                "Path": "",
                                "PortLabel": "https",
                                "Protocol": "",
                                "SuccessBeforePassing": 0,
                                "TLSSkipVerify": false,
                                "TaskName": "",
                                "Timeout": 2000000000,
                                "Type": "tcp"
                            }
                        ],
                        "Connect": null,
                        "EnableTagOverride": false,
                        "Id": "",
                        "Meta": null,
                        "Name": "nats",
                        "PortLabel": "",
                        "Tags": null,
                        "TaskName": ""
                    }
                ],
                "ShutdownDelay": null,
                "Spreads": null,
                "StopAfterClientDisconnect": null,
                "Tasks": [
                    {
                        "Affinities": null,
                        "Artifacts": null,
                        "Config": {
                            "network_mode": "host",
                            "volumes": [
                                "local:/config"
                            ],
                            "args": [
                                "-c",
                                "/config/nats-server.conf"
                            ],
                            "image": "nats:2.2"
                        },
                        "Constraints": null,
                        "DispatchPayload": null,
                        "Driver": "docker",
                        "Env": null,
                        "KillSignal": "",
                        "KillTimeout": 5000000000,
                        "Kind": "",
                        "Leader": false,
                        "Lifecycle": null,
                        "LogConfig": {
                            "MaxFileSizeMB": 10,
                            "MaxFiles": 10
                        },
                        "Meta": null,
                        "Name": "nats",
                        "Resources": {
                            "CPU": 100,
                            "Devices": null,
                            "DiskMB": 0,
                            "IOPS": 0,
                            "MemoryMB": 128,
                            "Networks": null
                        },
                        "RestartPolicy": {
                            "Attempts": 2,
                            "Delay": 15000000000,
                            "Interval": 1800000000000,
                            "Mode": "fail"
                        },
                        "ScalingPolicies": null,
                        "Services": null,
                        "ShutdownDelay": 0,
                        "Templates": [
                            {
                                "ChangeMode": "restart",
                                "ChangeSignal": "",
                                "DestPath": "local/nats-server.conf",
                                "EmbeddedTmpl": "        cluster {\n          name = \"cluster\"\n          \n          {{ if ne (env \"meta.index\") \"1\" }}\n            routes = [\n              \"nats-route://node-1.nats.service.consul:6222\"\n            ]\n          {{ end }}\n                    port: 6222\n        }\n        websocket {\n          port: 443\n          tls {\n            cert_file: \"/etc/ssl/certs/wildcard.cert\"\n            key_file: \"/etc/ssl/private/wildcard.cert\"\n          }\n        }\n",
                                "Envvars": false,
                                "LeftDelim": "{{",
                                "Perms": "0644",
                                "RightDelim": "}}",
                                "SourcePath": "",
                                "Splay": 5000000000,
                                "VaultGrace": 0
                            }
                        ],
                        "User": "",
                        "Vault": null,
                        "VolumeMounts": [
                            {
                                "Destination": "/etc/ssl",
                                "PropagationMode": "private",
                                "ReadOnly": true,
                                "Volume": "ssl"
                            }
                        ]
                    }
                ],
                "Update": null,
                "Volumes": {
                    "ssl": {
                        "MountOptions": null,
                        "Name": "ssl",
                        "ReadOnly": true,
                        "Source": "ssl",
                        "Type": "host"
                    }
                }
            }
        ],
        "Type": "system",
        "Update": {
            "AutoPromote": false,
            "AutoRevert": false,
            "Canary": 0,
            "HealthCheck": "",
            "HealthyDeadline": 0,
            "MaxParallel": 0,
            "MinHealthyTime": 0,
            "ProgressDeadline": 0,
            "Stagger": 0
        },
        "VaultNamespace": "",
        "VaultToken": "",
        "Version": 0
    }
}

and node status of one of the nodes this job should be placed on:

ID              = c0021ba1-67eb-e1e5-1d7d-2ee949fb9b38
Name            = nats-server-1
Class           = <none>
DC              = dc1
Drain           = false
Eligibility     = eligible
Status          = ready
CSI Controllers = <none>
CSI Drivers     = <none>
Uptime          = 1h49m53s
Host Volumes    = ssl
CSI Volumes     = <none>
Driver Status   = docker,exec

Node Events
Time                       Subsystem       Message
2021-05-28T16:56:39+02:00  Driver: docker  Healthy
2021-05-28T16:32:26+02:00  Cluster         Node registered

Allocated Resources
CPU         Memory       Disk
0/2095 MHz  0 B/1.9 GiB  0 B/16 GiB

Allocation Resource Utilization
CPU         Memory
0/2095 MHz  0 B/1.9 GiB

Host Resource Utilization
CPU          Memory           Disk
61/2095 MHz  192 MiB/1.9 GiB  2.6 GiB/19 GiB

Allocations
No allocations placed

Hi @repomaa,

My initial thought is that the job constraint is impacting the placement of the expected allocations, however, with the current information I cannot be sure. Is it possible to provide the node status output using the verbose flag like nomad node status -verbose <node_id>? This will output additional information including the nodes meta parameters which should help identify the issue.

Thanks,
jrasell and the Nomad team