Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to extract archive in 2014.7.1 #20852

Closed
yourmailmyid opened this issue Feb 20, 2015 · 7 comments
Closed

Not able to extract archive in 2014.7.1 #20852

yourmailmyid opened this issue Feb 20, 2015 · 7 comments
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix severity-low 4th level, cosemtic problems, work around exists
Milestone

Comments

@yourmailmyid
Copy link

I have following SLS file to extract a tar.gz file.

sensu-untar:
  archive:
    - extracted
    - order: 4
    - name: /home/user/sensu/
    - source: salt://default/sensu-conf.tar.gz
    - archive_format: tar
    - tar_options: zxv
    - keep: True

Above code fails on a salt-minion of version 2014.7.1 and passes on 2014.7.0 when executed from the same salt-master. The salt-master is on the 2014.7.1 version.

And when I replace the /usr/lib/python2.7/dist-packages/salt/states/archive.py of minion 7.1 with that of the minion 7.1 , the state file works fine on both minions.
So my conclusion is the archive.py in salt-minion 2014.7.1 has some problem.

The result for version 2014.7.1 is:

compute:
----------
          ID: sensu-untar
    Function: archive.extracted
        Name: /home/user/sensu/
      Result: False
     Comment:
     Started: 12:18:31.162696
    Duration: 677.619 ms
     Changes:
              ----------
              pid:
                  23995
              retcode:
                  2
              stderr:
                  tar (child): '/var/cache/salt/minion/files/base/_home_user_sensu_.tar': Cannot open: No such file or directory
                  tar (child): Error is not recoverable: exiting now
                  tar: Child returned status 2
                  tar: Error is not recoverable: exiting now
              stdout:

Summary
------------
Succeeded: 0 (changed=1)
Failed:    1
------------
Total states run:     1

The result for version 2014.7.0 is:

network:
----------
          ID: sensu-untar
    Function: archive.extracted
        Name: /home/user/sensu/
      Result: True
     Comment: salt://default/sensu-client/sensu-conf.tar.gz extracted in /home/user/sensu/
     Started: 12:19:51.828931
    Duration: 11.506 ms
     Changes:
              ----------
              directories_created:
                  - /home/user/sensu/
              extracted_files:
                  sensu/conf.d/
                  sensu/extensions/
                  sensu/handlers/

Summary
------------
Succeeded: 1 (changed=1)
Failed:    0
------------
Total states run:     1
@rallytime
Copy link
Contributor

@yourmailmyid Thanks for the report. Can you remove the x in the tar_options value? So it would look like: - tar_options: zv.

We had a regression in behavior in 2014.7.0 where you had to specify the x. Earlier versions did not specify the x, so we changed that behavior back to the original for 2014.7.1. Sorry for the troubles on that!

Let us know if that doesn't clear up the issue for you. Otherwise, feel free to close this issue if removing the x clears this up.

@rallytime rallytime added the expected-behavior intended functionality label Feb 20, 2015
@rallytime rallytime added this to the Blocked milestone Feb 20, 2015
@yourmailmyid
Copy link
Author

@rallytime I did change the tar_options from zxv to zv. But I am still seeing the same error on version 2014.7.1
Here's the output:

compute:

      ID: sensu-untar
Function: archive.extracted
    Name: /home/user/sensu/
  Result: False
 Comment:
 Started: 06:53:27.163296
Duration: 5.542 ms
 Changes:
          ----------
          pid:
              13775
          retcode:
              2
          stderr:
              tar (child): '/var/cache/salt/minion/files/base/_home_user_sensu_.tar': Cannot open: No such file or directory
              tar (child): Error is not recoverable: exiting now
              tar: Child returned status 2
              tar: Error is not recoverable: exiting now
          stdout:

Summary

Succeeded: 0 (changed=1)

Failed: 1

Total states run: 1

@rallytime rallytime added Bug broken, incorrect, or confusing behavior severity-low 4th level, cosemtic problems, work around exists fixed-pls-verify fix is linked, bug author to confirm fix and removed expected-behavior intended functionality labels Feb 23, 2015
@rallytime rallytime modified the milestones: Approved, Blocked Feb 23, 2015
@rallytime
Copy link
Contributor

Ah, sorry for pointing you in the wrong direction. I was thinking this was the same x vs no x regression/change we've been seeing reports for. It looks like this has actually been fixed with #19930 and is fixed in 2014.7.2. Want to give that one more try on this newest release to confirm?

@yourmailmyid
Copy link
Author

Tried the same SLS with "salt-minion 2015.2.0 (Lithium)". It worked. Seems to be fixed. Will use it once it is officially released. Thanks.

@rallytime
Copy link
Contributor

Awesome! Glad this is working for you. Since this is confirmed fixed, I am going to close this. If the issue pops up again, please comment and we will be happy to open this report again and take another look.

@garthk
Copy link

garthk commented Mar 3, 2015

Any workaround for 2014.7.1? When is 2014.7.2 shipping on the APT feed?

UPDATE: yes, if archive_format is tar and the archive is compressed with gzip. Remove tar_options and see if it helps.

@ltutar
Copy link

ltutar commented Mar 5, 2015

Hi Garth,
Removing tar_options with salt 2014.7.1 on centos helped me. Thank you for your answer and the update.
I was getting the error:
==> puppetmaster_centos: tar (child): '/var/cache/salt/minion/files/base/_opt_puppet.tar': Cannot open: No such file or directory
==> puppetmaster_centos: tar (child): Error is not recoverable: exiting now
==> puppetmaster_centos: tar: Child returned status 2
==> puppetmaster_centos: tar: Error is not recoverable: exiting now
==> puppetmaster_centos: stdout:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix severity-low 4th level, cosemtic problems, work around exists
Projects
None yet
Development

No branches or pull requests

4 participants