Announcements

FLAC files in Downloads directory opened, accessed and locked by client

FLAC files in Downloads directory opened, accessed and locked by client

awesomerdotcom

Plan

Premium

Country

USA

Device

PC

Operating System

Windows 10

 

My Question or Issue

Ever since the most recent update, the desktop Spotify Client has been accessing FLAC files (.flac) in my Downloads directory. Given that I haven't asked Spotify to monitor my Downloads directory and that the client keeps each of these files open in such a way that I can't delete them or the directories that contain them, this seems like a serious issue. This seems especially serious because Spotify doesn't support importing FLAC files into your local library [1] so why is it opening them at all?

MP3 files, which ARE supported, do not exhibit this behavior. New FLAC files created outside of the Downloads directory also do not exhibit this behavior. This strongly suggests that the new Spotify Client has been specifically coded to interact with FLAC files in the Downloads directory only.

How to reproduce :
0) Create FLAC file in Downloads directory
1) Start Spotify Client
2) Try to delete that file and explorer says "The action can't be completed because the file is open in Spotify." This happens immediately if one creates a new FLAC file, suggesting that the Spotify Client is "watching" the Downloads directory.
3) Close Spotify Client
4) Try to delete the file again and it works

Please fix this. Also, I would appreciate an explanation for why Spotify's Client is doing this obviously inappropriate access to files in the User's Downloads directory. This seems like a serious privacy concern and the community deserves an explanation.

[1] https://community.spotify.com/t5/Closed-Ideas/Music-Local-FLAC-Playback/idi-p/124168

spotify.locking.flac.files.in.downloads.directory.PNG
Reply
12 Replies

Jeremy

Hi there @awesomerdotcom,

 

Thank you for reaching out to us here in the Community. We're happy to help.

 

Can you check if "Show Local Files" is open in the settings? If not we suggest that you activate it so that the other related options are shown.

 

After that, deactivate "Downloads" and "Music Library" and then deactivate "Show Local Files" again.

Let us know how everything goes so that we can continue to assist you if you need us to 🙂

Take care!

JeremyModerator
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Live, love, laugh and listen to music 🙂

awesomerdotcom

Thank you for your response.

After checking "Show Local Files," "Downloads" was in fact checked. Upon un-checking it, the problem stopped affecting any newly created FLAC file in the Downloads directory. However, the following sequence of events is still an issue.
 
1) Check "Show Local Files."
2) Check "Downloads"
3) Create FLAC file in Downloads directory
4) Un-check "Downloads" (and, optionally, "Show Local Files")
5) File created in 3) cannot be deleted (unless Spotify client is closed) because Spotify has it open

It seems unexpected and quite bad that :
a) The client is accessing files in the Downloads directory despite explicitly being told by the user not to
b) The client is accessing local files despite being told to not monitor local files at all
c) The client is accessing FLAC files despite Spotify not supporting FLAC files

Novy

Hey @awesomerdotcom

 

Thanks for your reply. 

 

FLAC Local Files support is being added. It's currently expected that the file is marked as in use when the app is open and it's set to monitor the Downloads folder. This is because the app is adding the file to the cache, so it's ready for playback. If it was suddenly moved, this would cause difficulties, so it's somehow reserving it.

 

That's why the file can be modified when the app is closed, and Spotify won't add it to the local files on the next relaunch. Same as when the setting to monitor this folder is turned off. The refresh however occurs after a restart of the app, hence why turning it off while the app is open does not free up this reservation.

 

Hope this helps. If you have any other questions, don't hesitate to let us know.

 

Cheers.

NovyModerator
Help others find this answer and click "Accept as Solution".
If you appreciate an answer, maybe give it a Like.
Are you new to the Community? Take a moment to introduce yourself!

awesomerdotcom

> FLAC Local Files support is being added.

This is great to hear, this is a long-requested feature.

> It's currently expected that the file is marked as in use when the app is open and it's set to monitor the Downloads folder. This is because the app is adding the file to the cache, so it's ready for playback. If it was suddenly moved, this would cause difficulties, so it's somehow reserving it.


It makes sense that the file would be temporarily locked, but the current behavior is that it is permanently locked. I set up a test where I created a new FLAC file in my Downloads folder and used the WSL bash shell to try to delete it every 30 seconds. It has now been unable to delete the file for over 12 hours, which is presumably much longer than it would take to add it (or, indeed, all FLAC files in the Download directory) to the cache.  

I continue to feel that this behavior as currently implemented is an error which will lead to user confusion and negative experience. Thank you for your engagement in detail regarding this issue.

Novy

Hi @awesomerdotcom

 

Thanks for getting back to us. 

 

Just to confirm, if you disable monitoring of that folder, are the files freed up after a Spotify restart even while the app is running?

 

Keep us posted. 

NovyModerator
Help others find this answer and click "Accept as Solution".
If you appreciate an answer, maybe give it a Like.
Are you new to the Community? Take a moment to introduce yourself!

awesomerdotcom

I don't understand what you mean by "the app" in your last question. The WSL shell based process I was using to test whether I could delete is the equivalent of my clicking "delete" on the file every 30 seconds in Windows Explorer. As such, there is no "app" continuously "running" between deletion attempts.

If you're asking about some process by which I can "restart Spotify" without closing the Spotify app, I am unaware of a process by which one can do that.

Under all circumstances I've tested so far, disabling the "Downloads folder" switch from monitoring and restarting the Spotify client releases the lock on the files.

Jeremy

Hi there @awesomerdotcom,


Thank you for your reply.

 

By the app we mean the Spotify app.

 

The files will be locked based on the explanation provided in the past post as the app is "reserving" the files for playback. That's why there're options in the app to prevent this from happening if you don't want this to be the case in this particular folder.

 

Overall the app seems to be working as expected and is not reserving any files when it's either not in use or when the appropriate settings have been toggled.

 

Let us know if we can help you with anything else.

 

Take care!

JeremyModerator
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Live, love, laugh and listen to music 🙂

awesomerdotcom

> The files will be locked based on the explanation provided in the past post as the app is "reserving" the files for playback. That's why there're options in the app to prevent this from happening if you don't want this to be the case in this particular folder.


But... when "Show Local Files" is unchecked, it shouldn't be interacting with my local files. Having to check "Show Local Files" and then uncheck "Show Songs From -> Downloads" is clearly a bug. If "Show Local Files" is unchecked, every user would expect that to include not showing local files from the Downloads directory, because "Not Showing Local Files" is a superset of "Not Showing Local Files (in the Downloads Directory."

> Overall the app seems to be working as expected and is not reserving any files when it's either not in use or when the appropriate settings have been toggled.

With all due respect, this doesn't make any sense. It isn't doing the same thing to mp3 files. If this is expected behavior, why isn't it also doing it to mp3 files?

It is also still accessing the files when the appropriate settings have been toggled off. The lock is only released after a restart of the app. This also seems like unintuitive, unexpected behavior. If I tell the client to stop monitoring files in my Downloads directory, I do not expect it to continue to monitor files in the Downloads directory until restarted. I expect it to... stop monitoring files in my Downloads directory.

If the FLAC support feature launches as currently implemented, you will receive support contacts from people who are confused as to why the FLAC support requires an exclusive lock when mp3 support does not, and why the app acquires and maintains this lock when the user explicitly tells it not to via settings. I have used music player software for literally 20 years and have never used a player which has this locking behavior.

Mihail

We understand where your expectations are coming from @awesomerdotcom, but it just seems those differ from how the development team has made the app for now. Of course we'll pass this on and the app might change in the future to more align with your preferences, but for now we can't promise you that this will be prioritized.

 

The "Show Local Files" toggle enables the display in the app, but does not influence the underlaying folders that the app uses to cache local files. This so that users can quickly switch between the option to have local files shown or not, without the need to re-cache people's music libraries, some which might be quite extensive.

 

And you're right - the toggle does currently require a restart of the app to stop monitoring of the folder, but as this should be a one-off decision to either be On or Off, we don't expect constant toggles and as such any big issues with that. Remember, that a lot of apps require a restart after making certain changes or after updates are installed in order for those to take effect. This is one of those cases and is necessary due to technical reasons.

 

Regarding the difference between mp3 files and FLAC files - this happens, because they're, well, different file types. In order to prevent Spotify's cache for growing too much with lossless FLAC files, they're handled a bit differently than MP3s who can be quickly cached. As we roll out support for HiFi playback, we'll do our best to improve on it, so this again might be remedied in the future.

 

Hope this all makes sense, we really don't want to cause any frustration, but at the same time, we don't want to overpromise something. As before, the best solution if you frequently download FLAC files to the Downloads folder is to disable monitoring for it and you'll have no issues modifying those while the app is running.

 

All the best!

Mihail Moderator
Help others find this answer and click "Accept as Solution".
If you appreciate an answer, maybe give it a Like.
Are you new to the Community? Take a moment to introduce yourself!

Dougie18

I've been absolutely driven nuts since the big update. I have a huge library of flac files which spotify will scan, lock and eventually crash. It wasn't until I clicked show local files that I noticed there were options for my downloads folder and music library. THIS IS NOT APPARENT TO THE USER. I have a video of a fresh spotify install where where the app will crash at 3.5 GB of ram while doing nothing. This should be a top tier priority bug. I understand you want to pre cache music so if the user selects show local files it's ready but if the app is crashing because by default it's scanning some 300 GB of files then fix the crash first. I've got a feeling that this was happening on android as well because after the big update there I had the same symptoms of crashing.

sappy00

This shouldn't have been an opted in by default setting. Accessing personal files without express permissions smells a lot like spyware. I've uninstalled Spotify because of this "feature".

ade_m

Hi Suppor folks,

 

I just hit this issue I think with (Spotify for Windows 1.1.68.632.g2b11de83)

I was updating my own FLAC files, in my Music folder.  I was using MediaMonkey 5 to do so, and I found the TAGs of the files were not being updated. (MM Forum)

 

Spotify is NOT set to show local files.

I ended up using sysinternals handle.exe, which identified it was spotify.exe that had locks on some of the files.

 

If Local Files is NOT on, then why does spotify.exe have any file handles open at all, for any reason ?  This makes me think spotify is scanning my local files whether I want it to or not.

 

I'd agree with the comments here.  If spotify is just Reading files, then there should be no locks at all.  You don't need to open a write-lock on the file just to read it.  And if you are, then once you finished reading it, then that lock should be cleared.

 

However, as I don't even have local files enabled in the app, it shouldn't even be scanning them.

I'd agree this is a serious breach of the app.  There shouldn't be any "loading into cache".. there shouldn't even be any scanning of files happening, never mind opening lock files.


I'd have to assume that spotify.exe is actually scanning ALL my files - and thats of a huge concern to me.

 

This would seem to be a bug no ?

Suggested posts

Env: prod