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

[BUG] trying to enforce user/group ownership, paths were missing #58027

Open
noelmcloughlin opened this issue Jul 26, 2020 · 5 comments
Open
Labels
Bug broken, incorrect, or confusing behavior MacOS pertains to the OS of fruit severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
Milestone

Comments

@noelmcloughlin
Copy link
Contributor

Description

Archive extracted fails to enforce user/group on particular filenames

Setup

I was testing java-formula PR on macOS: saltstack-formulas/java-formula#13

Steps to Reproduce the behavior

On MacOS:
Do #57742 (comment)
Test java-formula: saltstack-formulas/java-formula#13

Expected behavior

State should succeed.

Screenshots
If applicable, add screenshots to help explain your problem.

          ID: java-package-archive-install
    Function: archive.extracted
        Name: /Library/Java/JavaVirtualMachines/adoptopenjdk-8-8u252-b09/
      Result: False
     Comment: /private/tmp/java_tmp_salt/java-archive.tar.gz extracted to /Library/Java/JavaVirtualMachines/adoptopenjdk-8-8u252-b09/, due to absence of one or more files/dirs. Output was trimmed to 100 number of lines
              
              While trying to enforce user/group ownership, the following paths were missing:
              
              - /Library/Java/JavaVirtualMachines/adoptopenjdk-8-8u252-b09/._jdk8u252-b09
              
              While trying to enforce user/group ownership, Salt was unable to change ownership on the following paths:
              
              - /Library/Java/JavaVirtualMachines/adoptopenjdk-8-8u252-b09/._jdk8u252-b09
     Started: 12:44:39.807768
    Duration: 1989.353 ms
     Changes:   
              ----------
              extracted_files:
                  - x Contents/
                  - x Contents/Home/
                  - x Contents/Info.plist
                  - x Contents/MacOS/
                  - x Contents/MacOS/libjli.dylib

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
           Salt: 3001
 
Dependency Versions:
           cffi: 1.12.2
       cherrypy: unknown
       dateutil: 2.8.0
      docker-py: Not Installed
          gitdb: 2.0.6
      gitpython: 2.1.15
         Jinja2: 2.10.1
        libgit2: 1.0.1
       M2Crypto: 0.35.2
           Mako: 1.0.7
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.19
       pycrypto: Not Installed
   pycryptodome: 3.9.7
         pygit2: 1.2.1
         Python: 3.7.8 (default, Jul  8 2020, 14:18:28)
   python-gnupg: 0.4.4
         PyYAML: 5.1.2
          PyZMQ: 18.0.1
          smmap: 3.0.4
        timelib: 0.2.4
        Tornado: 4.5.3
            ZMQ: 4.3.1
 
System Versions:
           dist: darwin 19.6.0 
         locale: UTF-8
        machine: x86_64
        release: 19.6.0
         system: Darwin
        version: 10.15.6 x86_64

Additional context
Add any other context about the problem here.

@cmcmarrow
Copy link
Contributor

@noelmcloughlin for the bug report. Can you please give use all the arguments you gave to archive.extracted?

@cmcmarrow cmcmarrow added this to the Follow up milestone Jul 28, 2020
@cmcmarrow cmcmarrow added MacOS pertains to the OS of fruit severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P4 Priority 4 labels Jul 28, 2020
@noelmcloughlin
Copy link
Contributor Author

noelmcloughlin commented Jul 30, 2020

Debug run shows the following is rendered.

[DEBUG   ] Rendered data from file: /var/cache/salt/minion/files/base/java/archive/install.sls:

<CUT>

  cmd.run:
    - name: curl  -Lo /tmp/java_tmp_salt/java-archive.tar.gz https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_x64_mac_hotspot_8u252b09.tar.gz
    - retry: {"attempts": 2, "interval": 10, "splay": 10, "until": true}
    - unless:
      - test -f /tmp/java_tmp_salt/java-archive.tar.gz
      - test -x /Library/Java/JavaVirtualMachines/adoptopenjdk-8-8u252-b09/.jdk/Contents/Home/bin/java  # noqa 204
  archive.extracted:
    - name: /Library/Java/JavaVirtualMachines/adoptopenjdk-8-8u252-b09/
    - source: file:///tmp/java_tmp_salt/java-archive.tar.gz
    - format: tar
    - source_hash: 6e267893aae127a4bccfedb56d9893a891213a93de593a97f248629eaa0594ba
    - enforce_toplevel: false
    - trim_output: true
    - options: "--strip-components=1"
    - user: my_valid_username
    - group: staff
    - onchanges:
      - cmd: java-package-archive-install
    - require:
      - cmd: java-package-archive-install

Same error

          ID: java-package-archive-install
    Function: archive.extracted
        Name: /Library/Java/JavaVirtualMachines/adoptopenjdk-8-8u252-b09/
      Result: False
     Comment: /private/tmp/java_tmp_salt/java-archive.tar.gz extracted to /Library/Java/JavaVirtualMachines/adoptopenjdk-8-8u252-b09/, due to absence of one or more files/dirs. Output was trimmed to 100 number of lines

              While trying to enforce user/group ownership, the following paths were missing:

              - /Library/Java/JavaVirtualMachines/adoptopenjdk-8-8u252-b09/._jdk8u252-b09

              While trying to enforce user/group ownership, Salt was unable to change ownership on the following paths:

              - /Library/Java/JavaVirtualMachines/adoptopenjdk-8-8u252-b09/._jdk8u252-b09
     Started: 21:45:51.875040
    Duration: 2788.182 ms

@sagetherage
Copy link
Contributor

@weswhet is this something the Mac Working Group might take on?

@weswhet
Copy link
Contributor

weswhet commented Aug 12, 2020

@sagetherage we can but I don't think this is an issue with macOS. It appears that ._jdk8u252-b09 is in the list of contents but not actually present, hence why it can't change the ownership. Seems more like an issue with the java tarball

@sagetherage
Copy link
Contributor

oh sure, your Working Group is active and we would love to simply see collaboration, but of course we can also pair a core team member, as well. :)

@sagetherage sagetherage added this to To do in MacOS Oct 20, 2020
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 MacOS pertains to the OS of fruit severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
MacOS
  
To do
Development

No branches or pull requests

4 participants