View Issue Details

IDProjectCategoryView StatusLast Update
0019887MMASynchronizationpublic2023-05-12 11:47
Reporterrusty Assigned To 
PriorityimmediateSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
Product Version2.0.0 
Target Version2.0.0Fixed in Version2.0.0 
Summary0019887: Permission problems when syncing to SD Cards and/or non-standard directory
DescriptionWhen 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 ReproduceTested on Android 12 / Galaxy S10
Additional Informationhttps://www.mediamonkey.com/forum/viewtopic.php?t=103965

Possibly related issue:
https://www.mediamonkey.com/forum/viewtopic.php?t=103694
TagsNo tags attached.
Fixed in build1074

Relationships

related to 0018458 closedmartin MMA Grant Access to SDcard fail 
related to 0018853 closedmartin MMA Permissions: Some devices require that MM is allowed to root of SDcard and not just Music folder 
related to 0019122 resolvedmartin MMW 5 Required changes on MM5 side (USB synchronization with Android 11) 
related to 0019875 closedmartin MMA Tracks can't be deleted (regression) 
related to 0020021 resolvedmartin MMA Permission problems on samsung devices 

Activities

rusty

2023-03-24 19:36

administrator   ~0071394

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)!

peke

2023-03-24 19:47

developer   ~0071395

This bug is regression from fixes 0018853 and 0018458

martin

2023-03-29 20:35

developer   ~0071411

Fixed in build 2.0.0.1074

peke

2023-04-01 10:44

developer   ~0071421

Verified 1074 On Android 9/10 No regressions introduced and if I do not grant access MM folder is used for sync.

rusty

2023-04-02 02:33

administrator   ~0071422

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

martin

2023-04-03 10:14

developer   ~0071428

Last edited: 2023-04-03 13:07

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.

rusty

2023-04-03 13:09

administrator   ~0071432

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.

martin

2023-04-11 12:56

developer   ~0071477

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.

rusty

2023-04-20 20:57

administrator   ~0071576

Retested 1076 with SD Cards and non-standard directories and cannot replicate any issues.

rusty

2023-04-23 15:46

administrator   ~0071597

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?

martin

2023-04-25 13:39

developer   ~0071610

Last edited: 2023-04-25 13:53

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
https://appcenter.ms/users/rs-y9ha/apps/MediaMonkey/crashes/errors/324044089u/reports/2517206883094709999-1db734e4-b654-42df-9037-8c88d67b0c3e/threads?q=73X8M1ZTVDS627CA3KJF&searchType=all

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.
https://issuetracker.google.com/issues/258270138

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

OR

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

rusty

2023-04-26 02:08

administrator   ~0071616

Last edited: 2023-04-26 02:09

User at ticket 5754 (Galaxy A32 5G) confirmed that the second workaround solved the problem for them as well.

martin

2023-04-28 08:21

developer   ~0071648

Last edited: 2023-05-10 15:20

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?

e.g.
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

[More info]

OR

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

martin

2023-05-12 11:47

developer   ~0071819

Remaining issues moved to 0020021