Hi Thomas, I'm trying to use ext_pillar with git and running into the following problem:
I clear everything in /var/cache/salt/master, re-start the master, and run salt '*' state.highstate and get the following
[DEBUG ] Loaded git_pillar as virtual git
[ERROR ] Failed to load ext_pillar git: 'git fetch' returned exit status 128: fatal: remote error:
Repository not found.
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/salt/pillar/__init__.py", line 411, in ext_pillar
ext = self.ext_pillars[key](self.opts['id'], pillar, val)
File "/usr/lib/pymodules/python2.7/salt/pillar/git_pillar.py", line 140, in ext_pillar
if not update(branch, repo_location):
File "/usr/lib/pymodules/python2.7/salt/pillar/git_pillar.py", line 96, in update
repo = init(branch, repo_location)
File "/usr/lib/pymodules/python2.7/salt/pillar/git_pillar.py", line 85, in init
repo.git.fetch()
File "/home/ubuntu/src/gitpython/git/cmd.py", line 231, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "/home/ubuntu/src/gitpython/git/cmd.py", line 488, in _call_process
return self.execute(make_call(), **_kwargs)
File "/home/ubuntu/src/gitpython/git/cmd.py", line 381, in execute
raise GitCommandError(command, status, stderr_value)
GitCommandError: 'git fetch' returned exit status 128: fatal: remote error:
Repository not found.
[INFO ] AES payload received with command _serve_file
[INFO ] AES payload received with command _ext_nodes
[INFO ] AES payload received with command _return
... wait a few seconds...
[WARNING ] GitPython exception caught while fetching: len([]) != len(['ssh: Could not resolve hostname github.com:bakodo: Name or service not known', ''])
There's something interesting here, because at first it can't seem to find the repo specified under ext_pillar - which makes sense, since that's the wrong schema for a github repo to begin with. But a few seconds later, it seems to be having trouble with the other schema, which I can only assume is coming from the gitfs remotes.
I was wondering if it had to do with the private key not being under id_rsa, so I moved it there, and same result.
On the salt client's end, I get the following error:
State: - no
Name: states
Function: None
Result: False
Comment: No Top file or external nodes data matches found
Changes:
If I try changing the repo to read something close to the URL github gives you for ssh access to the repo:
ext_pillar:
- git: master git://github.com:bakodo/salt-pillar.git
I still get the intermitent warnings that were happening earlier, which I think is safe to assume are coming from gitfs
[WARNING ] GitPython exception caught while fetching: len([]) != len(['ssh: Could not resolve hostname github.com:bakodo: Name or service not known', ''])
If I now go ahead and do a highstate, I still get
----------
State: - no
Name: states
Function: None
Result: False
Comment: No Top file or external nodes data matches found
Changes:
on the salt client
and the salt-master log now shows:
[DEBUG ] loading pillar in ['/var/cache/salt/master/extmods/pillar', '/usr/lib/pymodules/python2.7/salt/pillar']
[DEBUG ] Skipping /var/cache/salt/master/extmods/pillar, it is not a directory
[DEBUG ] Loaded git_pillar as virtual git
[ERROR ] Failed to load ext_pillar git: 'git fetch' returned exit status 128: fatal: unable to connect to
github.com:
github.com: Servname not supported for ai_socktype
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/salt/pillar/__init__.py", line 411, in ext_pillar
ext = self.ext_pillars[key](self.opts['id'], pillar, val)
File "/usr/lib/pymodules/python2.7/salt/pillar/git_pillar.py", line 140, in ext_pillar
if not update(branch, repo_location):
File "/usr/lib/pymodules/python2.7/salt/pillar/git_pillar.py", line 96, in update
repo = init(branch, repo_location)
File "/usr/lib/pymodules/python2.7/salt/pillar/git_pillar.py", line 85, in init
repo.git.fetch()
File "/home/ubuntu/src/gitpython/git/cmd.py", line 231, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "/home/ubuntu/src/gitpython/git/cmd.py", line 488, in _call_process
return self.execute(make_call(), **_kwargs)
File "/home/ubuntu/src/gitpython/git/cmd.py", line 381, in execute
raise GitCommandError(command, status, stderr_value)
GitCommandError: 'git fetch' returned exit status 128: fatal: unable to connect to
github.com:
github.com: Servname not supported for ai_socktype
If I add
ext_pillar:
- git: master git://g...@github.com:bakodo/salt-pillar.git
I get
DEBUG ] loading pillar in ['/var/cache/salt/master/extmods/pillar', '/usr/lib/pymodules/python2.7/salt/pillar']
[DEBUG ] Skipping /var/cache/salt/master/extmods/pillar, it is not a directory
[DEBUG ] Loaded git_pillar as virtual git
[ERROR ] Failed to load ext_pillar git: 'git fetch' returned exit status 128: fatal: unable to connect to
g...@github.com:
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/salt/pillar/__init__.py", line 411, in ext_pillar
ext = self.ext_pillars[key](self.opts['id'], pillar, val)
File "/usr/lib/pymodules/python2.7/salt/pillar/git_pillar.py", line 140, in ext_pillar
if not update(branch, repo_location):
File "/usr/lib/pymodules/python2.7/salt/pillar/git_pillar.py", line 96, in update
repo = init(branch, repo_location)
File "/usr/lib/pymodules/python2.7/salt/pillar/git_pillar.py", line 85, in init
repo.git.fetch()
File "/home/ubuntu/src/gitpython/git/cmd.py", line 231, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "/home/ubuntu/src/gitpython/git/cmd.py", line 488, in _call_process
return self.execute(make_call(), **_kwargs)
File "/home/ubuntu/src/gitpython/git/cmd.py", line 381, in execute
raise GitCommandError(command, status, stderr_value)
GitCommandError: 'git fetch' returned exit status 128: fatal: unable to connect to
g...@github.com:
[INFO ] AES payload received with command _serve_file
[INFO ] AES payload received with command _ext_nodes
[INFO ] AES payload received with command _return
Finally if I set it to what I think should be the winning formula:
ext_pillar:
- git: master git+ssh://g...@github.com:bakodo/salt-pillar.git
I get the dissapointing:
[DEBUG ] Skipping /var/cache/salt/master/extmods/pillar, it is not a directory
[DEBUG ] Loaded git_pillar as virtual git
[ERROR ] Failed to load ext_pillar git: 'git fetch' returned exit status 128: ssh: Could not resolve hostname github.com:bakodo: Name or service not known
fatal: The remote end hung up unexpectedly
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/salt/pillar/__init__.py", line 411, in ext_pillar
ext = self.ext_pillars[key](self.opts['id'], pillar, val)
File "/usr/lib/pymodules/python2.7/salt/pillar/git_pillar.py", line 140, in ext_pillar
if not update(branch, repo_location):
File "/usr/lib/pymodules/python2.7/salt/pillar/git_pillar.py", line 96, in update
repo = init(branch, repo_location)
File "/usr/lib/pymodules/python2.7/salt/pillar/git_pillar.py", line 85, in init
repo.git.fetch()
File "/home/ubuntu/src/gitpython/git/cmd.py", line 231, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "/home/ubuntu/src/gitpython/git/cmd.py", line 488, in _call_process
return self.execute(make_call(), **_kwargs)
File "/home/ubuntu/src/gitpython/git/cmd.py", line 381, in execute
raise GitCommandError(command, status, stderr_value)
GitCommandError: 'git fetch' returned exit status 128: ssh: Could not resolve hostname github.com:bakodo: Name or service not known
fatal: The remote end hung up unexpectedly
[INFO ] AES payload received with command _serve_file
[INFO ] AES payload received with command _ext_nodes
[INFO ] AES payload received with command _return
...
[WARNING ] GitPython exception caught while fetching: len([]) != len(['ssh: Could not resolve hostname github.com:bakodo: Name or service not known', ''])
I've ran out of ideas at this point. The only thing I can think of is something wrong with GitPython. I installed GitPython 0.3.1beta2 with pip, but I did look in my site-packages and found the 0.1.7 version. I renamed it and when I load it in python it is not the 0.3.1beta2. Not sure if there's a better way to check if salt is using the correct version (btw, salt v 0.17.0)
Thanks a lot,
Andy