Synchronizing project fails with "no such remote origin" error

Solution Verified - Updated -

Environment

  • Red Hat Ansible Automation Platform

Issue

  • Synchronization of a project fails

Resolution

  • Execute the following on the Tower node:

    cd /var/lib/awx/projects
    rm _ID_projectname -rf
    rm _ID_projectname.lock
    

Root Cause

  • The error means that the remote origin doesn't exist. It could be possible that something or someone external to Tower modifies the original repository from you are cloning causing this issue. Another reason that could be causing it is a connection interruption during the cloning process. Lastly it also could be caused by a problem in the local cloned repository.

Diagnostic Steps

  • It fails with similar to the following:

    Using /etc/ansible/ansible.cfg as config file
    PLAY [all] *********************************************************************
    TASK [delete project directory before update] **********************************
    skipping: [localhost,] => {"changed": false, "skip_reason": "Conditional result was False"}
    TASK [update project using git] ************************************************
    fatal: [localhost, -> localhost]: FAILED! => {"changed": false, "msg": "Failed to set a new url 
    http://$encrypted$:$encrypted$@giturl.com/ansible/project.git for origin:  fatal: No such remote 'origin'\n"}
    PLAY RECAP *********************************************************************
    localhost,  : ok=0    changed=0    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments