-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Nomad config validate does not check for missing host_volume directories and daemon fails to start #16968
Comments
Hi @maxadamo! I just verified that the I'm going to mark this for roadmapping but also mark it as a good first issue for community contributions. |
Hi team, I would like to attempt to fix this issue. I just added a PR above 🙏 |
By my eye, that PR ensures that Seems the latter is the desired outcome of the issue, so I'll go ahead and reopen. Can repro with this (partial) config: client {
enabled = true
host_volume "nope" {
path = "/nope" # assuming your system lacks this dir
}
} $ nomad config validate client.hcl
Configuration is valid! but when trying to start the agent: $ nomad agent -config client.hcl
.....
[ERROR] agent: error starting agent: error="client setup failed: node setup failed: failed to validate volume nope, err: stat /nope: no such file or directory" |
Ops, my bad I missed that in the review. @dttung2905 would you be interested in extending the work you did in #17393 to also check if the host volume |
Sure @lgfa29 , please allow me some time to take a look at it again 🙏 |
@lgfa29 , and @dttung2905 for clarity: it's doesn't have to be a directory. It can also be a file. |
Ah interesting, like a symlink to a directory? I don't think I've ever tried that 😄 |
@lgfa29 I just checked my configuration, to ensure that I was remembering correctly. "host_volume": [
{
"cams_bootstrap_ldif_master": {
"path": "/depot/cams/ldif.master",
"read_only": true
},
"cams_bootstrap_ldif_replica": {
"path": "/depot/cams/ldif.replica",
"read_only": true
},
"cams_etc_ldap_master": {
"path": "/depot/cams/etc_ldap.master"
},
"cams_slapd_conf_replica": {
"path": "/depot/cams/etc_ldap.replica/slapd.conf"
},
"cams_var_lib_ldap_master": {
"path": "/depot/cams/var_lib_ldap.master"
},
"cams_local": {
"path": "/depot/cams/local"
},
"cams_comanage_conf": {
"path": "/depot/cams/apache2/000-comanage.conf",
"read_only": true
},
... |
Proposal
nomad config validate <config_file>
does not detect missing files/directories for thehost_volume
parameter and Nomad fails to startUse-cases
if a directory/file is missing, nomad won't start.
Attempted Solutions
With Puppet we created a custom config validation, which checks that the paths are valid on the system:
voxpupuli/puppet-nomad#85
but I'd expect this same functionality to be available on
nomad config validate
The text was updated successfully, but these errors were encountered: