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

Apache Ant & Maven Recipes are failing on PkgCreator recipe #137

Closed
MLBZ521 opened this issue Feb 18, 2021 · 4 comments · May be fixed by #150
Closed

Apache Ant & Maven Recipes are failing on PkgCreator recipe #137

MLBZ521 opened this issue Feb 18, 2021 · 4 comments · May be fixed by #150

Comments

@MLBZ521
Copy link

MLBZ521 commented Feb 18, 2021

Hey @n8felton, went to use the Ant recipe today and after created a .jss recipe, I realized it didn't work.

After checking, both the Ant and Maven .pkg recipes fail on the PkgCreator step. Seems they're both failing to find the symlinks that are created in the previous steps:

Ant:

PkgCreator
{'Input': {'pkg_request': {'chown': [{'group': 'wheel',
                                      'mode': '0755',
                                      'path': 'usr',
                                      'user': 'root'}],
                           'id': 'org.apache.ant',
                           'pkgdir': '/Users/<user>/Library/AutoPkg/Cache/com.github.n8felton.pkg.Ant',
                           'pkgname': 'Ant-1.10.9',
                           'pkgroot': '/Users/<user>/Library/AutoPkg/Cache/com.github.n8felton.pkg.Ant/payload',
                           'pkgtype': 'flat',
                           'version': '1.10.9'}}}
PkgCreator: Connecting
PkgCreator: Sending packaging request
PkgCreator: Disconnecting
PkgCreator: Failed to close socket: [Errno 9] Bad file descriptor
Traceback (most recent call last):
  File "/Library/AutoPkg/autopkglib/__init__.py", line 658, in process
    self.env = processor.process()
  File "/Library/AutoPkg/autopkglib/__init__.py", line 465, in process
    self.main()
  File "/Library/AutoPkg/autopkglib/PkgCreator.py", line 269, in main
    self.package()
  File "/Library/AutoPkg/autopkglib/PkgCreator.py", line 223, in package
    pkg_path = self.send_request(request)
  File "/Library/AutoPkg/autopkglib/PkgCreator.py", line 258, in send_request
    raise ProcessorError(", ".join([s.replace("ERROR:", "") for s in errors]))
autopkglib.ProcessorError: Can't lchown /tmp/tmpvgk040r0/payload/usr/local/ant: [Errno 2] No such file or directory: '/tmp/tmpvgk040r0/payload/usr/local/ant'
  File "/Library/AutoPkg/autopkglib/__init__.py", line 658, in process
    self.env = processor.process()
Can't lchown /tmp/tmpvgk040r0/payload/usr/local/ant: [Errno 2] No such file or directory: '/tmp/tmpvgk040r0/payload/usr/local/ant'
Failed.
Receipt written to /Users/<user>/Library/AutoPkg/Cache/com.github.n8felton.pkg.Ant/receipts/com.github.n8felton.pkg-receipt-20210217-172829.plist

The following recipes failed:
    com.github.n8felton.pkg.Ant
        Error in com.github.n8felton.pkg.Ant: Processor: PkgCreator: Error: Can't lchown /tmp/tmpvgk040r0/payload/usr/local/ant: [Errno 2] No such file or directory: '/tmp/tmpvgk040r0/payload/usr/local/ant'

Maven

PkgCreator
{'Input': {'pkg_request': {'chown': [{'group': 'wheel',
                                      'mode': '0755',
                                      'path': 'usr',
                                      'user': 'root'}],
                           'id': 'org.apache.maven',
                           'pkgdir': '/Users/<user>/Library/AutoPkg/Cache/com.github.n8felton.pkg.Maven',
                           'pkgname': 'Maven-3.6.3',
                           'pkgroot': '/Users/<user>/Library/AutoPkg/Cache/com.github.n8felton.pkg.Maven/payload',
                           'pkgtype': 'flat',
                           'version': '3.6.3'}}}
PkgCreator: Connecting
PkgCreator: Sending packaging request
PkgCreator: Disconnecting
PkgCreator: Failed to close socket: [Errno 9] Bad file descriptor
Traceback (most recent call last):
  File "/Library/AutoPkg/autopkglib/__init__.py", line 658, in process
    self.env = processor.process()
  File "/Library/AutoPkg/autopkglib/__init__.py", line 465, in process
    self.main()
  File "/Library/AutoPkg/autopkglib/PkgCreator.py", line 269, in main
    self.package()
  File "/Library/AutoPkg/autopkglib/PkgCreator.py", line 223, in package
    pkg_path = self.send_request(request)
  File "/Library/AutoPkg/autopkglib/PkgCreator.py", line 258, in send_request
    raise ProcessorError(", ".join([s.replace("ERROR:", "") for s in errors]))
autopkglib.ProcessorError: Can't lchown /tmp/tmp26xo4mhx/payload/usr/local/maven: [Errno 2] No such file or directory: '/tmp/tmp26xo4mhx/payload/usr/local/maven'
  File "/Library/AutoPkg/autopkglib/__init__.py", line 658, in process
    self.env = processor.process()
Can't lchown /tmp/tmp26xo4mhx/payload/usr/local/maven: [Errno 2] No such file or directory: '/tmp/tmp26xo4mhx/payload/usr/local/maven'
Failed.
Receipt written to /Users/<user>/Library/AutoPkg/Cache/com.github.n8felton.pkg.Maven/receipts/com.github.n8felton.pkg-receipt-20210217-174212.plist

The following recipes failed:
    com.github.n8felton.pkg.Maven
        Error in com.github.n8felton.pkg.Maven: Processor: PkgCreator: Error: Can't lchown /tmp/tmp26xo4mhx/payload/usr/local/maven: [Errno 2] No such file or directory: '/tmp/tmp26xo4mhx/payload/usr/local/maven'

If I remove the Symlinker steps, the .pkg successfully completes.

Any thoughts?

@n8felton
Copy link
Member

Yeah, AutoPkg needs a patch for this to work. Check out autopkg/autopkg#303 and specifically commit autopkg/autopkg@2f0844f. I just haven't had time to get back to it to get it fixed, and with it being broke this long, it appears I've pretty much been the only one using it, so I just patch my local install of AutoPkg when it comes up.

@MLBZ521
Copy link
Author

MLBZ521 commented Feb 18, 2021

Ah, ok. So I read through the history on MacAdmins #autopkg where this was discussed years ago before posting the issue. I just assumed since these recipes were added later, that that issue was resolved.

I've got a request for Ant from one of our Site Admins and they were wanting to basically do the same as you (location wise). So this seemed perfect. Would be nice to get this officially patched in the AutoPkg. (Considering, it doesn't appear that it would break anything existing.)

@MLBZ521
Copy link
Author

MLBZ521 commented Oct 30, 2022

I believe this issue can be closed now. Can you confirm @n8felton?

@MLBZ521
Copy link
Author

MLBZ521 commented Dec 19, 2022

I'm using

% /usr/local/bin/autopkg version
2.7.1

And not seeing this issue and I see the PR was merged into autopkg last year. Closing at this time.

@MLBZ521 MLBZ521 closed this as completed Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants