Error: Invalid API or resource

Hi. After using "share -> to joplin" option through the gallery on the android app, I've been having trouble syncing between the desktop and android version. On the mobile app, it fetches nonstop. After letting it fetch for 5 hours (after using the app for months, so there wasn't any need to download so many content), I cleared the app data, no luck. Now I get the message "Error: Invalid API or resource" on both apps (desktop and android). I tried deleting the "shared images" and then syncing, also re-encrypting but no luck.
Joplin android version: 1.4.11
Joplin desktop version: Joplin 1.5.4 (prod, win32), revision 42232fac8 (master)
I'm also attaching today and yesterday's log, of when the problem started.
Desktop's log: log.txt (465.6 KB)
Sync log android version: syncReport-1607398114141.txt (160.3 KB)

1 Like

As mentioned here I'm having similar problems with OneDrive as sync target for a MacBook and and iPhone.

Here's what looks to be the relevant bits from Joplin's console on the Mac:

Same here. New user who started again from scratch this morning, now having same "Invalid API or resource" error.

This error seems been related to this Microsoft Bug

2 Likes

Same problem here....

Yeahh, I got this error on my PC. I sync between my PC (Windows 10), iPhone, and iPad. Today my PC wasn't able to download (from OneDrive) notes I created from my iPhone yesterday. It lists the last error as "Error: Invalid API or resource."

It's strange but, I have a Win10 system showing the error and failing, but 2 other Win10 systems that work without any issue or notice, and an Android phone that's fine. I don't know enough about how Onedrive's API works to know what would cause a result like that.

It's good to see that Microsoft is actively working on the issue, and communicating about it. Hopefully they'll have a fix soon.

I also got this error here. . . Not sure when it will be resolved

7 hours ago over on the github ticket we see this:

Now, when I fire up the Joplin desktop app, I'm getting a different failure message:

image

2020-12-08 18:35:54: "Got unhandled error:", "undefined", "Not a valid URL: https://graph.microsoft.com/v1.0/drive/root:/Apps/Joplin 1/info.json:/content", "Error: Not a valid URL: https://graph.microsoft.com/v1.0/drive/root:/Apps/Joplin 1/info.json:/content

Relevant portions of the log: new-onedrive-broken.txt (5.2 KB)

@gumby, if they think it works now but it doesn't, it's probably a good idea to mention it in their GitHub thread.

Same problem. I can update on Android and it appears on the desktop, but what I change on Windows does not get synced to Android. Although I'm still getting the "Invalid API or resource" error. And it began happening recently, too.

Android worked still this Morning. Meanwhile all devices show the "Invalid API" error (Windows + Andoid).

On Windows 10 this morning (Pacific Time):


Completed: 09/12/2020 08:43
Last error: Error: Invalid API or resource

48 hours now and it's still dead, I agree with Laurent, someone should reply to the Github thread.

Edit to avoid unnecessary pings: Most clients are all syncing fine now, however one of my desktops will sync changes from other devices but will not upload changes similarly to what lumogas says his is doing. It still says Last error: Error: Invalid API or resource in the lower left. And log now shows:

Click to Expand
2020-12-09 21:18:06: "Error: Invalid API or resource
Code: invalidRequest
Header: {"_headers":{"cache-control":["private"],"content-type":["application/json"],"request-id":["e4a7dabf-2d19-44cc-8516-a6761f703fcc"],"client-request-id":["e4a7dabf-2d19-44cc-8516-a6761f703fcc"],"x-ms-ags-diagnostic":["{\"ServerInfo\":{\"DataCenter\":\"West US\",\"Slice\":\"SliceC\",\"Ring\":\"5\",\"ScaleUnit\":\"001\",\"RoleInstance\":\"AGSFE_IN_49\"}}"],"strict-transport-security":["max-age=31536000"],"date":["Thu, 10 Dec 2020 05:18:05 GMT"],"connection":["close"],"content-length":["291"]}}
Request: GET https://graph.microsoft.com/v1.0/drive/root/microsoft.graph.delta(token=[redacted])?select=name%2cfile%2cfolder%2cfileSystemInfo%2cparentReference%2cdeleted&token=[redacted] null null {"headers":{"Authorization":"bearer EwB4A8l6BAAU6k7+XVQzkGyMv7VHB/h4cHbJYRAAAQrqv4T6q5udKala3iDVc8SV+EtRny5lQf7bxDGCcTiyb956B/qHmBQxDC6SOlNlTBYrvvVmVwCnE/paVzh6L7tNMWs4pQSuApcIsLv5Ao023Q0v0ZoHyf8O4J4XS7I4PK6MAFEmn8wHdPW21oSQ85yNfSgVEvY6qvmcRMD+YSYDLmJuGTQrxnUOYjp7GTHFmQToNc24ekvPhfZy0sgV45GvpyAZKwaK6TVMbXhIJv/4LpUWw3B5tvo0sjU0DhbYDF8jQ34VGSd4d1es8OUyqG7104QhMkIJG4aM/Rv/tzvpQGdH0kmG/NN1ZHeugJgSUlMtBTuOnGrY4haYu1W6QmgDZgAACHCSCDYW0EzSSALD6BSHS2JZaqSZ9pPYwq1wJGLNjTLPTWqXOEX6kM4HEVVkXVhL61gzfiepHrnJ2R83x6tGonTKbYtLsBELgKknPUYaeS+uMVsE3xZo0yElSGrrmwT/VbYhNwuJU8x5fyfEK++LiWzlojCL8QiAhXnTGBLXZzOi
Error: Invalid API or resource
    at OneDriveApi.oneDriveErrorResponseToError (C:\Users\Pierc\AppData\Local\Programs\Joplin\resources\app\node_modules\@joplin\lib\onedrive-api.js:130:19)
    at OneDriveApi.exec (C:\Users\Pierc\AppData\Local\Programs\Joplin\resources\app\node_modules\@joplin\lib\onedrive-api.js:276:24)
    at async OneDriveApi.execJson (C:\Users\Pierc\AppData\Local\Programs\Joplin\resources\app\node_modules\@joplin\lib\onedrive-api.js:346:20)
    at async FileApiDriverOneDrive.delta (C:\Users\Pierc\AppData\Local\Programs\Joplin\resources\app\node_modules\@joplin\lib\file-api-driver-onedrive.js:243:15)
    at async tryAndRepeat (C:\Users\Pierc\AppData\Local\Programs\Joplin\resources\app\node_modules\@joplin\lib\file-api.js:38:19)"
2020-12-09 21:18:07: "Operations completed: "
2020-12-09 21:18:07: "Total folders: 127"
2020-12-09 21:18:07: "Total notes: 434"
2020-12-09 21:18:07: "Total resources: 1671"
2020-12-09 21:18:07: "There was some errors:"
2020-12-09 21:18:07: "Error: Invalid API or resource
Code: invalidRequest
Header: {"_headers":{"cache-control":["private"],"content-type":["application/json"],"request-id":["e4a7dabf-2d19-44cc-8516-a6761f703fcc"],"client-request-id":["e4a7dabf-2d19-44cc-8516-a6761f703fcc"],"x-ms-ags-diagnostic":["{\"ServerInfo\":{\"DataCenter\":\"West US\",\"Slice\":\"SliceC\",\"Ring\":\"5\",\"ScaleUnit\":\"001\",\"RoleInstance\":\"AGSFE_IN_49\"}}"],"strict-transport-security":["max-age=31536000"],"date":["Thu, 10 Dec 2020 05:18:05 GMT"],"connection":["close"],"content-length":["291"]}}
Request: GET https://graph.microsoft.com/v1.0/drive/root/microsoft.graph.delta(token=[redacted])?select=name%2cfile%2cfolder%2cfileSystemInfo%2cparentReference%2cdeleted&token=[redacted] null null {"headers":{"Authorization":"bearer EwB4A8l6BAAU6k7+XVQzkGyMv7VHB/h4cHbJYRAAAQrqv4T6q5udKala3iDVc8SV+EtRny5lQf7bxDGCcTiyb956B/qHmBQxDC6SOlNlTBYrvvVmVwCnE/paVzh6L7tNMWs4pQSuApcIsLv5Ao023Q0v0ZoHyf8O4J4XS7I4PK6MAFEmn8wHdPW21oSQ85yNfSgVEvY6qvmcRMD+YSYDLmJuGTQrxnUOYjp7GTHFmQToNc24ekvPhfZy0sgV45GvpyAZKwaK6TVMbXhIJv/4LpUWw3B5tvo0sjU0DhbYDF8jQ34VGSd4d1es8OUyqG7104QhMkIJG4aM/Rv/tzvpQGdH0kmG/NN1ZHeugJgSUlMtBTuOnGrY4haYu1W6QmgDZgAACHCSCDYW0EzSSALD6BSHS2JZaqSZ9pPYwq1wJGLNjTLPTWqXOEX6kM4HEVVkXVhL61gzfiepHrnJ2R83x6tGonTKbYtLsBELgKknPUYaeS+uMVsE3xZo0yElSGrrmwT/VbYhNwuJU8x5fyfEK++LiWzlojCL8QiAhXnTGBLXZzOi
Error: Invalid API or resource
    at OneDriveApi.oneDriveErrorResponseToError (C:\Users\Pierc\AppData\Local\Programs\Joplin\resources\app\node_modules\@joplin\lib\onedrive-api.js:130:19)
    at OneDriveApi.exec (C:\Users\Pierc\AppData\Local\Programs\Joplin\resources\app\node_modules\@joplin\lib\onedrive-api.js:276:24)
    at async OneDriveApi.execJson (C:\Users\Pierc\AppData\Local\Programs\Joplin\resources\app\node_modules\@joplin\lib\onedrive-api.js:346:20)
    at async FileApiDriverOneDrive.delta (C:\Users\Pierc\AppData\Local\Programs\Joplin\resources\app\node_modules\@joplin\lib\file-api-driver-onedrive.js:243:15)
    at async tryAndRepeat (C:\Users\Pierc\AppData\Local\Programs\Joplin\resources\app\node_modules\@joplin\lib\file-api.js:38:19)"
2020-12-09 21:18:07: "Updating all notifications..."
2020-12-09 21:18:07: "Garbage collecting alarms..."```

I still have the issues on all clients. Can you tell me, where I can find the log?

On Windows: C:\Users\%username%\.config\joplin-desktop
On Linux: ~/.config/joplin-desktop
I don't own a mac but I assume it would be similar to Linux
I don't think there's a way to view the log on mobile

I am not that familiar with the delta request of the onedrive api but I think joplin permanently repeats the request to a invalid link which it has received due to the Microsoft bug. It seems that there is no routine implemented in joplin to automatically refresh this link in that unusual case.

So i think in order to solve the problem you would either need to delete the delta link from the database or log out from onedrive and login again. Unfortunately there is no way to do this from the GUI (which I think really should be implemented). You can find workarounds to achieve this on the forum though.

1 Like

Hi,
Could you provide links to the workarounds?

tl;dr: for now I'd wait for Laurent to say what to do. If you need this working asap, I think that you would have to setup the Joplin app again (which means you have to backup everything to avoid data loss.)


I have the same problem on my Windows 10 and Android 11. Both of them are showing sync error "Invalid API or resource."

I have tried setting local sync target and then back OneDrive, and nothing happened. To force logout and login, I have logged into https://account.live.com/consent/Manage and removed Joplins permission - that has forced relogin on both devices. However, when I relogged into windows app, I have got the same error again.

Error message is the same before and after relogin:

2020-12-10 07:33:28: "Error: Invalid API or resource
Code: invalidRequest
Header: {"_headers":{"cache-control":["private"],"content-type":["application/json"],"request-id":["***REDACTED***"],"client-request-id":["***REDACTED***"],"x-ms-ags-diagnostic":["{\"ServerInfo\":{\"DataCenter\":\"West Europe\",\"Slice\":\"SliceC\",\"Ring\":\"5\",\"ScaleUnit\":\"001\",\"RoleInstance\":\"***REDACTED***\"}}"],"strict-transport-security":["max-age=31536000"],"date":["Thu, 10 Dec 2020 06:33 GMT"],"connection":["close"],"content-length":["291"]}}
Request: GET https://graph.microsoft.com/v1.0/drive/root/microsoft.graph.delta(token='***REDACTED***')?select=name%2cfile%2cfolder%2cfileSystemInfo%2cparentReference%2cdeleted&token=***REDACTED*** null null {"headers":{"Authorization":"***REDACTED***
Error: Invalid API or resource
    at OneDriveApi.oneDriveErrorResponseToError (C:\Users\ptace\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\onedrive-api.js:130:19)
    at OneDriveApi.exec (C:\Users\ptace\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\onedrive-api.js:276:24)
    at async OneDriveApi.execJson (C:\Users\ptace\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\onedrive-api.js:346:20)
    at async FileApiDriverOneDrive.delta (C:\Users\ptace\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\file-api-driver-onedrive.js:243:15)
    at async tryAndRepeat (C:\Users\ptace\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\file-api.js:38:19)"

Thing of note is GET https://graph.microsoft.com/v1.0/drive/root/microsoft.graph.delta(token='***REDACTED***'). I have checked and the delta token is the same when errors started (for me on 7th December), and it is the same today even after relogin. This suggest that Joplin caches the delta token (which was helpfully broken by microsoft on 7th Dec and they're not accepting it back.)

It seems that the hotfix right now is to completely setup the entire application again. I'm personally going to wait for advice :slight_smile:


Thing of note: Onedrive for linux fixes the issue by removing the delta link - see commit here: Handle case where API provided deltaLink generates a further API erro… · abraunegg/onedrive@335eab3 · GitHub

I see that @laurent has asked MS on what this means and I suspect that we'll get a fix soon. I'm sorry I cannot offer expertise (I don't know electron)

1 Like