View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0019887||MMA||Synchronization||public||2023-03-24 19:18||2023-05-12 11:47|
|Status||resolved||Resolution||no change required|
|Target Version||2.0.0||Fixed in Version||2.0.0|
|Summary||0019887: Permission problems when syncing to SD Cards and/or non-standard directory|
|Description||When MM runs it grants access to directories such as /Music and /Movies and syncing to these directories works as expected. However, when:|
a) Directories such as /Music don't exist on the SD card
--> MediaMonkey doesn't create/grant access to the directory
b) The user syncs to directories other than those to which permissions have been granted (e.g. using a mask beginning with /<Folders> )
--> MediaMonkey doesn't grant access to the individual directories
...which results in the following problems:
1) MediaMonkey changes the directories that are scanned to include _all_ directories on the SD card resulting in all sorts of personal (e.g. whatsapp) media getting added to the library
2) Content is synced to MediaMonkey Internal directory instead of the configured directory
3) It's not possible to delete the personal media from the library in a way that allows the user to continue using MMA because:
a) If the user tries deleting the personal content from the library, the user is prompted to grant access and when they choose the relevant directory, the "Path '<path>' was not requested..." error occurs.
b) If the user tries to change Library & Sync > Choose Library folders by removing 'SD Card (all)' then all content disappears from the library. And according to the user, if they change the configuration to SD Card/desired path, it just gets changed back to SD Card (all) on the next sync operation.
|Steps To Reproduce||Tested on Android 12 / Galaxy S10|
Possibly related issue:
|Tags||No tags attached.|
|Fixed in build||1074|
|related to||0018458||closed||martin||MMA||Grant Access to SDcard fail|
|related to||0018853||closed||martin||MMA||Permissions: Some devices require that MM is allowed to root of SDcard and not just Music folder|
|related to||0019122||resolved||martin||MMW 5||Required changes on MM5 side (USB synchronization with Android 11)|
|related to||0019875||closed||martin||MMA||Tracks can't be deleted (regression)|
|related to||0020021||resolved||martin||MMA||Permission problems on samsung devices|
The issue seems to be even worse than originally described, since case A) seems to trigger the bugs (or a subset of them) even if the user manually recreates a /Music directory !
(i.e. in that case MMA still fails to prompt the user to grant access to the /Music directory)!
||This bug is regression from fixes 0018853 and 0018458|
||Fixed in build 126.96.36.1994|
||Verified 1074 On Android 9/10 No regressions introduced and if I do not grant access MM folder is used for sync.|
Tested 1074 as follows:
1 Clean install of MMA with no /Music Folders
2 Connected Wi-Fi sync without syncing for:
- Internal Storage (plist1)
- SD Card (plist2)
3 Configured sync profile for Internal Storage to sync to \My Music\<Folder> and enabled delete library tracks not on the sync list
(sync profile for SD card was left with the default settings except for deletion of library tracks not on the sync list)
4 Initiated Wi-Fi Sync
--> MMA prompted to grant access to Internal Storage > /Music
--> MMA did _not_ prompt to grant access to SD Card > /Music!
5 Attempted to grant access
--> Error: Internal Storage/Music was not requested....!
6 Clicked 'Skip' to skip granting access
7 Clicked Sync Now
--> All tracks and playlist successfully synced (both internal storage and SD card) to MMA (private) storage
8 Changed playlists on the sync lists for both internal and external storage and initiated sync
--> Tracks/Playlists deleted successfully, and new tracks/playlists synced successfully
Debug log: FLWCCATG6M
So the only questions are:
1) At step 4, why did MMA prompt for access to /Music but not SD Card /Music ? I would have expected that:
- It wouldn't have prompted for /Music because that directory wasn't being synced to
- It would have prompted for SD Card/Music because that directory was being synced to (i.e. notwithstanding what you wrote at ~71403 , can't MMA prompt for access and create the directory
2) Why did an error result in response to the attempt to the prompt to grant access to /Music ?
3) Lastly, when I subsequently attempted to sync a playlist containing a classical music file (which has the default mask of \Music\Classical\<Composer>\<Album>\<Track #:2> $Left(<Artist>,20) - <Title> ), MMA created the /Music directory and synced the classical music file! How can this happen if the directory didn't exist and access was never even granted?! Or phrased differently, if this works without specifically granting access to the /Music folder, then why do we need to even bother with prompting for access to the /Music folder and shouldn't this work for the SD card as well?
Debug log: 6AN6WBR9PY
1) Music folder is not requested only when it does not exist.
2) if the toast message "Internal Storage/Music was not requested" occurred, it was fake. I will try to replicate it.
[Edit by Rusty]: To clarify, permissions _were_ granted, but Android, for some reason didn't reflect the change, resulting in the MMA error.
3) MMA can't create a directory if permission is missing, but based on log FLWCCATG6M, the folder primary:Music exists and permission was granted.
[Edit by Rusty]: It seems that Android created the Internal > /Music directory on its own between the time that MMA had been run and when the second Wi-Fi Sync operation had been carried out. Android seems to create this directory automatically for Internal storage but not External storage, which accounts for why synchronization to the SD Card behaved differently.
||Based on Martin's findings, this issue can either be closed, or left open as a lower-priority issue in case it's possible to fix the problem of the inaccurate error message at step 5.|
I suggest closing the issue until we find out steps to replicate "fake message issue" and then we can create a new issue for it.
I have tested it for several hours, but I was unable to replicate it, so it's gonna be a very rare case.
||Retested 1076 with SD Cards and non-standard directories and cannot replicate any issues.|
The user at https://www.mediamonkey.com/forum/viewtopic.php?p=508916#p508916 indicated that build 1074 didn't solve the 'permission denied' problem he was experiencing when trying to use his SD Card on build 1074.
His workaround is to manually change a setting re. SD Card access. Doesn't MM already prompt for this?
The issue seems to be related to some Samsung devices with Android 13.
I believe that a related exception is
java.lang.SecurityException: com.android.externalstorage has no access to content://media/external_primary/file/1000002757
Affected devices Galaxy A32 5G, Galaxy A52s 5G, Galaxy S20+ 5G,Galaxy A42 5G, Galaxy Note20 Ultra 5G, Galaxy S20 FE 5G, Galaxy S22, SM-G991U, Galaxy S20 FE 5G, Galaxy Tab S7+, Galaxy S20 5G
Unfortunately, this seems to be a system bug and hopefully will be fixed soon.
Possible workarounds are to reset permissions from the device settings:
Settings -> Security and Privacy -> Privacy -> Permission Manager -> Files and Media ->Show System (three dots in upper right) -> "See more apps that can access all files" and then Enable "External Storage" for MediaMonkey
1) Go into Android Settings
2) Search for All files access and tap it
3) Tap the 3-dot menu in the top-right corner and tap Show System
4) In the list, locate and tap External Storage
5) Enable the Allow access to manage all files permission
6) Restart MediaMonkey and Grant Permissions when prompted
User at ticket 5754 (Galaxy A32 5G) confirmed that the second workaround solved the problem for them as well.
I am decreasing because the issue is on OS side.
To resolve this issue completely MMA should maybe inform users about Android Settings. What do you think?
MediaMonkey requires access to media files to work. Unfortunately requests for the permission were not fully granted due to OS settings. To resolve this go into Android Settings and:
1 Search for 'All files access' and tap it
2 Tap the 3-dot menu in the top-right corner and tap 'Show System'
3 In the list, locate and tap 'External Storage'
4 Enable the permission setting 'Allow access to manage all files'
5 Restart MediaMonkey and Grant Permissions when prompted
MediaMonkey requires access to media files to work. Unfortunately requests for the permission were not fully granted due to OS settings which must be [configured manually as described here].
Client links are to: https://www.mediamonkey.com/mma/permission-denied
||Remaining issues moved to 0020021|