Project

Profile

Help

Issue #5870

closed

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

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

Status:
CLOSED - CURRENTRELEASE
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 63
Quarter:

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.

Actions #1

Updated by jsherril@redhat.com over 4 years ago

  • Tags Katello-P2 added
Actions #2

Updated by jsherril@redhat.com over 4 years ago

  • Description updated (diff)
Actions #3

Updated by fao89 over 4 years ago

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

Updated by bmbouter over 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to bmbouter
Actions #5

Updated by bmbouter over 4 years ago

I reproduced this issue.

Actions #6

Updated by bmbouter over 4 years ago

  • Status changed from ASSIGNED to POST

Added by bmbouter over 4 years ago

Revision 07340fd0 | 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

Actions #7

Updated by bmbouter over 4 years ago

  • Status changed from POST to MODIFIED

Added by bmbouter over 4 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)

Added by bmbouter over 4 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)

Actions #10

Updated by bmbouter over 4 years ago

  • Project changed from File Support to Pulp

Moving to pulp project since the fix is released there.

Actions #11

Updated by bmbouter over 4 years ago

  • Sprint/Milestone set to 3.0.1
Actions #12

Updated by bmbouter over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions #13

Updated by ggainey almost 4 years ago

  • Tags Katello added
  • Tags deleted (Katello-P2)

Also available in: Atom PDF