-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Scanning for audio files on external shares fills up local temporary file storage #68
Comments
Hello, |
analysis reference: /lib/private/Files/View.php => getLocalFile |
@learal thank you for the very valuable hint. I implemented the cleanup-handling and I am testing it locally. |
remote files (e.g. SMB) need to be on a local path for the getID3 scanner. getLocalFile() creates a Temp-File automatically in this case - but no cleanup exists. It is now validated if the file ist remote or encrypted. in this case a tmp-file is created and removed after the scanning again. #68
Hello, |
Hi @Rello, I reset the music library and then started the scan, but it doesn't seem to get past the I've been looking for logs to determine what might be happening, but haven't seen anything relevant. Where would that normally log to? Is there any additional debug logging I can switch on? Thanks, |
Hello Alan, please check owncloud.log in your nextcloud data folder. it should show what the problem is |
Hi @Rello, I'm still having the same problem, i.e. every time I click the "Scan for new audio files" (circular arrows icon) the scan starting dialog displays and then nothing else happens. I've checked the The main I tried adding some log lines into the scanForAudios() method, but those aren't being logged either. It's like the method is not being called for some reason. Actually, just digging around in the Thanks, |
Hi @Rello, Please disregard my last message. After looking around the code a bit more I noticed that the dialog that pops ups, i.e. "Scan for audio files" actually has a button on it that needs clicking to start scanning. With the default colour scheme on my monitor, combined with whatever angle I normally look at the screen, the box around the button is completely invisible. If I drop my head right down to look straight at that part of the screen it becomes visible !!! (I assumed clicking the update icon actually started the process.) Apologies for that. The scan is underway and there appears to be only a single
The mp3 one is being removed correctly but the other files are remaining, i.e. the zero-byte ones. I've a couple of thousand there so far. Alan. |
Hello, did your scan finish? |
Hi @Rello, |
=> next release |
remote files (e.g. SMB) need to be on a local path for the getID3 scanner. getLocalFile() creates a Temp-File automatically in this case - but no cleanup exists. => the original setup with the validation of encrypted/remote does not work as the storage wrapper does not work correctly with external files which are then shared to other users. => every time, a tmp-file will be created now. #68
Expected behavior
Scanning audio files on external shares should have no significant impact on the local file system of the owncloud/nextcloud server.
Actual behavior
The temporary storage location, i.e.
/tmp
, fills up withoc_tmp_XXXXXXXX.mp3
files.In
audioplayer/controller/scannercontroller.php
thescanForAudios()
method makes the following call:$ThisFileInfo = $getID3->analyze($userView->getLocalFile($audio['path']));
From what I can gather, where you are using external storage (e.g. SMB mount, FTP mount, etc.), the
getLocalFile()
method will download the file from the external storage into a temporary file and return the path to that file.There doesn't appear to be any kind of cleanup done of any temporary files created, either during or on completion of the scan. All audio files copied from external storage would be left there permanently and, I'm guessing, may actually be the files used when the user goes to play the audio file.
For me, this meant that every audio file in my collection was being copied into
/tmp
resulting in gigabytes of files filling up the entire partition. I had to shutdown NextCloud and manually remove about 12GB of these files from/tmp
before restarting and disabling the audioplayer app.Note regarding my setup:
I run NextCloud in a Docker container which has limited local storage as it is just supposed to hold the system files, etc. necessary to run NextCloud with all user data stored in locations mapped into the container from outside.
All my audio files are stored in a SMB share that is configured under "External Storage" in my NextCloud account.
Steps to reproduce the behavior
Possible solution (optional)
The scanning method should check whether each file returned from
getLocalFile()
is a temporary file, and where this is the case, once the relevant information has been extracted and added the the audio database, the file should be removed from the local file system.Any other uses of
getLocalFile()
outside of the scan method should also do likewise.Server configuration
Operating system:
Unraid 6.2.1 (Linux 4.4.23)
Docker container - lsiodev - nextcloud
Web server:
nginx
Database:
MariaDB
PHP version:
PHP 5.6.26
ownCloud/Nextcloud version: (see
/status.php
)NextCloud 10.0 (stable) (9.1.0.16)
Updated from an older ownCloud/Nextcloud or fresh install:
fresh install
Where did you install Audio Player from:
NextCloud built-in apps manager
Are you using external storage, if yes which one:
local/smb/sftp/...
Yes, SMB
Are you using encryption: yes/no
No
Client configuration
Operating system:
Browser:
Log
ownCloud/Nextcloud log (
/data/[owncloud|nextcloud].log
)The text was updated successfully, but these errors were encountered: