nextcloud / nextcloud/files_antivirus

Housekeeping of files which are deleted or no longer exist

Open
#158 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
112
Forks
44
Avg merge
1d 6h
Merged PRs (30d)
20

Description

Steps to reproduce
  1. Add a file through the UI
  2. sudo runuser -u nginx -- php -f /nextcloud/html/cron.php
  3. Check oc_files_antivirus table which should now include the new file
  4. Delete file through the UI
  5. sudo runuser -u nginx -- php -f /nextcloud/html/cron.php

Additional steps to try and invoke the intended behaviour

  • Update check_time for the file to be beyond 28 days
Expected behaviour

The oc_files_antivirus table should no longer have an entry for the file

Actual behaviour

The oc_files_antivirus has files which no longer exist and no house keeping performed

Server configuration

Operating system:
RHEL 7
Web server:

Database:
Postgres 11.6
PHP version:
7.1
Nextcloud version: (see Nextcloud admin page)
0.17.2

Where did you install Nextcloud from:
Direct

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or

Insert your config.php content here
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)
Client configuration

Browser:

Operating system:

Logs
Nextcloud log (data/owncloud.log)
Insert your Nextcloud log here
Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the cron.php execution described in the reproduction steps and trace how entries in the oc_files_antivirus table are created and checked using check_time. Reproduce the sequence with a deleted file, then verify that running the cron job after the relevant time threshold leaves no entry for that file.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, postgres
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.