salt icon indicating copy to clipboard operation
salt copied to clipboard

Bug - Archive State Module - Python exception

Open jfrank-quatral opened this issue 12 years ago • 24 comments

Since upgrading to 2014.7rc3, the archive state module throw an exception.

Comment: An exception occurred in this state: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1529, in call **cdata['kwargs']) File "/usr/lib/python2.7/dist-packages/salt/states/archive.py", line 137, in extracted file_result = file_result[file_result.keys()[0]] AttributeError: 'list' object has no attribute 'keys'''

Here is my state definition:

highshare_install_{{ application['version'] }}: archive.extracted: - name: /home/{{ website['name'] }}/{{ application['directory'] }} - source: salt://web/apps/highshare/files/highshare.{{ application['version'] }}.tar.gz - archive_format: tar - tar_options: xz

jfrank-quatral avatar Oct 15 '14 20:10 jfrank-quatral

Thanks for this report. Could you please provide the output of that state run with debug logging enabled? Thanks!

cachedout avatar Oct 15 '14 22:10 cachedout

Here is the full log: http://pastebin.com/ZRAfJXW0

The relevant part should start at line: 2172

jfrank-quatral avatar Oct 15 '14 23:10 jfrank-quatral

Give #16690 a shot, @jfrank-quatral. Thanks!

cachedout avatar Oct 16 '14 19:10 cachedout

Will do. Thanks for the support.

jfrank-quatral avatar Oct 16 '14 20:10 jfrank-quatral

You're welcome. Thanks for using Salt. :]

cachedout avatar Oct 16 '14 20:10 cachedout

Just downloaded the new archive.py, put it in the _states folder and synced it to a minion to try again and got the same error.

I tried to debug the problem by adding an log.error of the file_result variable and this is its output: http://pastebin.com/16b51RbM

jfrank-quatral avatar Oct 16 '14 20:10 jfrank-quatral

Bah. OK. I was hoping that wouldn't lock like that but no such luck. I'll take another swing at it.

On Thu, Oct 16, 2014 at 2:54 PM, jfrank-quatral [email protected] wrote:

Just downloaded the new archive.py, put it in the _states folder and synced it to a minion to try again and got the same error.

I tried to debug the problem by adding an log.error of the file_result variable and this is its output: http://pastebin.com/16b51RbM

— Reply to this email directly or view it on GitHub https://github.com/saltstack/salt/issues/16658#issuecomment-59428778.

cachedout avatar Oct 16 '14 20:10 cachedout

K, PR updated.

cachedout avatar Oct 16 '14 20:10 cachedout

Now the exception is this: http://pastebin.com/kw2aL5sE

jfrank-quatral avatar Oct 16 '14 21:10 jfrank-quatral

Oops. Sorry. Fixed.

On Thu, Oct 16, 2014 at 3:07 PM, jfrank-quatral [email protected] wrote:

Now the exception is this: http://pastebin.com/kw2aL5sE

— Reply to this email directly or view it on GitHub https://github.com/saltstack/salt/issues/16658#issuecomment-59430757.

cachedout avatar Oct 16 '14 21:10 cachedout

Here is the new exception and the problem (state.sls is running) is still present: http://pastebin.com/bKWMvSyt

jfrank-quatral avatar Oct 16 '14 21:10 jfrank-quatral

Guh, wrong try/except. It just isn't my day. :] One momenet.

cachedout avatar Oct 16 '14 21:10 cachedout

Not sure if this helps, but the issue seems to be related to the _check_queue function in the state.py execution module.

Since a state is already running on this minion, it won't allow another one to be executed, thus the message: The function "state.sls" is running as PID 14671 and was started at 2014, Oct 28 14:45:38.583968 with jid 20141028144538583968

My quick fix was to add a boolean variable named concurrent to the state.single function, which is False by default. If True, then the _check_queue function is bypassed and allows the state.single function to run.

jfrank-quatral avatar Oct 28 '14 19:10 jfrank-quatral

Hey, having the same issue with Salt 2014.1.13 and OpenSuse 12.2 and 13.1. With states and modules.

annabzz avatar Nov 04 '14 08:11 annabzz

I can confirm the issue with 2014.1.11 packages on Ubuntu 14.04.

martinhoefling avatar Nov 17 '14 12:11 martinhoefling

@annabzz @martinhoefling Thanks for the reports. It looks like the fix was only applied to the 2014.7 and develop branches, not 2014.1. Are either of you in a position to give the 2014.7.0 release a try? Packages are in stable for most distros, with the exception of Debian/Ubuntu, which should be available very soon.

@jfrank-quatral Are you still having problems with this as well? Or did the fix from @cachedout help?

rallytime avatar Nov 18 '14 23:11 rallytime

@rallytime As far as I know, nothing worked for me. That is why I posted my own solution on how I managed to fix the issue, since we needed a solution in our development environment.

I wasn't sure if my fix was the correct way to solve the issue, so I didn't post try to push it upstream.

jfrank-quatral avatar Nov 18 '14 23:11 jfrank-quatral

Unfortunately, we're using Debian and Ubuntu.

Am 19. November 2014 00:20:24 MEZ, schrieb Nicole Thomas [email protected]:

@annabzz @martinhoefling Thanks for the reports. It looks like the fix was only applied to the 2014.7 and develop branches, not 2014.1. Are either of you in a position to give the 2014.7.0 release a try? Packages are in stable for most distros, with the exception of Debian/Ubuntu, which should be available very soon.

@jfrank-quatral Are you still having problems with this as well? Or did the fix from @cachedout help?


Reply to this email directly or view it on GitHub: https://github.com/saltstack/salt/issues/16658#issuecomment-63564687

martinhoefling avatar Nov 19 '14 07:11 martinhoefling

@jfrank-quatral I am not sure if that is the correct solution or not either. Do you have any feedback about that @cachedout?

rallytime avatar Nov 19 '14 15:11 rallytime

We're running Salt 2014.7.0 with OpenSuse 13.1 and we can say it works. This is our state:

super-3.30.0:
  archive.extracted:
    - name: /home/soft/mgr/
    - source: salt://super/files/super-3.30.0.tar.gz
    - archive_format: tar
    - if_missing: /home/soft/mgr/super-3.30.0/
    - tar_options: xz

annabzz avatar Nov 25 '14 11:11 annabzz