Sync with OneDrive on Android use

Operating system

Android

Joplin version

3.5.8

Desktop version info

Android 11

Sync target

OneDrive

What issue do you have?

I have successfully synced two Windows PCs via OneDrive for a long time. I would like to start using it on Android too but cannot get the authorisation to even get set up.
When I enter my credentials and the authentication code it returns an error.
"Could not retrieve auth code: 400: : " followed by a lot more code.

How do I fix this?

I did search the forum and there did seem to be quite a number of related and unresolved issues with Android. Does it actually work?

I have also tested that I can directly log on to OneDrive in its own app. So it seems the credentials are good.

It should work on Android, not sure why you get the error. Try uninstalling the app, reinstalling it and trying to login again

OK tried that,but it returns exactly the same error. Unfortunately it doesn't seem possible to grab the text of the error but it is across two screens.

I just tried logging into OneDrive sync on fresh installation of the same version of the app and it works fine. I can only assume it is an account related issue, if it still happens after reinstalling the app.

Are you using a personal or business Microsoft account, and do you pay a subcription or just have a free account?

It's a free personal account.

I can see on the page behind the error message the app is accessing the wrong page:

____________

This is not the right page

You have reached the wrong page. Please close this app or window and try again.

____________

Not a very helpful error message when it doesn't tell you the page it has landed at or what it was expecting!

Try rebooting the phone.

I’m using a free personal account as well. You could try creating a new Microsoft account just to see if Joplin will accept those account credentials. That would confirm whether or not it is an account issue or something else

That proved interesting; it worked with a new account with no existing Joplin files. Now I don’t know if it is just ‘flaky’ OneDrive or because the account is already being used for Joplin. In which case you cannot add Joplin Android to a pre-exisiting sync service.

Hi,

I used onedrive for years with multiple android devices, windows, and Linux.

The problem may be related to app Permissions in the account. New account had no previous apps or devices knowledge.

Just a thought.

I doubt it has anything to do with having already synced with Joplin before. No idea how you could fix it though other than switch to a new Microsoft account. There have been other reports of OneDrive sync issues in the past (but only affected some users) which were confirmed to be due to Microsoft breaking something at their end (one particular bug took many months for Microsoft to fix). I used to sync Joplin with OneDrive sync myself for over a year, but I switched to Dropbox sync because of all the issues I read about even though I didn’t have any such issues myself.

This is what I am referring to.

MS knows about joplin and stores the token.

Go to: https://account.microsoft.com → Privacy → Apps and services

(or directly: Microsoft Account → App permissions)

You’ll see Joplin listed. You can:

View permissions

Click Remove access

That immediately revokes the token. Joplin will fail to sync after that.

I didn't leave Microsoft because I had any issues. I had no problems whatsoever.

I switched to Joplin Cloud so I could share notes over the internet.

1 Like

This is worrying. If I delete the token my existing Joplin clients will no longer sync. Left ‘as is’ and no additional Joplin clients can be added.

How should I proceed so that two Windows machines and one Android can all sync together on OneDrive?

You’ve either got to revoke access on your existing account and resysnc all your devices (may or may not help), or switch to a new Microsoft account, or switch to a different sync provider altogether.

In any case, make a full jex backup before you make any changes.

1 Like

What @mrjo118 said.

First and foremost make sure you have a current backup.

There are no guarantees that revoking and then re-adding everybody is going to work but it's the only option I can think of going forward other than switching all of the devices to the new account.

You should be able to add all of the other devices to the new account that you just created without impacting their trust relationship with the old account.

It's just a matter of which risk you would rather go with.

Hi,

I may have an alternate solution for you.

It requires that you have a 24x7 PC running Windows or Linux serving your files from Microsoft. When configured it gives you the option to use webdav with ssl to connect to your Microsoft OneDrive.

I can write up a set of basic overview instructions if you like?

In a nutshell you use apps called rclone and caddy and ddns to give you a valid domain name that can get a SSL certificate that Caddy will acquire for you.

Rclone gets the files from Microsoft using standard Microsoft Authentication. Then it serves them using webdav.

Then caddy gets the cert for your ddns name.

Joplin uses webdav to connect to your domain.

It sounds a little bit quirky but it should work. I have set it up almost all the way I just need to add it to Joplin to confirm that it works. Let me know and I will test it this evening.

I happen to have a router that supports Dynamic DNS automatically. It gives me an Internet routable domain name that can be registered for an SSL certificate.

You can do the same thing without a router as long as you run ddns to give you a routable domain name to your cable modem at home I presume?

You'll be using an internet routable domain name so your phone can be at home or away it doesn't matter. What matters is that you be able to forward ports 80 and 443 from the router to the PC that you designate to share the files. You can actually use different port numbers if you wish.

Using this setup in case anybody else is reading this enables you to locate your Joplin database files on any cloud provider that rclone supports and there are over 50 of them. Rclone will be responsible for opening a connection to OneDrive for files access and also serving the files to all your devices.

UPDATE

I set this up completely and tested it and it works.

Using webdav you can connect to any one of the more than 50 Cloud providers supported by Rclone.

Yes, Joplin via webdav can access any server or cloud server Rclone can mount.

User ID and password supported. Ssl end-to-end encryption.

Thank you for your hard work. I think I am going to try a new OneDrive account first just to confirm (or otherwise) the issue with Microsoft.

1 Like

So, created a new OneDrive (Microsoft) account. Initialised the sync successfully, but when I try to actually sync it now gives an error “Could not initialise synchroniser”. Tried restarting Joplin a couple of times but still fails. What is the next step to fix this?

Oh that’s not good news. Could you please share a log from the mobile app? You can find it in configuration, tools, log

in the end I decided to start over with new profiles on my Windows machines and Android all on a new Microsoft OneDrive account. Imported my backup and waited for it all to sync.

Now I just need to clean out my old profiles.

Oh, so the error in your last comment wasn’t with the new Microsoft account, or it was using an existing profile? Glad you could get it sorted