Issue #5870
closedfile remotes with file:// urls pointing to a read-only directory fail to sync
Description
Steps to reproduce:
1. Create some file repository in /file
2. Set permissions on it:
chown root:root /file -R
chmod 755 /file -R
3. create a remote pointed to file:///file/PULP_MANIFEST
4. Sync the remote with repository
You will get an error:
traceback: |2
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py", line 822, in perform_job
rv = job.perform()
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 605, in perform
self._result = self._execute()
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 611, in _execute
return self.func(*self.args, **self.kwargs)
File "/usr/local/lib/pulp/src/pulp-file/pulp_file/app/tasks/synchronizing.py", line 45, in synchronize
dv.create()
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/pulpcore/plugin/stages/declarative_version.py", line 149, in create
loop.run_until_complete(pipeline)
File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/pulpcore/plugin/stages/api.py", line 209, in create_pipeline
await asyncio.gather(*futures)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/pulpcore/plugin/stages/api.py", line 43, in __call__
await self.run()
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/pulpcore/plugin/stages/artifact_stages.py", line 196, in run
d_artifact.artifact for d_artifact in da_to_save)):
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/pulpcore/app/models/content.py", line 42, in bulk_get_or_create
return super().bulk_create(objs, batch_size=batch_size)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/query.py", line 468, in bulk_create
self._batched_insert(objs_with_pk, fields, batch_size, ignore_conflicts=ignore_conflicts)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/query.py", line 1204, in _batched_insert
ignore_conflicts=ignore_conflicts,
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/query.py", line 1186, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/sql/compiler.py", line 1334, in execute_sql
for sql, params in self.as_sql():
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/sql/compiler.py", line 1278, in as_sql
for obj in self.query.objs
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/sql/compiler.py", line 1278, in <listcomp>
for obj in self.query.objs
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/sql/compiler.py", line 1277, in <listcomp>
[self.prepare_value(field, self.pre_save_val(field, obj)) for field in fields]
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/sql/compiler.py", line 1228, in pre_save_val
return field.pre_save(obj, add=True)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/pulpcore/app/models/fields.py", line 62, in pre_save
return super().pre_save(model_instance, add)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/fields/files.py", line 288, in pre_save
file.save(file.name, file.file, save=False)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/fields/files.py", line 87, in save
self.name = self.storage.save(name, content, max_length=self.field.max_length)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/pulpcore/app/models/storage.py", line 108, in save
return self._save(name, content)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/files/storage.py", line 261, in _save
file_move_safe(content.temporary_file_path(), full_path)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/files/move.py", line 80, in file_move_safe
os.remove(old_file_name)
description: "[Errno 30] Read-only file system: '/mnt/disk/file1/4.iso'"
if you chmod 777 /file, it syncs fine fine.
Updated by fao89 almost 5 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 63
Updated by bmbouter almost 5 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to bmbouter
Updated by bmbouter almost 5 years ago
- Status changed from ASSIGNED to POST
PR available at: https://github.com/pulp/pulpcore/pull/486
Added by bmbouter almost 5 years ago
Updated by bmbouter almost 5 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp:pulpcore|07340fd04047141f30c216517778010193a0e555.
Added by bmbouter almost 5 years ago
Revision e40794ba | View on GitHub
Copy files when they originate out of MEDIA_ROOT
Django would move files in cases where the source was a file:/// repository.
https://pulp.plan.io/issues/5941 closes #5941
https://pulp.plan.io/issues/5870 closes #5870
(cherry picked from commit 07340fd04047141f30c216517778010193a0e555)
Updated by bmbouter almost 5 years ago
Applied in changeset pulp:pulpcore|e40794bad5f5a5084d37d9998d4fa4235f6ea25f.
Added by bmbouter almost 5 years ago
Revision 95e88eb3 | View on GitHub
Copy files when they originate out of MEDIA_ROOT
Django would move files in cases where the source was a file:/// repository.
https://pulp.plan.io/issues/5941 closes #5941
https://pulp.plan.io/issues/5870 closes #5870
(cherry picked from commit 07340fd04047141f30c216517778010193a0e555)
Updated by bmbouter almost 5 years ago
Applied in changeset pulp:pulpcore|95e88eb3ab5b9bb7472a26427a5e17a2fd12e7db.
Updated by bmbouter almost 5 years ago
- Project changed from File Support to Pulp
Moving to pulp project since the fix is released there.
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Updated by ggainey over 4 years ago
- Tags Katello added
- Tags deleted (
Katello-P2)
Copy files when they originate out of MEDIA_ROOT
Django would move files in cases where the source was a file:/// repository.
https://pulp.plan.io/issues/5941 closes #5941
https://pulp.plan.io/issues/5870 closes #5870