Project

Profile

Help

Maintenance: Planio will be observing a scheduled maintenance window this Tuesday, November 5, 2024 from 03:00 UTC until 06:30 UTC to perform urgent network maintenance in our primary data center. Your Planio account will be unavailable during this maintenance window.

Issue #7698

closed

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

Added by jsherril@redhat.com about 4 years ago. Updated almost 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
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 85
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'
Actions #1

Updated by dkliban@redhat.com about 4 years 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

Actions #2

Updated by ekohl about 4 years 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 /.

Actions #3

Updated by ttereshc about 4 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 83
Actions #4

Updated by rchan about 4 years ago

  • Sprint changed from Sprint 83 to Sprint 84
Actions #5

Updated by ppicka about 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ppicka
Actions #6

Updated by rchan about 4 years ago

  • Sprint changed from Sprint 84 to Sprint 85
Actions #7

Updated by pulpbot about 4 years ago

  • Status changed from ASSIGNED to POST
Actions #8

Updated by ppicka about 4 years ago

  • Project changed from Pulp to RPM Support

Added by ppicka almost 4 years ago

Revision 86162493 | View on GitHub

Sync to happen inside working directory

few downloads or testing remote remomd.xml file happened outside a working directory

[nocoverage] [notest]

closes: #7698 https://pulp.plan.io/issues/7698

Actions #9

Updated by ppicka almost 4 years ago

  • Status changed from POST to MODIFIED
Actions #10

Updated by dalley almost 4 years ago

  • Sprint/Milestone set to 3.8.0
Actions #11

Updated by pulpbot almost 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF