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

[BUG] deleted packages cleanup doesn't work #1533

Closed
Minikea opened this issue Jul 6, 2023 · 3 comments
Closed

[BUG] deleted packages cleanup doesn't work #1533

Minikea opened this issue Jul 6, 2023 · 3 comments

Comments

@Minikea
Copy link

Minikea commented Jul 6, 2023

OCS Inventory version
Version : 2.11.1

Describe the bug
When you delete a package that have been deployed, you a line with "Unknown (deleted package)" on the deployment history of concerned computers
image
I clear this history with a SQL request :
DELETE DH FROM download_history DH LEFT JOIN download_available DA on DH.PKG_ID = DA.FILEID WHERE DA.FILEID IS NULL;
The request works and the history is cleared.
The bug is that it appeared to be temporary : the next day the lines "Unknown (deleted package)" are back.

To Reproduce
Steps to reproduce the behavior:

  1. create a deployment package
  2. deploy the package on some computers
  3. delete the package once it is deployed successfully
  4. purge the download_history from the ID of the package deleted
  5. wait one day
  6. the lines are back

Expected behavior
the lines stays deleted

addendum
I have these cron jobs:
/usr/share/ocsinventory-reports/ocsreports/crontab/cron_cve.php
/usr/share/ocsinventory-reports/ocsreports/crontab/cron_cve_computer.php

@Minikea Minikea changed the title [BUG] [BUG] deleted packages cleanup doesn't work Jul 6, 2023
@Lea9250
Copy link
Contributor

Lea9250 commented Oct 4, 2023

Hi @Minikea,

We do have a cron script in charge of clearing the history if the package has been deleted (cron_purge_history.php). However, even when using the script, I am able to reproduce the behavior you reported. We'll investigate the issue and keep you updated.

Regards,
Léa

@Lea9250
Copy link
Contributor

Lea9250 commented Dec 11, 2023

HI @Minikea,

There is an open PR that should fix this issue on the server repository : OCSInventory-NG/OCSInventory-Server#445

If you are willing to test it, any feedback will be appreciated. Either way I will update this issue once this has been reviewed and hopefully merged.

Best regards,
Léa

@charleneauger
Copy link
Member

Hi @Minikea,

Since the PR mentionned by @Lea9250 has been merged, I close the issue.

Best regards,
Charlene

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

6 participants