Search code examples
gitgerritrepo

What does "urlopen error [Errno -2] Name or service not known" mean?


When I execute the command repo upload . I get this error message:

[FAILED] device/path/to/repository/ branchname          
   (ssh://gerrit.foo.com/: <urlopen error [Errno -2] Name or service not known>)

Does anybody know what this means, or how I might get more information?

For what it's worth, I can execute repo sync . with no problems.


Solution

  • I found the problem by stepping through the Python code. Repo doesn't like repository urls that start with ssh://. It only accepts http, https, or sso.

    Guilty code was git_config.py, ReviewUrl().

    I may have been working with a corrupt repo manifest.

    Work-around was to manually push via git:

    git push origin HEAD:refs/for/project/foo