You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
git.latest UnboundLocalError: local variable 'desired_upstream' referenced before assignmen #32260
P1Priority 1PlatformRelates to OS, containers, platform-based utilities like FS, system based appsState-Modulebugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1626, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1492, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/states/git.py", line 630, in latest
desired_upstream,
UnboundLocalError: local variable 'desired_upstream' referenced before assignment
Setup
git.latest called with nonexistant rev
Steps to Reproduce Issue
(Include debug logs if possible and relevant.)
Versions Report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
Salt: 2016.3.0-291-gdcfee8e
Dependency Versions:
Jinja2: 2.8
M2Crypto: Not Installed
Mako: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
Python: 2.7.9 (default, Mar 1 2015, 12:57:24)
RAET: Not Installed
Tornado: 4.3
ZMQ: 4.1.2
cffi: 1.5.2
cherrypy: 5.1.0
dateutil: 2.2
gitdb: 0.5.4
gitpython: 0.3.2 RC1
ioflo: Not Installed
libgit2: 0.24.0
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.7
mysql-python: 1.2.3
pycparser: 2.14
pycrypto: 2.6.1
pygit2: 0.24.0
python-gnupg: Not Installed
smmap: 0.8.2
timelib: Not Installed
System Versions:
dist: debian 8.3
machine: x86_64
release: 3.16.0-4-amd64
system: Linux
version: debian 8.3
Although this still results in a warning - so I'm still not sure this is the desired result for this scenario.
My traceback is:
An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/salt/state.py", line 1626, in call
**cdata['kwargs'])
File "/usr/lib/python2.6/site-packages/salt/loader.py", line 1492, in wrapper
return f(*args, **kwargs)
File "/usr/lib64/python2.6/contextlib.py", line 34, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.6/site-packages/salt/utils/context.py", line 42, in func_globals_inject
yield
File "/usr/lib/python2.6/site-packages/salt/loader.py", line 1492, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/salt/states/git.py", line 630, in latest
desired_upstream,
UnboundLocalError: local variable 'desired_upstream' referenced before assignment
Version information:
Salt Version:
Salt: 2015.8.8.2
Dependency Versions:
Jinja2: unknown
M2Crypto: Not Installed
Mako: Not Installed
PyYAML: 3.11
PyZMQ: 14.5.0
Python: 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
RAET: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
cffi: Not Installed
cherrypy: Not Installed
dateutil: 1.4.1
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
libgit2: 0.20.0
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: 0.20.3
python-gnupg: Not Installed
smmap: Not Installed
timelib: Not Installed
System Versions:
dist: centos 6.7 Final
machine: x86_64
release: 2.6.32-573.22.1.el6.x86_64
system: CentOS 6.7 Final
I just hit this bug. We were trying to clone a repo that's mounted as a Vagrant shared folder. I had freshly cloned the repo to my Vagrant host, and the repo was on the master branch. The state was trying to clone the develop branch from the repo on the host to some location in the VM. That's when I encountered the traceback. As soon as I checked out the develop branch on the host, this error went away.
Also ran into this. In my case I passed non-existent tag as a revision of a remote repo.
An exception occurred in this state: Traceback (most recent call last):
File "/tmp/.b5980d/py2/salt/state.py", line 1703, in call
**cdata['kwargs'])
File "/tmp/.b5980d/py2/salt/loader.py", line 1649, in wrapper
return f(*args, **kwargs)
File "/tmp/.b5980d/py2/salt/states/git.py", line 659, in latest
desired_upstream,
UnboundLocalError: local variable 'desired_upstream' referenced before assignment
$ salt-ssh --versions-report
Salt Version:
Salt: 2016.3.0rc2
Dependency Versions:
Jinja2: 2.7.2
M2Crypto: 0.21.1
Mako: 0.9.1
PyYAML: 3.10
PyZMQ: 14.0.1
Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
RAET: Not Installed
Tornado: 4.3
ZMQ: 4.0.4
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
libgit2: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.3.0
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: Not Installed
timelib: Not Installed
System Versions:
dist: Ubuntu 14.04 trusty
machine: x86_64
release: 3.13.0-74-generic
system: Linux
version: Ubuntu 14.04 trusty
P1Priority 1PlatformRelates to OS, containers, platform-based utilities like FS, system based appsState-Modulebugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
jfindlay commentedon Mar 31, 2016
@jagguli, thanks for reporting.
ronnix commentedon Apr 7, 2016
FYI, I ran into this error today too.
redmcg commentedon Apr 13, 2016
I ran in to this too. My traceback is a little different though - so may not be the exact same issue.
I ran in to this when trying to clone an empty repository. I fixed it with a simple one line change:
Although this still results in a warning - so I'm still not sure this is the desired result for this scenario.
My traceback is:
Version information:
mafrosis commentedon Apr 18, 2016
I have also seen this one! I'm happy to run some diagnostic if it would be considered useful.
codekoala commentedon May 13, 2016
I just hit this bug. We were trying to clone a repo that's mounted as a Vagrant shared folder. I had freshly cloned the repo to my Vagrant host, and the repo was on the master branch. The state was trying to clone the develop branch from the repo on the host to some location in the VM. That's when I encountered the traceback. As soon as I checked out the develop branch on the host, this error went away.
jfindlay commentedon May 13, 2016
@terminalmage, ping.
AndreiPashkin commentedon May 17, 2016
Also ran into this. In my case I passed non-existent tag as a revision of a remote repo.
Fix UnboundLocalError in git.latest
terminalmage commentedon May 18, 2016
Fixed in #33340.
Fix UnboundLocalError in git.latest (#33340)
[develop] Merge forward from 2016.3 to develop (#33408)