Skip to content
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

Android filesystem sync is broken after 2.6.3 update #5779

Closed
shaymagsumov opened this issue Nov 24, 2021 · 136 comments · Fixed by #6395
Closed

Android filesystem sync is broken after 2.6.3 update #5779

shaymagsumov opened this issue Nov 24, 2021 · 136 comments · Fixed by #6395
Labels
android backlog We'll get to it... eventually... bug It's a bug sync sync related issue

Comments

@shaymagsumov
Copy link

shaymagsumov commented Nov 24, 2021


Update 20 Dec 2021: There's currently no solution to this problem. In the meantime you may downgrade to v2.5 by downloading the APK from the official repository:

https://github.com/laurent22/joplin-android/releases/download/android-v2.5.5/joplin-v2.5.5.apk


I use filesystem synchronization with path like
/storage/emulated/0/Sync/Data/Joplin

After 2.6.3 update i get this error:
Screenshot_20211124-094935

Could it be related to app permissions? I can choose only 'Allow access to media only' option in permission manager.
Screenshot_20211124-095131

@shaymagsumov shaymagsumov added the bug It's a bug label Nov 24, 2021
@buckket
Copy link

buckket commented Nov 24, 2021

I can confirm this happens with all my Android devices (running Android 11 and Android 12) since the update.

Downgrading to the previous version made it work again.

Here’s the relevant log snippet:

11-24T11:13:56,20,"Synchronizer: ""Error: Error: Operation not permitted. Path: /storage/[redacted]/Joplin/locks/2_2_9450db2b66d24ccebc610d4adbc98838.json
Code: EUNSPECIFIED
value@index.android.bundle:1029:275
index.android.bundle:1029:4056
p@index.android.bundle:82:588
index.android.bundle:82:1893
p@index.android.bundle:82:588
o@index.android.bundle:82:1069
index.android.bundle:82:1241
u@index.android.bundle:76:157
index.android.bundle:76:866
index.android.bundle:84:1672
k@index.android.bundle:84:500
w@index.android.bundle:84:898
callReactNativeMicrotasks@index.android.bundle:84:3054
value@index.android.bundle:37:2868
index.android.bundle:37:960
value@index.android.bundle:37:2504
value@index.android.bundle:37:919
value@[native code]
value@[native code]""

@laurent22
Copy link
Owner

This is probably due the Android SDK update, but not sure how (or if) that can be fixed. If someone has any idea I'd accept a pull request.

@Robin-Sch
Copy link

Makes the app completely useless for me, I can't sync between my phone and pc anymore

#5639
#5691

@Timothy-Ecc19
Copy link

Add another one to the list. On Android 11 with 2.6.3 update I am no longer able to sync to my SD card so syncthing can access it. How would I go about downgrading to the previous version or can anyone think of another work around?

@blueorignal
Copy link

blueorignal commented Nov 25, 2021

I am also experiencing the same issue when upgrading to version 2.6.3 on Android 11. Dropping back to version 2.4.3 (Google Version Code: 2097651) resolves the issue.

@laurent22 I just want to say thank you for this amazing software. It's easy to forget how much effort goes into making something like Joplin. If there is anything I can do help narrow down the issue (logs, testing, etc.) , please let me know.

@Timothy-Ecc19 you will need to uninstall Joplin and reinstall the previous version. The last official prebuild APK can be found on the root folder of Joplin's github repository, under the heading "Mobile applications", but unfortunately it is version 1.8.5.

If you want to download and side-load the last working version (2.4.3) the easiest way to obtain the APK would be via a site such as apkpure.com. < warnings> insert usual risks w.r.t. side-loading apps here < /warnings>

@laurent22
Copy link
Owner

For info there's a bug in GitHub that makes it display the wrong version in the release page. Instead you need to go to the tags to see them: https://github.com/laurent22/joplin-android/tags

@shaymagsumov
Copy link
Author

To downgrade you can also use Aurora Store client and choose manual download with specified version code

@shaymagsumov
Copy link
Author

BTW i downgraded to 2.4.3 ans now i see different permission options:
Screenshot_20211125-123736

@laurent22
Copy link
Owner

Maybe they've renamed or removed the permission in this SDK update.

@github-ronk
Copy link

This is probably due the Android SDK update, but not sure how (or if) that can be fixed. If someone has any idea I'd accept a pull request.

@laurent22 - This Stack Overflow post seems to have the necessary information, in case you haven't seen it yet.

@da2x
Copy link
Contributor

da2x commented Nov 26, 2021

@laurent22 can you revert the SDK update until this is fixed?

I’m also using Syncthing.

@da-sti
Copy link

da-sti commented Nov 26, 2021

same thing here

android 11 (oxygenOS 11.1.1.1)
joplin android 2.6.3
syncthing 1.18.3

no obvious changes happened on the android side
Uninstalled joplin 2.6.3, installed 2.4.3 from apkpure, lost a bit of data in the process but it's back to functionnal now
and of course, desactivated auto updates

@MikhailShi
Copy link

same issue since yesterday

android 11 (MIUI Global 12.5.2)
joplin android 2.6.3
syncthing 1.18.3

IMG_20211126_185937

@laurent22
Copy link
Owner

@laurent22 can you revert the SDK update until this is fixed?

Unfortunately no, because it's required by Google. We can't publish to the app store otherwise.

@rockhazard
Copy link

Happening to me too. Removing and re-creating the locks directory has no effect.

@Timothy-Ecc19
Copy link

Anyone figure out what folder the "allow access to media only" gives? Maybe we could sync to there and syncthing would still be able to see it.

@bensoibj
Copy link

Is only Android 11 and higher affected? Maybe it is related Storage updates in Android 11. Which API level does Joplin use on Android?

@bacteriostat
Copy link

I am on Android 11 and I also couldn't sync after updating to 2.6.2 version. But I got a different error which I reported here #5673?

My storage location is inside Documents folder which is part of shared storage under Android 11 and maybe that's why the error is somewhat different?

@ase1590
Copy link

ase1590 commented Nov 29, 2021

Seems to be an android 11 issue, as upgrading from 2.4.3 to 2.6.3 results in the same issue on a Moto G Power Android 11 device. Downgrading back to 2.4.3 fixes the issue regarding filesystem sync with arbitrary folders in android.

@jerseyblue
Copy link

I can confirm this issue is also on android 12 (using filesystem sync target with Syncthing on a pixel 5). Downgrading to 2.4.3 resolves the issue. Just need to fiddle to stop the play store from upgrading it till the issue is resolved.

@laurent22 I'm curious if you have identified root cause and have a plan to resolve. Or a proposed workaround (e.g., should I be thinking about migrating to a different sync strategy, though I love the Joplin/Syncthing combo!)

@laurent22 laurent22 added android backlog We'll get to it... eventually... sync sync related issue labels Dec 1, 2021
@Riolku
Copy link

Riolku commented Dec 1, 2021

I mentioned some possible causes in my issue #5810. It boils down to Media access is insufficient, Joplin needs full system access to be able to work properly. I think it's a matter of changing the permission requested, and I do think it has something to do with the new android storage APIs, but I don't have much experience on android development.

I think Joplin + Syncthing is very common (I use it too), and I feel like it would be ideal to make an effort to keep that. The easy solution to this is likely to figure out what we need to change to request the proper permission.

@github-ronk
Copy link

I think Joplin + Syncthing is very common (I use it too), and I feel like it would be ideal to make an effort to keep that. The easy solution to this is likely to figure out what we need to change to request the proper permission.

Indeed. Even more so since the Joplin cloud-based sync solutions are too unstable to be usable (for me, according to my personal experience with Dropbox and then OneDrive syncing. YMMV)

@sedlund
Copy link

sedlund commented Dec 1, 2021

Device on android 11, and using Syncthing. Downloaded 2.4.3 from apkpure.com and side loaded. Sync working again.

@bensoibj
Copy link

bensoibj commented Dec 1, 2021

As mentioned by @Riolku in #5810, a similar issue (#4122) occurred a year ago. It has been solved in PR #4134. This pull request set the flag requestLegacyExternalStorage, in this way opting out of the Scoped storage enforcement of Android 11. However, with API level 30 (which Joplin Android uses since the 2.6.3 update, more precisely, already in 2.6.1) this flag is ignored.

@frederikstroem
Copy link

Device on android 11, and using Syncthing. Downloaded 2.4.3 from apkpure.com and side loaded. Sync working again.

Instead of downloading from a third-party APK site, it would probably be more advisable to use the official repo specifically made for that purpose. 😊

Version 2.4.3 can be found here: https://github.com/laurent22/joplin-android/releases/tag/android-v2.4.3

@brnl
Copy link

brnl commented Apr 20, 2022

I'm on Android 12 and the following commands worked for me:

adb shell cmd appops set net.cozic.joplin android:no_isolated_storage allow
adb shell cmd appops set net.cozic.joplin android:legacy_storage allow
adb shell am force-stop net.cozic.joplin

I can also confirm this worked for me as a workaround to allow Joplin to access /storage/emulated/0/Documents/joplin-notes. Thanks @marlluslustosa !

@JuMilia
Copy link

JuMilia commented Apr 29, 2022

adb shell cmd appops set net.cozic.joplin android:no_isolated_storage allow
adb shell cmd appops set net.cozic.joplin android:legacy_storage allow
adb shell am force-stop net.cozic.joplin

I also confirm working synchronization after applying the workaround on android 11.
Thanks everyone involved, good health and good will.

@draxaris1010
Copy link

It should be on the wiki for now.

@brnl
Copy link

brnl commented Apr 30, 2022

It should be on the wiki for now.

It should be fixed ;-)

@charlescochran
Copy link

The adb hack works for me as well. Hopefully the app gets updated soon to request "all files access."

@regisz
Copy link

regisz commented May 29, 2022

Hi,

I did the adb hack, but now I get the next error message when I would like to sync:

Error: Error: ENOENT: open failed: ENOENT (No such file or directory),
open '/storage/emulated/1/joplin-jegyzetek/.resource/<log hash number :-)>

Any idea?

I sync my notes with another app into MegaSync, and it works perfectly.

Oppo Reno 5 5G
ColorOS v12.1 (uptodate)

@draxaris1010
Copy link

draxaris1010 commented May 31, 2022

@regisz

ColorOS v12.1 (uptodate)

What Android version is this?

@regisz
Copy link

regisz commented May 31, 2022

@draxaris1010

ColorOS v12.1 (uptodate)

What Android version is this?

12 :-)

@AsimovGod
Copy link

AsimovGod commented Jun 7, 2022

Can I not use the ADB normally now?

  • Android 11 (MIUI 12.5)
  • Filesystem sync + Syncthing

@bacteriostat
Copy link

bacteriostat commented Jun 7, 2022

Can I not use the ADB normally now?

* Android 11 (MIUI 12.5)

* Filesystem sync + Syncthing

@AsimovGod Try this solution: #5779 (comment)

@AsimovGod
Copy link

我现在不能正常使用亚行吗?

* Android 11 (MIUI 12.5)

* Filesystem sync + Syncthing

@AsimovGod试试这个解决方案: #5779(评论)

In fact, version 2.5.5 can be used normally, but it is obviously lacking.It is mainly worried that it will be completely unavailable to update a few more versions. These methods are just expedient.Seeing the current situation, there is no complete solution plan.

@johemilsson
Copy link

Using Android 11 + filesystem sync with syncthing. Still getting this error. Any plan for a solution?

@meinto
Copy link

meinto commented Jun 24, 2022

Do I also need to freeze my desctop app version until this issue is fixed?

@pfaca
Copy link

pfaca commented Jun 24, 2022

Do I also need to freeze my desctop app version until this issue is fixed?

No, you can update the desktop app. The problem is only with android.

@meowmachine
Copy link

I see this issue was recently closed. Does that mean we can all use the latest Android version now?

@lerra
Copy link

lerra commented Jul 10, 2022

Hi mate, it is commited to the dev branch, if you wont compile it your self and load it your self on your phone you would need to wait until it is merged and released (so expect it to take some time) :)

@Mrnofish
Copy link

Mrnofish commented Jul 10, 2022

In this vein, and not meaning to pressure anybody, I would anticipate that a majority of the userbase would welcome a horizon for this change to materialize in a non-beta, even a rough, tentative one, as it is kind of a show-stopper.

Thanks Laurent and jd1378, as well all other contributors, for all your efforts: they're very much appreciated.

@KrisZane
Copy link

Just gonna put in my two cents here, 99% sure this is a permission problem. Updating to the new permissions that came along with the new storage system, should "fix" the problem for now: https://developer.android.com/training/data-storage/manage-all-files
It probably does make sense to migrate to the new storage platform sooner or later though, as we all know Gurgle will remove the old file management API eventually.

@NelsonMinar
Copy link

Very much looking forward to this bugfix being released. I've been wondering for 6 months why Joplin was broken, thinking it had something to do with encryption of Syncthing. I'm glad there's a fix committed!

@personalizedrefrigerator
Copy link
Collaborator

Very much looking forward to this bugfix being released. I've been wondering for 6 months why Joplin was broken, thinking it had something to do with encryption of Syncthing. I'm glad there's a fix committed!

It's still broken! See #6779

@personalizedrefrigerator
Copy link
Collaborator

personalizedrefrigerator commented Aug 25, 2022

There have been no new Play Store releases after the early June one, after all.

#6779 is tested with building the Android app from source (so shouldn't relate to the lack of a new Play Store release). Perhaps there has been a regression since #6395...

@benbaker76
Copy link

The solution seems to be to use Scoped Storage but the react-native-fs has not been updated to support it yet. There is an alternative library called react-native-file-access which supports it. I'm not sure of the work involved to move to this library though.

@personalizedrefrigerator
Copy link
Collaborator

The solution seems to be to use Scoped Storage but the react-native-fs has not been updated to support it yet. There is an alternative library called react-native-file-access which supports it. I'm not sure of the work involved to move to this library though.

Note that react-native-fs may be unmaintained/is looking for a new maintainer. As such, switching to react-native-file-access may otherwise make sense.

Repository owner deleted a comment from danielb2 Oct 11, 2022
Repository owner deleted a comment from trymeouteh Oct 11, 2022
Repository owner locked as too heated and limited conversation to collaborators Oct 11, 2022
@laurent22
Copy link
Owner

Locking as the last two comments (now deleted) were just rants.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
android backlog We'll get to it... eventually... bug It's a bug sync sync related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.