Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport #9636 'FileNotFoundError: [Errno 2] No such file or directory: '' if custom repo metadata file does not have an expected filename format' to 3.11.z #2310

Closed
fao89 opened this issue Dec 22, 2021 · 3 comments
Assignees

Comments

@fao89
Copy link
Member

fao89 commented Dec 22, 2021

Author: @goosemania (ttereshc)

Bugzilla: https://bugzilla.redhat.com/buglist.cgi?quicksearch=2027127
Redmine Issue: 9644, https://pulp.plan.io/issues/9644


Pulp expects custom metadata files to have a specific format for filenames: -.

During sync or pulp-2to3-migration, users get FileNotFoundError: [Errno 2] No such file or directory: ' ' because the filename is only a checksum :/, which we remove to determine the filename, so the path we detect becomes an empty string.

Nov 22 21:31:34 1002a1103081001 pulpcore-worker-1: File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/migration.py", line 478, in migrate_repo_distributor
Nov 22 21:31:34 1002a1103081001 pulpcore-worker-1: pulp2dist, repo_version)
Nov 22 21:31:34 1002a1103081001 pulpcore-worker-1: File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/plugin/rpm/repository.py", line 91, in migrate_to_pulp3
Nov 22 21:31:34 1002a1103081001 pulpcore-worker-1: publish(repo_version.pk, checksum_types=checksum_types, sqlite_metadata=sqlite)
Nov 22 21:31:34 1002a1103081001 pulpcore-worker-1: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/publishing.py", line 344, in publish
Nov 22 21:31:34 1002a1103081001 pulpcore-worker-1: publication_data.populate()
Nov 22 21:31:34 1002a1103081001 pulpcore-worker-1: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/publishing.py", line 253, in populate
Nov 22 21:31:34 1002a1103081001 pulpcore-worker-1: self.repomdrecords = self.prepare_metadata_files(main_content)
Nov 22 21:31:34 1002a1103081001 pulpcore-worker-1: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/publishing.py", line 99, in prepare_metadata_files
Nov 22 21:31:34 1002a1103081001 pulpcore-worker-1: with open(path, "wb") as new_file:
Nov 22 21:31:34 1002a1103081001 pulpcore-worker-1: FileNotFoundError: [Errno 2] No such file or directory: ''
Nov 22 21:31:34 1002a1103081001 pulpcore-worker-1: pulp: rq.worker:INFO: 27738@1002a1103081001.xxx.com: c0d58c5a-9ff1-4d40-bbb3-9c24fdf0fdb4
Nov 22 21:31:34 1002a1103081001 pulpcore-resource-manager: pulp: rq.worker:INFO: resource-manager: 43f43c1a-d09e-46bd-99fe-73b6e2ee397c
Nov 22 21:31:34 1002a1103081001 pulpcore-worker-3: pulp: rq.worker:INFO: 27740@1002a1103081001.xxx.com: Job OK (b25f3fa2-401c-425c-92eb-b49a61415617)
Nov 22 21:31:34 1002a1103081001 pulpcore-worker-2: pulp: pulp_rpm.app.tasks.publishing:INFO: Publishing: repository=XXX-Red_Hat_Ansible_Engine_2_7_RPMs_for_Red_Hat_Enterprise_Linux_7_Server_x86_64, version=1
@fao89
Copy link
Member Author

fao89 commented Dec 22, 2021

From: pulpbot (pulpbot)
Date: 2021-12-20T16:35:35Z


PR: #2201

@goosemania goosemania self-assigned this Jan 3, 2022
goosemania added a commit to goosemania/pulp_rpm that referenced this issue Jan 4, 2022
It happens when a checksum is used as a filename for a custom repo metadata file.

All kudos for the fix go to @hao-yu.

backports pulp#2321
pulp#2321

fixes pulp#2310

(cherry picked from commit b7ba935)
goosemania added a commit that referenced this issue Jan 4, 2022
It happens when a checksum is used as a filename for a custom repo metadata file.

All kudos for the fix go to @hao-yu.

backports #2321
#2321

fixes #2310

(cherry picked from commit b7ba935)
@dkliban dkliban closed this as completed Jan 5, 2022
@dkliban
Copy link
Member

dkliban commented Jan 5, 2022

I am temporarily closing this issue to make sure that the status is updated in the BZ. I will reopen later today.

@dkliban dkliban reopened this Jan 5, 2022
@dkliban dkliban closed this as completed Jan 5, 2022
@dkliban dkliban reopened this Jan 6, 2022
@goosemania
Copy link
Member

Fixed and released in 3.11.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants