Bug 29156 - File missing warning in Koha::UploadedFile should be for permanent files only
Summary: File missing warning in Koha::UploadedFile should be for permanent files only
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Fridolin Somers
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-01 22:59 UTC by Fridolin Somers
Modified: 2022-02-24 22:09 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This removes the warning from the log files when temporarily uploaded files are deleted and the file no longer exists (for example, when the temporary files are in /tmp directory and the system is rebooted they are deleted).
Version(s) released in:
22.05.00,21.11.03,21.05.11


Attachments
Bug 29156: File missing warning in Koha::UploadedFile for permanent files only (1.51 KB, patch)
2021-10-01 23:10 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 29156: File missing warning in Koha::UploadedFile for permanent files only (1.56 KB, patch)
2021-11-30 09:05 UTC, David Nind
Details | Diff | Splinter Review
Bug 29156: File missing warning in Koha::UploadedFile for permanent files only (1.62 KB, patch)
2022-01-19 10:49 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2021-10-01 22:59:38 UTC
When an uploaded file is deleted, when file does not exist there is a warning :
"Removing record for file.txt within category koha_upload, but file was missing."

For temporary files, this warning is noisy.
For example when they are in /tmp, system reboot deleted them.

I propose to remove this warning for temporary files.
Comment 1 Fridolin Somers 2021-10-01 23:10:35 UTC
Created attachment 125645 [details] [review]
Bug 29156: File missing warning in Koha::UploadedFile for permanent files only

When an uploaded file is deleted, when file does not exist there is a warning :
"Removing record for file.txt within category koha_upload, but file was missing."

For temporary files, this warning is noisy.
For example when they are in /tmp, system reboot deleted them.

I propose to remove this warning for temporary files.

Test plan :
1) Upload a temporary and a permanent file via Tools > Upload
2) Delete the file on server
3) Delete the two files from Tools > Upload
4) Look at warning in log files
=> You see only warning for permanent file
Comment 2 Marcel de Rooy 2021-10-02 06:52:54 UTC
Please enter assignee, future RM :)
Comment 3 Fridolin Somers 2021-10-02 09:11:41 UTC
Oups, corrected :D
Comment 4 David Nind 2021-11-30 09:05:54 UTC
Created attachment 128101 [details] [review]
Bug 29156: File missing warning in Koha::UploadedFile for permanent files only

When an uploaded file is deleted, when file does not exist there is a warning :
"Removing record for file.txt within category koha_upload, but file was missing."

For temporary files, this warning is noisy.
For example when they are in /tmp, system reboot deleted them.

I propose to remove this warning for temporary files.

Test plan :
1) Upload a temporary and a permanent file via Tools > Upload
2) Delete the file on server
3) Delete the two files from Tools > Upload
4) Look at warning in log files
=> You see only warning for permanent file

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2021-11-30 09:48:22 UTC
Testing notes using koha-testing-docker (KTD):

- Location for temporary files in KTD is /var/lib/koha/kohadev/tmp/koha_kohadev_upload/

- Location for permanent files in KTD is /var/lib/koha/kohadev/uploads/
Comment 6 Martin Renvoize 2022-01-19 10:49:27 UTC
Created attachment 129597 [details] [review]
Bug 29156: File missing warning in Koha::UploadedFile for permanent files only

When an uploaded file is deleted, when file does not exist there is a warning :
"Removing record for file.txt within category koha_upload, but file was missing."

For temporary files, this warning is noisy.
For example when they are in /tmp, system reboot deleted them.

I propose to remove this warning for temporary files.

Test plan :
1) Upload a temporary and a permanent file via Tools > Upload
2) Delete the file on server
3) Delete the two files from Tools > Upload
4) Look at warning in log files
=> You see only warning for permanent file

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2022-01-19 10:49:51 UTC
Always good to reduce noise.. this makes sense.

Passing QA
Comment 8 Fridolin Somers 2022-01-22 07:40:32 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 9 Kyle M Hall 2022-02-07 11:59:08 UTC
Pushed to 21.11.x for 21.11.03
Comment 10 Andrew Fuerste-Henry 2022-02-21 14:46:22 UTC
Pushed to 21.05.x for 21.05.11
Comment 11 Victor Grousset/tuxayo 2022-02-24 22:09:50 UTC
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.