payu-org / payu

A workflow management tool for numerical models on the NCI computing systems
Apache License 2.0
18 stars 25 forks source link

Missing origin repo throws error #405

Open aidanheerdegen opened 5 months ago

aidanheerdegen commented 5 months ago

Using the new version (1.1) version of payu with an existing configuration repo threw the following error with payu checkout because the origin repo no longer exists:

Traceback (most recent call last):
  File "/g/data/vk83/apps/payu/1.1/bin/payu", line 10, in <module>
    sys.exit(parse())
  File "/home/502/aph502/code/python/payu/payu/cli.py", line 41, in parse
    run_cmd(**args)
  File "/home/502/aph502/code/python/payu/payu/subcommands/checkout_cmd.py", line 34, in runcmd
    checkout_branch(is_new_branch=new_branch,
  File "/home/502/aph502/code/python/payu/payu/branch.py", line 145, in checkout_branch
    repo.checkout_branch(branch_name, is_new_branch, start_point)
  File "/home/502/aph502/code/python/payu/payu/git_utils.py", line 147, in checkout_branch
    remote_branches = self.remote_branches_dict()
  File "/home/502/aph502/code/python/payu/payu/git_utils.py", line 127, in remote_branches_dict
    remote.fetch()
  File "/g/data/vk83/apps/payu/1.1/lib/python3.9/site-packages/git/remote.py", line 1014, in fetch
    res = self._get_fetch_info_from_stderr(proc, progress, kill_after_timeout=kill_after_timeout)
  File "/g/data/vk83/apps/payu/1.1/lib/python3.9/site-packages/git/remote.py", line 853, in _get_fetch_info_from_stderr
    proc.wait(stderr=stderr_text)
  File "/g/data/vk83/apps/payu/1.1/lib/python3.9/site-packages/git/cmd.py", line 600, in wait
    raise GitCommandError(remove_password_if_present(self.args), status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git fetch -v -- origin
  stderr: 'fatal: '/home/502/aph502/1deg_jra55_ryf' does not appear to be a git repository
fatal: Could not read from remote repository.'

Command run:

payu checkout timing-test

Output of git remote -v

origin  /home/502/aph502/1deg_jra55_ryf (fetch)
origin  /home/502/aph502/1deg_jra55_ryf (push)

But this directory (repo) no longer exists:

ls: cannot access '/home/502/aph502/1deg_jra55_ryf': No such file or directory

I removed the origin repository, got an error because I didn't specify -b timing-test. Doing so it worked fine and checked out a branch and created the related laboratory.