OneDrive Sync Error in Desktop App

I setup sync to OneDrive, and signed in as prompted. It appeared to do an initial sync and create files. Browsing the OneDrive web client, I can see /Apps/Joplin has a bunch of actual .md files as well as empty .sync and .resource dirs.

In the Joplin sidebar I see an error below the synchronise button:

Created remote items: 1.
Completed: 28/02/2019 14:40
Last error: SyntaxError: OneDriveApi::exec: Cannot parse JSON error: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
 <title>404 - File or directory not found.</title>
 <style type="text/css">
 <!--
 body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
 fieldset{padding:0 15

Any advice would be welcome!

OneDrive can be a bit random sometimes - does it do it again if you press sync again?

If so, please enable debug mode and post the logs here - https://joplin.cozic.net/debugging

It does repeat if I hit sync again. Running with debug flags, I donā€™t see any output to the console, but the log.txt contains the following as the most recent event:

2019-02-28 20:06:06: "Sync: finished: Synchronisation finished [1551413165013]"
2019-02-28 20:06:06: "Reducer action", "SYNC_REPORT_UPDATE"
2019-02-28 20:06:06: "Operations completed: "
2019-02-28 20:06:06: "createRemote: 1"
2019-02-28 20:06:07: "Total folders: 2"
2019-02-28 20:06:07: "Total notes: 783"
2019-02-28 20:06:07: "Total resources: 30"
2019-02-28 20:06:07: "There was some errors:"
2019-02-28 20:06:07: "SyntaxError: OneDriveApi::exec: Cannot parse JSON error: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>404 - File or directory not found.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;} 
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;} 
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} 
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>404 - File or directory not found.</h2>
  <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
 </fieldset></div>
</div>
</body>
</html>
 Unexpected token < in JSON at position 0
SyntaxError: OneDriveApi::exec: Cannot parse JSON error: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>404 - File or directory not found.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;} 
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;} 
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} 
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>404 - File or directory not found.</h2>
  <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
 </fieldset></div>
</div>
</body>
</html>
 Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at OneDriveApi.exec (C:\Users\philm\AppData\Local\Programs\Joplin\resources\app.asar\lib\onedrive-api.js:188:27)
    at process._tickCallback (internal/process/next_tick.js:68:7)"
2019-02-28 20:06:07: "Reducer action", "SYNC_COMPLETED"
2019-02-28 20:06:07: "Setting up recurrent sync with interval 300"

Hi,

I am also facing the similar issue. Read something similar on Finance Police. Definitely following this for sure.

Where it says There was some errors, there should be error log statements before that, that would show both that particular error and what path caused it. Could you check if itā€™s in your log?

Here's the complete log for full analysis.

Does the directory /Apps/Joplin exists on OneDrive? Also are there other directories in there like /Apps/Joplin2, etc.? Did you copy or move file around in these directories?

/Apps/Joplin exists, and contains a bunch of .md files, as well as .sync and .resource dirs (those dirs are empty).
inside the toplevel /Apps/ directory there is also another dir next to Joplin called ā€˜Fresh Paintā€™ (another app).

Anything else I can do to help resolve this issue? In the meantime Iā€™m looking at using an alternative sync target.

Iā€™ve been trying to copy all my music to Onedrive for several weeks. It just doesnā€™t sync. Some of it is on Onedrive, some of it isnā€™t. I thought it was supposed to be easy. Itā€™s not even a lot of storage, 905 MB. I will have to go through each folder, and manually update what isnā€™t there.

Fortunately, I got rid of it by somehow. Hope, you too

To solve the problem, follow these steps:
1. Open windows run by pressing windows + r
2. In the open field, type:

%localappdata%\Microsoft\OneDrive\OneDrive.exe

3. Then, press OK

I have the same Problem. Trying to do a first time sync with OneDrive.
The log can be found here: https://pastebin.com/PH7jG8xd

OS is Ubuntu 18
Joplin is: Joplin-1.0.170-x86_64.AppImage

Edit: As can be seen in log.txt - The last try before the error is uploading a pdf file - can that be an issue?

As stated in the section of known problems:

It is only possible to upload files of up to 4MB to OneDrive due to a limitation of the API being currently used. There is currently no plan to support OneDrive ā€œlarge fileā€ API.

Is your PDF larger than 4MBs?

2 Likes

Argh... indeed... the pdf has ~12MB.

I've more than 300 attachments/files in notes bigger then 4MB. So i have to drop my plans to migrate from Nextcloud- to OneCloud-Sync, i guess.

But thanks for the help! :+1:

This fixed my sync error.

Thanks, @tessus!

It seems that I need to replace a new cloud service. . .

This information was a year old.

see

and