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

Temp dir filled with /tmp/nextcloud_photos_* files #2072

Closed
danielmarschall opened this issue Oct 6, 2023 · 2 comments · Fixed by #2596
Closed

Temp dir filled with /tmp/nextcloud_photos_* files #2072

danielmarschall opened this issue Oct 6, 2023 · 2 comments · Fixed by #2596
Labels
3. to review Waiting for reviews bug Something isn't working

Comments

@danielmarschall
Copy link

danielmarschall commented Oct 6, 2023

I have a lot of temp files in /tmp:

-rw------- 1 nextcloud         nextcloud         3,8M 17. Sep 01:10  nextcloud_photos_d9Ym8N
-rw------- 1 nextcloud         nextcloud         3,8M 17. Sep 02:10  nextcloud_photos_DMM0Wq
-rw------- 1 nextcloud         nextcloud         3,8M 24. Sep 23:45  nextcloud_photos_emig0d
-rw------- 1 nextcloud         nextcloud         3,8M 25. Sep 01:05  nextcloud_photos_fk7kzY

All have the same content.

Searching the code for nextcloud_photos_, I can see that in apps/photos/lib/Service/ReverseGeoCoderService.php the file was created in the following methods:

  • ReverseGeoCoderService::buildKDTree()
  • ReverseGeoCoderService::loadKdTree()

I do not see that the temp file gets deleted. Maybe I missed it, or they are actually never deleted.

Current system: nextcloud 27.1.2 on Debian 12 with PHP 8.2.7

@danielmarschall danielmarschall added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels Oct 6, 2023
@alx-tuilmenau
Copy link

Same Problem here. NC 26.0.7 / Photos 2.2.0 / PHP 8.2.11 on Debian 12. Got 12 instances of the same file with different suffixes since cleaning of /tmp yesterday.

Why there is the temporary copy of the cities1000.bin in loadKdTree() ? The FSKDTree constructor opens the file only read-only. For updating (via cron, but once per day should be enough) while other requests active it may be better to create the new file with a temp name, delete the original file and rename the temp file. The temp file should be in the same folder for this, because the sys_temp_dir is maybe on a different storage, so renaming / moving needs time if used.

May I ask why you don't put the geodata in the database and use SQL to get the nearest city ? Using "power(latitude-$lat,2)+power(longitude-$lon,2)" sort descending limit to 1 should do it for the nearest city?

@moltke69
Copy link

Some problem here. NC 28.01 / php 8.2.14 on Ubuntu 22.04

/tmp directory filled timewise with "nextcloud_photos_xxxxx" files. All the same size 3,8 M.

I just solve the problem for myself, that I installed a cron job to delete "tmp-files" like this older than 2 hours. But this does not solve the problem. Maybe NC Photo-App should look itself for "orphaned tmp-files" and delete them.

joshtrichards added a commit that referenced this issue Aug 13, 2024
Fixes #2072 

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added 3. to review Waiting for reviews and removed 0. Needs triage Pending approval or rejection. This issue is pending approval. labels Aug 13, 2024
backportbot bot pushed a commit that referenced this issue Aug 14, 2024
Fixes #2072 

Signed-off-by: Josh <josh.t.richards@gmail.com>
backportbot bot pushed a commit that referenced this issue Aug 14, 2024
Fixes #2072 

Signed-off-by: Josh <josh.t.richards@gmail.com>
backportbot bot pushed a commit that referenced this issue Aug 14, 2024
Fixes #2072 

Signed-off-by: Josh <josh.t.richards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants