Hi! I’ve recently started using the payu in vk83 to run the pananantarctic COSIMA model (I was using the one in hh5), and I’m having the following error when trying to sweep and run one of my experiments:
[jn8053@gadi-login-01 panant-01-zstar-prsc-rest-TESTS]$ payu sweep
laboratory path: /scratch/x77/jn8053/mom6
binary path: /scratch/x77/jn8053/mom6/bin
input path: /scratch/x77/jn8053/mom6/input
work path: /scratch/x77/jn8053/mom6/work
archive path: /scratch/x77/jn8053/mom6/archive
/g/data/vk83/apps/base_conda/envs/payu-1.1.7/lib/python3.10/site-packages/payu/metadata.py:134: MetadataWarning: No experiment uuid found in metadata. Generating a new uuid
Traceback (most recent call last):
File "/g/data/vk83/apps/base_conda/envs/payu-1.1.7/bin/payu", line 10, in <module>
sys.exit(parse())
File "/g/data/vk83/apps/base_conda/envs/payu-1.1.7/lib/python3.10/site-packages/payu/cli.py", line 49, in parse
run_cmd(**args)
File "/g/data/vk83/apps/base_conda/envs/payu-1.1.7/lib/python3.10/site-packages/payu/subcommands/sweep_cmd.py", line 17, in runcmd
expt = Experiment(lab, metadata_off=metadata_off)
File "/g/data/vk83/apps/base_conda/envs/payu-1.1.7/lib/python3.10/site-packages/payu/experiment.py", line 69, in __init__
self.metadata.setup()
File "/g/data/vk83/apps/base_conda/envs/payu-1.1.7/lib/python3.10/site-packages/payu/metadata.py", line 136, in setup
self.set_new_uuid(is_new_experiment=is_new_experiment)
File "/g/data/vk83/apps/base_conda/envs/payu-1.1.7/lib/python3.10/site-packages/payu/metadata.py", line 218, in set_new_uuid
self.set_experiment_name(is_new_experiment=is_new_experiment)
File "/g/data/vk83/apps/base_conda/envs/payu-1.1.7/lib/python3.10/site-packages/payu/metadata.py", line 177, in set_experiment_name
branch_uuid_experiment_name = self.new_experiment_name()
File "/g/data/vk83/apps/base_conda/envs/payu-1.1.7/lib/python3.10/site-packages/payu/metadata.py", line 143, in new_experiment_name
self.branch = self.repo.get_branch_name()
File "/g/data/vk83/apps/base_conda/envs/payu-1.1.7/lib/python3.10/site-packages/payu/git_utils.py", line 64, in get_branch_name
return str(self.repo.active_branch)
File "/g/data/vk83/apps/base_conda/envs/payu-1.1.7/lib/python3.10/site-packages/git/repo/base.py", line 1052, in active_branch
return self.head.reference
File "/g/data/vk83/apps/base_conda/envs/payu-1.1.7/lib/python3.10/site-packages/git/refs/symbolic.py", line 413, in _get_reference
raise TypeError("%s is a detached symbolic reference as it points to %r" % (self, sha))
TypeError: HEAD is a detached symbolic reference as it points to 'f14970694138b7d63b4720cc9bd4fa3ae31a740f'
If anyone knows how I could fix it I’d appreciate it!
I’m sorry, I don’t know what other information I should include in my post. Please let me know!
It reads to me like you might need to create a working branch for the git repository backing your experiment? git switch -c <new-branch-name> create and switch to a new git branch. The payu experts might have more useful input than me here though!
Aidan
(Aidan Heerdegen, ACCESS-NRI Release Team Lead)
4
When I tried to clone Adele’s repo I got this message:
$ git clone --no-hardlinks /scratch/ol01/jn8053/payu_for_aidan/panant-01-zstar-ssp126-MW-only
Cloning into 'panant-01-zstar-ssp126-MW-only'...
done.
Note: switching to 'bbb7a5986bafda1121e793ae6a108a302f8fa4cb'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
So the original repo also didn’t have a checked out branch. If you, or anyone else, sees that message it is best to checkout a branch before doing anything else, e.g.
git checkout -b <branchname>
payu should also give a friendlier answer when this error occurs, with advice similar to above. I’ll try and make a PR to fix it, although anyone else is free to do so and ping me for a review.
Glad @angus-g was able to solve your issue. I’ll close this topic, but do create a new one if you have any other questions.