Project

Profile

Help

Issue #5870

file remotes with file:// urls pointing to a read-only directory fail to sync

Added by jsherril@redhat.com 3 months ago. Updated about 1 month ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Katello-P2
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 63

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.

Associated revisions

Revision 07340fd0 View on GitHub
Added by bmbouter about 2 months ago

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

Revision e40794ba View on GitHub
Added by bmbouter about 1 month ago

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)

Revision 95e88eb3 View on GitHub
Added by bmbouter about 1 month ago

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)

History

#1 Updated by jsherril@redhat.com 3 months ago

  • Tags Katello-P2 added

#2 Updated by jsherril@redhat.com 3 months ago

  • Description updated (diff)

#3 Updated by fabricio.aguiar 3 months ago

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

#4 Updated by bmbouter about 2 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to bmbouter

#5 Updated by bmbouter about 2 months ago

I reproduced this issue.

#6 Updated by bmbouter about 2 months ago

  • Status changed from ASSIGNED to POST

#7 Updated by bmbouter about 2 months ago

  • Status changed from POST to MODIFIED

#10 Updated by bmbouter about 1 month ago

  • Project changed from File Support to Pulp

Moving to pulp project since the fix is released there.

#11 Updated by bmbouter about 1 month ago

  • Sprint/Milestone set to 3.0.1

#12 Updated by bmbouter about 1 month ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF