When I run up a nomad job with the job file “example.nomad” created by nomad job init
, the below error showed up
Error getting job struct: Error getting jobfile from "example.nomad": source path must be a file
The completed commands are:
nomad job init # example.nomad is created
nomad job run example.nomad # error pops up
This issue stuck me for a while as I clearly remember that I successfully ran it up before. And these are very basic commands to play with Nomad set up.
The cause of the issue is that the job file example.nomad
is created under a path with the symbol #
. For example, “~/nomad/#101-test/example.nomad”.
If the command nomad job init
is executed under a different path without #
. The job file can be successfully ran up.
If this post helped you to solve a problem or provided you with new insights, please upvote it and share your experience in the comments below. Your comments can help others who may be facing similar challenges. Thank you!