Parse Error
input.hcl:26,41-52: Error in function call; Call to function “pathexpand” failed: filesystem function disabled. input.hcl:26,20-76: Unsuitable value type; Unsuitable value: value must be known
According to the documentation " The pathexpand function expands a leading ~ character to the current user’s home directory". Are you able to verify that that file exists at that path in the root users home directory? If not, do you see it in some other directory?
That caught my eye too, but I found this thread which shows a fix being merged in Jan. I am not aware of any reason that would be disabled. I’ll keep digging and see if I can reproduce or there’s a regression. As for ed25519, I don’t think that’s a problem. Some searches show other people using it.
Yeah that is odd, but not unheard of. Is it an option for you to rollback the ubuntu version and retest? Also, when you tested a few weeks ago were you on 1.1.6? It’s relatively new. Like I said, it worked on 1.1.6 and 1.1.5 for me, but I’m just trying to identify possible variances.
Sure, I’m just doing this for learing myself and setting up a poc, I’ll do whatever I can to help out.
So, this is what I’ve done:
Upgraded the OS with the latest updates (noting related though, but just in case)
Downgraded down to 1.1.5 → 1.1.4
Then, I come to think of, one of the differences now vs back then, is that I’m executing the jobs from the web ui. It failed when I was trying to run the job on all versions through the web ui but it worked when I used the nomad job run prometheus.hcl
Well, I’ve got it working, but I wonder why it fails in the web ui.
Should I try and upgrade back to 1.1.6?
Edit: also worth mentioning; I can’t see anything suspicious when running journalctl -xef -u nomad (not in debug mode though)
I think upgrading back to 1.1.6 should be fine. Thanks for sharing the extra detail! The Web UI is now the hot path of investigation. I’ll talk to my colleagues and see what we can figure out.
Do you mind opening a GitHub issue for this? I think it’s more properly tracked there. If you could include a link to this discuss thread that would be awesome!
I don’t think you are able to read local files when submitting jobs via the web-ui (atleast I’d expect a popup regarding accessing your localdrive by your browser.)
If I remember correctly, the filesystem-functions were added along with the hcl2 support.
Functions are evaluated by the CLI during configuration parsing rather than job run time, so this function can only be used with files that are already present on disk on operator host.
If you manually base64encode the key & use the string in place of the file()-function, I’d assume it works fine?
EDIT: I see now that this was already answered in the github-issue
Ok, might be true. I have struggled “a bit” with the artifact-stanca myself as well
The specific issue you linked I believe I solved by scanning (ssh-keyscan) & adding the bitbucket/github/etc fingerprints to all of my nomad nodes “known_hosts” file.
HCL2 supports “decoding” the base64 string before submitting the job, so that might work (base64decode(“pre-encoded-b64string”))?
You should also keep in mind that the key(s) will be visible in the jobfile, and anyone with access to this file (or the job-definition in nomad) can access the key. The only way around this is using vault or similar solution.
Lately I just use a sidecar-task with “sidecar=false” and “hook=prestart” for downloading any “problematic” artifacts to /alloc/some-folder & my main task can access the files from there.