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

Deleted packages not removed from repodata #3507

Open
wojnilowicz opened this issue Nov 9, 2024 · 9 comments · May be fixed by #3524
Open

Deleted packages not removed from repodata #3507

wojnilowicz opened this issue Nov 9, 2024 · 9 comments · May be fixed by #3524
Assignees

Comments

@wojnilowicz
Copy link

Steps that lead me to this issue:

  1. I built rust-unicase_serde in COPR
  2. I built rust-rocket_cors that depends on the previous rust-unicase_serde in COPR
  3. I got rust-unicase_serde accepted in Fedora, so it's already in Fedora's repo
  4. I remove rust-unicase_serde from COPR
  5. I try to rebuild rust-rocket_cors in COPR

Behavior:
It failed with

Not finished - interrupted by error: Status code: 404 for https://download.cFailed to download packages
 Librepo error: Status code: 404 for https://download.copr.fedorainfracloud.org/results/wojnilowicz/activitywatch/fedora-40-x86_64/07436781-rust-unicase_serde/rust-unicase_serde+default-devel-0.1.0-1.fc40.noarch.rpm (IP: 108.138.85.40)

Additional information:
copr regenerate-repos doesn't help.

Suggested fix:
Could you make copr regenerate-repos to purge whole repodata beforehand, so no nonexistent packages linger there?

@wojnilowicz
Copy link
Author

A workaround is to go to the Settings tab and under "3. Other options" set "Repo priority:" to "100". After that rust-unicase_serde is installed from the Fedora repository and not my nonexisting COPR package.

@nikromen
Copy link
Member

hmmm this seems like a regression, could this be a bug from adding the pulp features and moving corresponding code around, @FrostyX ?

@praiskup praiskup moved this from Needs triage to In Progress in CPT Kanban Nov 13, 2024
@solopasha
Copy link

I think COPR used to regenerate /devel repo(with enabled "Create repositories manually") when a build is deleted, but doesn't do it anymore.

@FrostyX
Copy link
Member

FrostyX commented Nov 19, 2024

Thank you for the hint. That sounds like it could be the problem, but I think Copr still regenerates the devel repo when deleting a build. At least to me it seems so.

I created a project with manual createrepo enabled and Copr generated this repository
https://copr-be.cloud.fedoraproject.org/results/frostyx/test-devel/fedora-40-x86_64/devel/
(I am linking a non-CDN backend URL here)

The repository was created at
2024-Nov-19 22:35:00

Then I submitted a build. The repository was regenerated at
2024-Nov-19 22:37:29

Then I deleted the build and the repository was regenerated at
2024-Nov-19 22:45:40

So it seems fine to me. Do you have a different reproducer?

@FrostyX
Copy link
Member

FrostyX commented Nov 19, 2024

@wojnilowicz can you please link the specific Copr build where this happened?

@FrostyX
Copy link
Member

FrostyX commented Nov 19, 2024

Suggested fix:
Could you make copr regenerate-repos to purge whole repodata beforehand, so no nonexistent packages linger there?

Looking at the code, we should do exactly this.

# Run createrepo first and then remove the files (to avoid old
# repodata temporarily pointing at non-existing files)!
# In srpm-builds we don't create repodata at all
if chroot != "srpm-builds":
repo = call_copr_repo(
chroot_path, delete=subdirs, devel=self.devel,
appstream=self.appstream, logger=self.log)
if not repo:
result = False
for build_id in build_ids or []:
log_paths = [
os.path.join(chroot_path, build_chroot_log_name(build_id)),
# we used to create those before
os.path.join(chroot_path, 'build-{}.rsync.log'.format(build_id)),
os.path.join(chroot_path, 'build-{}.log'.format(build_id))]
for log_path in log_paths:
try:
os.unlink(log_path)
except OSError:
self.log.debug("can't remove %s", log_path)

@solopasha
Copy link

I dunno... I did the same steps (created a project with manual createrepo enabled, submitted a build with fedpkg copr-build, deleted the build via the web interface) and it's still there:
https://copr-be.cloud.fedoraproject.org/results/solopasha/devel-test/fedora-40-x86_64/devel/repodata/

❯ dnf --refresh --repofrompath 'test,https://copr-be.cloud.fedoraproject.org/results/solopasha/devel-test/fedora-40-x86_64/devel/' rq --repo=test
Updating and loading repositories:
 test                                                                                                       100% |   3.5 KiB/s |   1.5 KiB |  00m00s
Repositories loaded.
dummy-package-0:0-1.fc40.src
dummy-package-0:0-1.fc40.x86_64

@FrostyX
Copy link
Member

FrostyX commented Nov 20, 2024

Thank you very much for helping me debug this @solopasha. I probably wouldn't find the culprit otherwise.
What revealed the problem is that for my repository, it worked as expected but for yours, it indeed didn't work. And the difference was ... I used the "Delete" button in the build detail page, and you used the "Delete all marked" button.

I played with it, and it seems to ignore the manual createrepo flag. I will send a PR to fix it.

@FrostyX
Copy link
Member

FrostyX commented Nov 20, 2024

hmmm this seems like a regression, could this be a bug from adding the pulp features and moving corresponding code around, @FrostyX ?

@nikromen it indeed seems to be a regression caused by the features you are mentioning. We previously did this
c5166a1#diff-717d47c392da08d2b79bec8392ecfd78bb404644caeab3b717d3ae193307e20aL232
and the line got lost

FrostyX added a commit to FrostyX/copr that referenced this issue Nov 20, 2024
Fix fedora-copr#3507

The issue was introduced in PR fedora-copr#3330. We previously did this on
the backend:

    devel = uses_devel_repo(self.front_url, ownername, projectname)

It looks like an unnecessary request, so I am sending the attribute
as a part of the action data.
FrostyX added a commit to FrostyX/copr that referenced this issue Nov 20, 2024
Fix fedora-copr#3507

The issue was introduced in PR fedora-copr#3330. We previously did this on
the backend:

    devel = uses_devel_repo(self.front_url, ownername, projectname)

It looks like an unnecessary request, so I am sending the attribute
as a part of the action data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

4 participants