"Error: Could not read directory" on android 10

Hi,

I upgraded recently to 1.0.242 with all my devices and it seemed to be that everything is working. But now I have a problem in my android 10 (Honor 10) smartphone:

The error message:

Error: Could not read directory. /storage/emulated/0/Notizen/Joplin/locks: Folder does not exist. (But it exists.)

And an error on Windows 10:

Abgeschlossen: 06/09/2020 16:55

Letzte Fehlermeldung: Error: Error: Error: ENOENT: no such file or directory, scandir ‘H:\Syncthing\Notizen\Joplin\locks’. Path: H:\Syncthing\Notizen\Joplin/locks

You see the difference between the slash and the backslash? Does that somehow matter?

Do I have to add a folder “locks” by hand? Or what can I do to get out of the situation?

Greetings,

merlinuwe

1 Like

Hi me,

simply add a folder named "locks" on both sides, sync (with syncthing) and it will work.

Greetings to myself :wink:

This is strange because the locks folder should have been created automatically when you upgrade the sync target.

Immediately after the upgrade the syncing of Windows 10, Android 10 and Windows 10 from an usb-device worked without problems. This issue occured after a day of being “sure”, that everything works as expected.

Under Windows 10 I access with the portable and the usual release to the same directory. (Does that matter?) I sync (with syncthing) also to 2 raspberry pi devices, an other windows 10 device and an older medion tablet (and the smartphone).

Perhaps this information helps to isolate the problem.

1 Like

Unfortunately the descrbed problem occures again.

1 Like

This happened on my Huawei phone with Android 9, but does not happen on my Nokia phone also with Android 9. On the Huawei phone I created the locks directory, as @merlinuwe mentioned, then things work. Sync among phones and Mac (all with the newest version) with SyncThing also works.

1 Like

The locks folder, once manually created, stays there for sometime, but at some point, it's gone, so I have to created it again.

1 Like

Unfortunately the described problem occures again.

Joplin 1.1.2 on Honor 10 with Android 10.

Same for Huawei Android 9. Somehow locks directory gets deleted at some point.

1 Like

Could this please be addressed? Everyday, the locks file gets deleted somehow and Joplin can not sync without the user having to create the file manually.

1 Like

I found a workaround, which could be included in one of the next releases: Add a file "something.txt" in the manually created folder "locks". This seems to prevent the folder from deleting.

But I'm quite sure that the developers find a better solution. :wink:

2 Likes

Ups, a flop - but it worked for a while longer than without it. Now I test it with the windows 10 write protection... ;-(

The app doesn't delete the locks folder, so you might want to check with Syncthing if they do something special either with directories named "locks" or with empty directories.

I'm having the same problem on Android 10 after re-install my system, the folder untouched on the device but the app wont sync.

Error
Could not read the directory ...../locks

But the directory is available and untouched.
Kindly, look into it.
Thanks

1 Like

check this

for me the following worked:

  • enter Joplin Configuration
  • change Sync target to OneDrive
  • press Save
  • change Sync target back to File system
  • press Save - Joplin will ask you for permission to access the file system -> say yes

@laurent May I suggest to issue an android notification when syncing does not work. I only found that error message in the sidebar by accident. I have no idea for how long my notes were not synced.

with the update to Android 11, even this stopped working.
Seems google simply does not want this anymore (see Android 11의 저장소 업데이트  |  Android 개발자  |  Android Developers, Android storage use cases and best practices  |  Android Developers).

I found the following ugly workaround:
adb shell appops set --uid net.cozic.joplin MANAGE_EXTERNAL_STORAGE allow

  • reboot

Even if there is no nice solution to the problem, a visible warning that synchronization failed is needed.