Hi,
I tried installing CVMFS in my local ansible-galaxy server (22.01). For the installation, I followed the tutorial fron the Galaxy Training Network (Reference Data with CVMFS).
While running the ansible-playbook galaxy.yml command, I got the following error:
fatal: [192.168.123.108]: FAILED! => {“msg”: “The task includes an option with a n undefined variable. The error was: Unable to look up a name or access an attri bute in template string ({{ item.path | dirname }}).\nMake sure your variable na me does not contain invalid characters like ‘-’: expected str, bytes or os.PathL ike object, not AnsibleUndefined\n\nThe error appears to be in ‘/home/user/galaxy/roles/galaxyproject.cvmfs/tasks/keys.yml’: line 3, column 3, but may\nbe elsewh ere in the file depending on the exact syntax problem.\n\nThe offending line app ears to be:\n\n\n- name: Make CernVM-FS key directories\n ^ here\n”}
It looked like the error was in the - part of the name, which was: CerVM-FS. I changed the name to Make CernVMFS key directories, but this did not get rid or the error.
Edit: I looked at the files of a seperate previously created (earlier this year) ansible-galaxy server and saw that the key.yml file is identical to the one I used there and worked. I was wondering if this error might be caused by any recent updates.
I was also wondering if it could be caused by having no SSH key in the server. I was wondering if I needed to create an SSH key within the server or add keys from the external user who is accessing it from a remote desktop (this is how it was done in the previously created server).
@jennaj Thank you for the help! I added an SSH key, but the error didn’t change. Would you have any other input on how to possibly fix this error? Thanks in advance!
@nate I have no cvmfs_keys variable in any file in the group_vars directory, since the tutorial didn’t show that this needs to be added and a previously created galaxy server also didn’t need this for cvmfs to be installed. Could you maybe explain if I missed a part in the tutorial and/or what needs to be add for it to run properly? I also updatet the cvmfs role to the latest version (which didn’t change anything). Thanks in advance!
Ok, if you’re using the tutorial exactly as written, you’d be using galaxy_cvmfs_repos_enabled, which sets cvmfs_keys for you. One change I would recommend is to use the value true for that option:
galaxy_cvmfs_repos_enabled: true
We’ll update the training accordingly in the future.
The failing task was rewritten in the latest version of galaxyproject.galaxy, so the error message should be different. If you’re seeing the same error, then it’s probably not using the latest version for some reason?
I tried setting it the galaxy_cvmfs_repos_enabled: true and ran the ansible-galaxy install --force -p roles -r requirements.yml command once again, should it have failed the first time, but nothing changed. I keep getting the exact same error message. I was wondering if you might have any other possible solution for fixing this problem. Thanks in advance!
Edit: I don’t know if this information is helpful, but I am using an Ubuntu 22.04 (Jammy Jellyfish) server. I thought that this version of Ubuntu was supported, but maybe this is causing the error.
Can you also try completely wiping out the cvmfs directories? apt purge cvmfs* and remove anything in /etc/cvmfs, sometimes I’ve had issues where once it was misconfigured, running the role again wasn’t sufficient
This unfortunately also didn’t change anything.
I tried running the sudo apt-get update command in case I missed an important update. This gave the following warning:
According to this warning, it seems the error might actually be caused by using Ubuntu version 22.04, since it was reported on other forums that multiple people came across this error when updating to version 22.04. I am thinking of running the following command (inspired by solutions of others for this problem), but was wondering if this is safe to run.
(off-topic)
huh, did not know apt-key was getting deprecated, that’s unhelpful.
APT-KEY(8)
NAME
apt-key - Deprecated APT key management utility
...
DEPRECATION
Except for using apt-key del in maintainer scripts, the use of apt-key is deprecated. This section shows how to replace existing use of apt-key.
If your existing use of apt-key add looks like this:
wget -qO- https://myrepo.example/myrepo.asc | sudo apt-key add -
Then you can directly replace this with (though note the recommendation below):
wget -qO- https://myrepo.example/myrepo.asc | sudo tee /etc/apt/trusted.gpg.d/myrepo.asc
Make sure to use the "asc" extension for ASCII armored keys and the "gpg" extension for the binary OpenPGP format (also known as "GPG key public ring"). The
binary OpenPGP format works for all apt versions, while the ASCII armored format works for apt version >= 1.4.
Recommended: Instead of placing keys into the /etc/apt/trusted.gpg.d directory, you can place them anywhere on your filesystem by using the Signed-By option in
your sources.list and pointing to the filename of the key. See sources.list(5) for details. Since APT 2.4, /etc/apt/keyrings is provided as the recommended
location for keys not managed by packages. When using a deb822-style sources.list, and with apt version >= 2.4, the Signed-By option can also be used to include
the full ASCII armored keyring directly in the sources.list without an additional file.
I edited the main.yml file to contain the right syntax for combining lists, but as expected this alone didn’t change anything again. For the ansible version, I am using ansible version 6.4.0 and ansible core 2.13.5rc1.
(For anyone else reading as well) this is essentially identical to the current version of git-gat at step-3, basically the only differences are things we added for gravity + this:
I made the changes to the requirements file and ran the playbook, but this unfortunately also didn’t change anything, it keeps giving the same error about the invalid characters.
Then I guess we need to specifically debug the error.
You can use the debug module of ansible to print out information within a playbook. Can you please modify the role, and, right before where it fails, print out relevant variables?
- debug:
msg: "{{ my_var }}"
Will print out that variable, just write a lot of them and try and figure out which variables look wrong maybe?
Thanks everyone for all the help! I got rid of the error by once more wiping out the cvmfs directories with apt purge cvmfs* and removing everything in /etc/cvmfs. I then also ran the ansible-galaxy install -p roles -r requirements.yml --force command and changed the main.yml file to contain the right syntax for the combination of lists before I ran the playbook again and the error was gone! Unfortunately a new error occured imediately, which I might open another question for and link here.
For anyone else who ran into this error and ran into another error regarding the setup of cvmfs after solving it, check out the next question: ERROR while checking CERNVM-FS for setup.