Sorry you’re hitting this error. This Getting Started guide is pretty new, so we might not have ironed out all the kinks yet.
The easier way to debug something like this is probably by using the Nomad UI. I would pop open the Job page in the UI and see if there are any errors that might be helpful.
Since I see that you have a desired count of 1 and a placed count of 0, that means that Nomad can’t find a place to put the task. If you have an error that says something like “Placement Failures” that might give you more info. Some common reasons would be if you don’t have the required task driver, or you dont have enough space on your computer, or you’ve specified some constraint like that it must be run on Linux.
What I’m guessing may have happened is that you don’t have docker running on your mac. If you see an error like “Constraint missing drivers filtered 1 node”, then that’s what happened. If you just start Docker Desktop, then it should fix itself. If that’s the case, we definitely need to specify that in the guide!!
If not, let me know if you see any other errors, and I can help debug.
Hey hey, thanks for trying out the tutorial! Apologies that it’s not working for you at the moment but we’ll help figure it out!
I think @mnomitch’s advice is right on track as I was able to replicate your issue if I quit Docker Desktop and run the tutorial.
In addition to checking out the Job information in the UI, you can also click on the Clients page from the left navigation, click on the one client (your mac), and scroll down to the Driver Status section. If the docker driver isn’t showing as detected (see screenshot), that will confirm it - start Docker Desktop and you should be good to go!
Not familiar with Rancher Desktop but from after some googling, it looks like it gives you the option to choose the container runtime, containerd or dockerd, and I’m assuming it uses containerd by default.
Can you check your config and switch to dockerd? Then close down your Nomad cluster, restart Rancher, and your Nomad cluster and see if the client page shows the docker driver then.
Not sure exactly how the inner workings of Nomad operate but if the docker command isn’t available when it starts, I imagine the driver won’t be detected. I think switching to the dockerd engine in Rancher might help.
Using containerd or dockerd did not work either. I will look into this harder
Once again, thanks for all your help.
Output:
▶ nomad job run pytechco-redis.nomad.hcl
==> 2023-04-14T17:33:53-04:00: Monitoring evaluation "e6419bce"
2023-04-14T17:33:53-04:00: Evaluation triggered by job "pytechco-redis"
2023-04-14T17:33:54-04:00: Evaluation within deployment: "f0c50e0c"
2023-04-14T17:33:54-04:00: Evaluation status changed: "pending" -> "complete"
==> 2023-04-14T17:33:54-04:00: Evaluation "e6419bce" finished with status "complete" but failed to place all allocations:
2023-04-14T17:33:54-04:00: Task Group "ptc-redis" (failed to place 1 allocation):
* Constraint "missing drivers": 1 nodes excluded by filter
2023-04-14T17:33:54-04:00: Evaluation "15fd9887" waiting for additional capacity to place remainder
==> 2023-04-14T17:33:54-04:00: Monitoring deployment "f0c50e0c"
⠴ Deployment "f0c50e0c" in progress...
2023-04-14T17:33:54-04:00
ID = f0c50e0c
Job ID = pytechco-redis
Job Version = 0
Status = running
Description = Deployment is running
Deployed
Task Group Desired Placed Healthy Unhealthy Progress Deadline
ptc-redis 1 0 0 0 N/A
I did a quick test installing Rancher Desktop. Based on a standard installation, you have to set the DOCKER_HOST environment variable before launching Nomad for the docker driver to be detected.
Thanks Ranjandas, it appears it worked, but I got different error. I haven’t Googled it yet, but if you know this error, I appreciate if you could share the resolution on that.
Failed due to progress deadline
▶ nomad job run pytechco-redis.nomad.hcl
==> 2023-10-15T11:03:06-04:00: Monitoring evaluation "8a198bd0"
2023-10-15T11:03:06-04:00: Evaluation triggered by job "pytechco-redis"
2023-10-15T11:03:07-04:00: Evaluation within deployment: "f9ca2ad8"
2023-10-15T11:03:07-04:00: Allocation "52f4ab7c" created: node "3a1b0ef5", group "ptc-redis"
2023-10-15T11:03:07-04:00: Evaluation status changed: "pending" -> "complete"
==> 2023-10-15T11:03:07-04:00: Evaluation "8a198bd0" finished with status "complete"
==> 2023-10-15T11:03:07-04:00: Monitoring deployment "f9ca2ad8"
! Deployment "f9ca2ad8" failed
2023-10-15T11:13:06-04:00
ID = f9ca2ad8
Job ID = pytechco-redis
Job Version = 0
Status = failed
Description = Failed due to progress deadline
Deployed
Task Group Desired Placed Healthy Unhealthy Progress Deadline
ptc-redis 1 3 0 2 2023-10-15T11:13:06-04:00
I had a discussion in the rancher-desktop slack channel and have got a confirmation that explicitly port-mapping to specific host IPs (except 127.0.0.1) is not supported at the moment.
This would help you complete the tutorial you were trying to follow.
Once the VM is up, you can interact with Nomad and Consul from the host by setting the NOMAD_ADDR and CONSUL_HTTP_ADDR environment variables respectively using CLI, and access the UIs from the browser.
You can also interact with the app hosted on the nomad cluster from the Host.
➜ jobs git:(main) nomad service info ptc-web-svc
Job ID Address Tags Node ID Alloc ID
pytechco-web 192.168.65.15:5000 [] a7a683e5 11b821c6