Ubuntu 17.10同步Office365遇OneDrive_Sync错误,求解决方案
Hey there, let’s work through this Office 365 sync snag you’re hitting with GoodSync on Ubuntu 17.10. I’ve helped folks troubleshoot similar URL misconfiguration issues before, so here’s a step-by-step approach to get things sorted:
Retrieve your tenant-specific Office 365 endpoint URL
Generic guides often use a one-size-fits-all URL, but Office 365 (OneDrive Business) uses unique endpoints based on your organization’s tenant. Here’s how to get your exact URL:- Open a terminal and run this command to start the auth flow:
curl https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d3590ed6-52b3-4102-aeff-aad2292ab01c&response_type=code&redirect_uri=https%3A%2F%2Flogin.microsoftonline.com%2Fcommon%2Foauth2%2Fnativeclient&response_mode=query&scope=offline_access%20files.readwrite.all&state=12345 - You’ll be directed to log in with your Office 365 account. After logging in, ignore any "page not found" errors—just copy the
codeparameter from the address bar (it’ll look like a long string of letters and numbers). - Replace
YOUR_AUTH_CODEin this command with the code you copied, then run it to fetch your tenant endpoint:curl -X POST https://login.microsoftonline.com/common/oauth2/v2.0/token -d "client_id=d3590ed6-52b3-4102-aeff-aad2292ab01c&scope=offline_access%20files.readwrite.all&code=YOUR_AUTH_CODE&redirect_uri=https%3A%2F%2Flogin.microsoftonline.com%2Fcommon%2Foauth2%2Fnativeclient&grant_type=authorization_code" - Look for the
resourcefield in the JSON response—this is your tenant’s base API URL. Append/v1.0/me/drive/rootto it to get the root sync URL (e.g.,https://contoso-my.sharepoint.com/personal/john_doe_contoso_com/_api/v2.0/me/drive/root).
- Open a terminal and run this command to start the auth flow:
Update GoodSync’s connection settings
Now that you have the correct URL, adjust your GoodSync setup:- When creating a new sync job, select OneDrive Business (not regular OneDrive) as the connection type.
- If prompted for a "Server URL" or "Endpoint", paste the full URL you generated above.
- Disable any auto-detect URL features—these often fail for custom tenant setups.
Clear cached auth data and re-authenticate
Old cached credentials or misconfigured tokens can break the connection:- Close GoodSync entirely (make sure it’s not running in the background).
- Delete the GoodSync authentication cache with this terminal command:
rm -rf ~/.gdsync/auth/ - Reopen GoodSync and go through the authentication flow again, using your verified endpoint URL.
Test with a minimal sync job
To rule out issues with large files or complex folder structures, create a small test job: sync a single text file from your Ubuntu home folder to a new test folder in Office 365. If this works, you can safely scale up to your full sync set.Check for Ubuntu 17.10-specific dependencies
Ubuntu 17.10 is an older release, so make sure you have the required libraries for GoodSync to handle OAuth2 properly:
Install missing packages with:sudo apt-get install libssl1.0.0 libcurl3-gnutlsThese are often required for older GoodSync versions to connect to Office 365 APIs correctly.
内容的提问来源于stack exchange,提问作者Pierre Blanche

