Project

Profile

Help

Issue #7698

Error when syncing a remote if systemd working dir is set to ~

Added by jsherril@redhat.com 8 days ago. Updated 5 days ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Sprint 84
Quarter:

Description

a recent change: https://github.com/theforeman/puppet-pulpcore/commit/b3b7c133c513dd2c30b00a81e64b2bb33ca92397

caused this error when syncing a remote:

        File "/usr/lib/python3.6/site-packages/rq/job.py", line 684, in perform
        self._result = self._execute()
        File "/usr/lib/python3.6/site-packages/rq/job.py", line 690, in _execute
        return self.func(*self.args, **self.kwargs)
        File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 213, in synchronize
        remote_url = fetch_remote_url(remote)
        File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 138, in fetch_remote_url
        downloader.fetch()
        File "/usr/lib/python3.6/site-packages/pulpcore/download/base.py", line 160, in fetch
        return done.pop().result()
        File "/usr/lib/python3.6/site-packages/pulpcore/download/base.py", line 227, in run
        return await self._run(extra_data=extra_data)
        File "/usr/lib/python3.6/site-packages/pulp_rpm/app/downloaders.py", line 89, in _run
        to_return = await self._handle_response(response)
        File "/usr/lib/python3.6/site-packages/pulpcore/download/http.py", line 184, in _handle_response
        await self.handle_data(chunk)
        File "/usr/lib/python3.6/site-packages/pulpcore/download/base.py", line 123, in handle_data
        self._ensure_writer_has_open_file()
        File "/usr/lib/python3.6/site-packages/pulpcore/download/base.py", line 108, in _ensure_writer_has_open_file
        self._writer = tempfile.NamedTemporaryFile(dir=os.getcwd(), delete=False)
        File "/usr/lib64/python3.6/tempfile.py", line 551, in NamedTemporaryFile
        (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
        File "/usr/lib64/python3.6/tempfile.py", line 262, in _mkstemp_inner
        fd = _os.open(file, flags, 0o600)
        PermissionError: [Errno 13] Permission denied: '/tmpw64sk7in'
        Traceback (most recent call last):
        File "/usr/lib/python3.6/site-packages/rq/worker.py", line 936, in perform_job
        rv = job.perform()
        File "/usr/lib/python3.6/site-packages/rq/job.py", line 684, in perform
        self._result = self._execute()
        File "/usr/lib/python3.6/site-packages/rq/job.py", line 690, in _execute
        return self.func(*self.args, **self.kwargs)
        File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 213, in synchronize
        remote_url = fetch_remote_url(remote)
        File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 138, in fetch_remote_url
        downloader.fetch()
        File "/usr/lib/python3.6/site-packages/pulpcore/download/base.py", line 160, in fetch
        return done.pop().result()
        File "/usr/lib/python3.6/site-packages/pulpcore/download/base.py", line 227, in run
        return await self._run(extra_data=extra_data)
        File "/usr/lib/python3.6/site-packages/pulp_rpm/app/downloaders.py", line 89, in _run
        to_return = await self._handle_response(response)
        File "/usr/lib/python3.6/site-packages/pulpcore/download/http.py", line 184, in _handle_response
        await self.handle_data(chunk)
        File "/usr/lib/python3.6/site-packages/pulpcore/download/base.py", line 123, in handle_data
        self._ensure_writer_has_open_file()
        File "/usr/lib/python3.6/site-packages/pulpcore/download/base.py", line 108, in _ensure_writer_has_open_file
        self._writer = tempfile.NamedTemporaryFile(dir=os.getcwd(), delete=False)
        File "/usr/lib64/python3.6/tempfile.py", line 551, in NamedTemporaryFile
        (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
        File "/usr/lib64/python3.6/tempfile.py", line 262, in _mkstemp_inner
        fd = _os.open(file, flags, 0o600)
        PermissionError: [Errno 13] Permission denied: '/tmpw64sk7in'

History

#1 Updated by dkliban@redhat.com 8 days ago

The download of repomd.xml occurs outside of the WorkingDirectory context manager[0]. The WorkingDirectory context manager does not seem to be used anywhere in the synchronize task.

[0] https://github.com/pulp/pulp_rpm/blob/3.7/pulp_rpm/app/tasks/synchronizing.py#L138

#2 Updated by ekohl 7 days ago

It's important to note we discovered WorkingDirectory=~ isn't supported in EL7's systemd version. In https://github.com/theforeman/puppet-pulpcore/commit/4bb4942c7be1cbd8466a703a4ee4dc7071713ead we changed it to absolute paths. That may have been the cause because it could have ended up working in /.

#3 Updated by ttereshc 7 days ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 83

#4 Updated by rchan 5 days ago

  • Sprint changed from Sprint 83 to Sprint 84

Please register to edit this issue

Also available in: Atom PDF