### Operating system
- [ ] Windows
- [X] macOS
- [ ] Linux
- [ ] Android
…- [ ] iOS
### Application
- [ ] Desktop
- [ ] Mobile
- [X] Terminal
*If it is a bug if possible please provide a screenshot showing the problem*
*If there is an error, please copy and paste the full error message*
---
I've recently set up Joplin on a second machine, made some notes, and synced with OneDrive. It all worked, including retrieving the notes created on the first machine I installed Joplin on.
I've now tried to sync on the first macine again (my macOS laptop), and the new notes aren't coming in. According to the logs, Joplin seems to think the OneDrive token has expired, and keeps trying to renew it until it finally gives up. The logs will be pasted below, with the token removed.
I did try to run `joplin config sync.3.auth = ""` to unset the key (which I verified with `joplin config sync.3.auth`) and reran sync. It went through the oauth setup again, and seemed to succeed. Running `joplin config sync.3.auth` again showed that the auth key was again set properly. It still did not retrieve the new notes, though, and had the same errors. The logs below are from the run following redoing the auth token, so the token was less than a minute old.
```
2018-01-11 10:12:33: "Profile directory: /Users/patrickaikens/.config/joplin"
2018-01-11 10:12:33: "Trying to load 0 master keys..."
2018-01-11 10:12:33: "Loaded master keys: 0"
2018-01-11 10:12:34: "Setting up recurrent sync with interval 300"
2018-01-11 10:12:34: "Reducer action", "SETTING_UPDATE_ALL"
2018-01-11 10:12:34: "Refreshing notes:", "null", "null"
2018-01-11 10:12:34: "Reducer action", "NOTE_UPDATE_ALL, "{\"options\":{\"order\":[{\"by\":\"user_updated_time\",\"dir\":\"DESC\"}],\"uncompletedTodosOnTop\":true},\"parentId\":null}""
2018-01-11 10:12:34: "Reducer action", "NOTE_SELECT, "
2018-01-11 10:12:34: "Render: root"
2018-01-11 10:12:34: "Render: mainWindow"
2018-01-11 10:12:34: "Render: vLayout"
2018-01-11 10:12:34: "Render: hLayout"
2018-01-11 10:12:34: "Rebuilding items...", "null", "", "null"
2018-01-11 10:12:34: "Render: folderList"
2018-01-11 10:12:34: "Render: noteList"
2018-01-11 10:12:34: "Render: noteLayout"
2018-01-11 10:12:34: "Render: noteText"
2018-01-11 10:12:34: "Render: statusBar"
2018-01-11 10:12:34: "Trying to load 0 master keys..."
2018-01-11 10:12:34: "Loaded master keys: 0"
2018-01-11 10:12:34: "Reducer action", "MASTERKEY_REMOVE_NOT_LOADED"
2018-01-11 10:12:34: "Scheduling sync operation..."
2018-01-11 10:12:34: "Setting up recurrent sync with interval 300"
2018-01-11 10:12:34: "Reducer action", "FOLDER_UPDATE_ALL"
2018-01-11 10:12:34: "Reducer action", "TAG_UPDATE_ALL"
2018-01-11 10:12:34: "Reducer action", "FOLDER_SELECT, e7fe4bc584e04f989ac41cd345ca6dc4"
2018-01-11 10:12:34: "Refreshing notes:", "2", "e7fe4bc584e04f989ac41cd345ca6dc4"
2018-01-11 10:12:34: "Reducer action", "NOTE_UPDATE_ALL, "{\"options\":{\"order\":[{\"by\":\"user_updated_time\",\"dir\":\"DESC\"}],\"uncompletedTodosOnTop\":true},\"parentId\":\"e7fe4bc584e04f989ac41cd345ca6dc4\"}""
2018-01-11 10:12:34: "Reducer action", "NOTE_SELECT, "
2018-01-11 10:12:34: "Rebuilding items...", "Folder", "e7fe4bc584e04f989ac41cd345ca6dc4", "null"
2018-01-11 10:12:34: "Render: folderList"
2018-01-11 10:12:34: "Render: noteList"
2018-01-11 10:12:34: "Render: noteText"
2018-01-11 10:12:35: "DecryptionWorker: starting decryption..."
2018-01-11 10:12:35: "DecryptionWorker: completed decryption."
2018-01-11 10:12:35: "Shortcut:", ":", "Enter command line mode"
2018-01-11 10:12:35: "Render: statusBar"
2018-01-11 10:12:38: "Got command: sync"
2018-01-11 10:12:38: "execCommand()", "["sync"]"
2018-01-11 10:12:38: "Saving updated OneDrive auth."
2018-01-11 10:12:38: "Render: statusBar"
2018-01-11 10:12:38: "Reducer action", "SYNC_STARTED"
2018-01-11 10:12:38: "Sync: starting: Starting synchronisation to target 3... [1515683558336]"
2018-01-11 10:12:38: "Reducer action", "SYNC_REPORT_UPDATE"
2018-01-11 10:12:38: "mkdir /drive/root:/Apps/Joplin/.sync"
2018-01-11 10:12:38: "Render: statusBar"
2018-01-11 10:12:38: "mkdir /drive/root:/Apps/Joplin/.resource"
2018-01-11 10:12:38: "delta /drive/root:/Apps/Joplin"
2018-01-11 10:12:39: "Token expired: refreshing..."
2018-01-11 10:12:39: "Saving updated OneDrive auth."
2018-01-11 10:12:39: "Reducer action", "SETTING_UPDATE_ONE"
2018-01-11 10:12:40: "Token expired: refreshing..."
2018-01-11 10:12:40: "Saving updated OneDrive auth."
2018-01-11 10:12:40: "Reducer action", "SETTING_UPDATE_ONE"
2018-01-11 10:12:40: "Token expired: refreshing..."
2018-01-11 10:12:41: "Saving updated OneDrive auth."
2018-01-11 10:12:41: "Reducer action", "SETTING_UPDATE_ONE"
2018-01-11 10:12:41: "Token expired: refreshing..."
2018-01-11 10:12:41: "Saving updated OneDrive auth."
2018-01-11 10:12:41: "Reducer action", "SETTING_UPDATE_ONE"
2018-01-11 10:12:42: "Token expired: refreshing..."
2018-01-11 10:12:42: "Saving updated OneDrive auth."
2018-01-11 10:12:42: "Reducer action", "SETTING_UPDATE_ONE"
2018-01-11 10:12:42: "Error: Could not execute request after multiple attempts: GET https://s2s-api.onedrive.com/v1.0/drives('me')/items('root%252FApps%252FJoplin')/oneDrive.delta?token=<redacted>
Error: Could not execute request after multiple attempts: GET https://s2s-api.onedrive.com/v1.0/drives('me')/items('root%252FApps%252FJoplin')/oneDrive.delta?token=<redacted>
at OneDriveApi.exec (/usr/local/Cellar/joplin/0.10.87/libexec/lib/node_modules/joplin/lib/onedrive-api.js:244:9)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)"
2018-01-11 10:12:42: "Sync: finished: Synchronisation finished [1515683558336]"
2018-01-11 10:12:42: "Reducer action", "SYNC_REPORT_UPDATE"
2018-01-11 10:12:42: "Operations completed: "
2018-01-11 10:12:42: "Total folders: 4"
2018-01-11 10:12:42: "Total notes: 2"
2018-01-11 10:12:42: "Total resources: 0"
2018-01-11 10:12:42: "There was some errors:"
2018-01-11 10:12:42: "Error: Could not execute request after multiple attempts: GET https://s2s-api.onedrive.com/v1.0/drives('me')/items('root%252FApps%252FJoplin')/oneDrive.delta?token=<redacted>
Error: Could not execute request after multiple attempts: GET https://s2s-api.onedrive.com/v1.0/drives('me')/items('root%252FApps%252FJoplin')/oneDrive.delta?token=<redacted>
at OneDriveApi.exec (/usr/local/Cellar/joplin/0.10.87/libexec/lib/node_modules/joplin/lib/onedrive-api.js:244:9)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)"
2018-01-11 10:12:42: "Reducer action", "SYNC_COMPLETED"
2018-01-11 10:12:42: "Reducer action", "FOLDER_SELECT, e7fe4bc584e04f989ac41cd345ca6dc4"
2018-01-11 10:12:42: "Refreshing notes:", "2", "e7fe4bc584e04f989ac41cd345ca6dc4"
2018-01-11 10:12:42: "Reducer action", "NOTE_UPDATE_ALL, "{\"options\":{\"order\":[{\"by\":\"user_updated_time\",\"dir\":\"DESC\"}],\"uncompletedTodosOnTop\":true},\"parentId\":\"e7fe4bc584e04f989ac41cd345ca6dc4\"}""
2018-01-11 10:12:42: "Reducer action", "NOTE_SELECT, "
2018-01-11 10:12:42: "Render: root"
2018-01-11 10:12:42: "Render: mainWindow"
2018-01-11 10:12:42: "Render: vLayout"
2018-01-11 10:12:42: "Render: hLayout"
2018-01-11 10:12:42: "Render: folderList"
2018-01-11 10:12:42: "Render: noteList"
2018-01-11 10:12:42: "Render: noteLayout"
2018-01-11 10:12:42: "Render: noteText"
2018-01-11 10:12:42: "Render: statusBar"
2018-01-11 10:12:43: "Shortcut:", ":", "Enter command line mode"
2018-01-11 10:12:43: "Render: statusBar"
2018-01-11 10:12:44: "Got command: q"
```