Code-settings-sync: Keep on getting "Invalid / Expired GitHub Token" message when trying to download

Created on 8 Oct 2017  ·  8Comments  ·  Source: shanalikhan/code-settings-sync

Visual Studio Code Version : 1.17.0
*Code Settings Sync Version : 2.8.3
*
Operating System : macOS 10.12.6
*Occurs On:
[Upload / Download / Help Configuring ]
Proxy Enabled: No
*
GIst Id: [ ID_HERE ]

I have follow the steps several times and keep getting this error message:
Sync : Invalid / Expired GitHub Token. Please generate new token with scopes mentioned in readme. Exception Logged in Console.

Although I don't see any exception being logged to the console.

I've double checked my gitHub token. It's named correctly and has the right permission.

question ❓

Most helpful comment

@JoeTheDave
Bing up Sync: Advanced Options and pick Sync: Edit Extension Local Settings. Now the token key should have your correct token. Here is an example of what you will see:

{
"ignoreUploadFiles":["projects.json","projects_cache_git.json"],
"ignoreUploadFolders":["workspaceStorage"],
"replaceCodeSettings":{},"gistDescription":
"Visual Studio Code Settings Sync Gist",
"version":283,
"token":"<your token should be here>"
}

Your token should be there in place of <your token should be here>. Be aware that it's one line so it's not formatted like above.

Now if you bring up your settings(cmd ,), you should see:

    "sync.gist": "<Gis Id>",
    "sync.lastUpload": "2017-10-08T15:03:08.648Z",
    "sync.autoDownload": false,
    "sync.autoUpload": false,
    "sync.lastDownload": "2017-10-08T14:26:28.220Z",
    "sync.forceDownload": false,
    "sync.anonymousGist": false,
    "sync.host": "",
    "sync.pathPrefix": "",
    "sync.quietSync": false,
    "sync.askGistName": false,

sync.gist should have your correct Gist Id which can be found by going to Your Gist and choosing cloudSettings. The url is in this format https://gist.github.com/<username>/<your-gist>, you want to get the <your-gist> part of the url and plug that into your setting "sync.gist" shown above.

Hope that helps!

All 8 comments

@JoeTheDave
Bing up Sync: Advanced Options and pick Sync: Edit Extension Local Settings. Now the token key should have your correct token. Here is an example of what you will see:

{
"ignoreUploadFiles":["projects.json","projects_cache_git.json"],
"ignoreUploadFolders":["workspaceStorage"],
"replaceCodeSettings":{},"gistDescription":
"Visual Studio Code Settings Sync Gist",
"version":283,
"token":"<your token should be here>"
}

Your token should be there in place of <your token should be here>. Be aware that it's one line so it's not formatted like above.

Now if you bring up your settings(cmd ,), you should see:

    "sync.gist": "<Gis Id>",
    "sync.lastUpload": "2017-10-08T15:03:08.648Z",
    "sync.autoDownload": false,
    "sync.autoUpload": false,
    "sync.lastDownload": "2017-10-08T14:26:28.220Z",
    "sync.forceDownload": false,
    "sync.anonymousGist": false,
    "sync.host": "",
    "sync.pathPrefix": "",
    "sync.quietSync": false,
    "sync.askGistName": false,

sync.gist should have your correct Gist Id which can be found by going to Your Gist and choosing cloudSettings. The url is in this format https://gist.github.com/<username>/<your-gist>, you want to get the <your-gist> part of the url and plug that into your setting "sync.gist" shown above.

Hope that helps!

I'm always looking to improve the documentation of extension if its hard for someone to understand.
Just send me pull request and it will be updated in next version.

@shanalikhan In my opinion I don't think the problem is with your verbiage but the lack of understanding how the syncing works. I think a lot of people get confused between Token and Gist Id so they're not putting the correct value.

Hello, Same problem with me as well. I have followed the instructions but could not sync the settings. I have used
GIST ID itself as Token and in User Settings I have used GIST ID as you have explained.
Sync Options are as shown below:

{"ignoreUploadFiles":["projects.json","projects_cache_vscode.json","projects_cache_git.json","projects_cache_svn.json","gpm_projects.json","gpm-recentItems.json"],"ignoreUploadFolders":["workspaceStorage"],"replaceCodeSettings":{},"gistDescription":"Sync Settings of VS Code","version":287,"token":"MY GENERATED GIST Key HERE"}

and USer settings are as follows:

"window.zoomLevel": 0,
"sync.gist": "https://gist.github.com/MY_GIT_USER_NAME/MY GENERATED GIST Key HERE",
"sync.lastUpload": "",
"sync.autoDownload": false,
"sync.autoUpload": false,

The system gives following error when I press Shift+Alt+D
Sync : Invalid / Expired GitHub Token. Please generate new token with scopes mentioned in readme. Exception Logged in Console.

I referred another similar issue. Reset the Extension settings and tried to download the settings again and it worked. Thanks.

Hi Guys,
Let me share with you how I solved this problem on my environment. [Download a existing git in different PC's]

Following these steps. maybe it could help you.

  1. ctrl + shift + p (to open the palette) then you should write "Sync: Reset Extension Settings". this is for ensure the values are empty.

  2. Go to https://gist.github.com/ and click on the gist you want to download.

  3. There you can do scroll down till you find a file named "settings.json", in this file you can get the "sync.gist" [Gist ID].

  4. Now, just go to the VSCode and press (alt+ shift + d), then, VSCode redirect you to the web page and you can select the gist file and generate the token.

  5. Finally, you have both values, Gist ID and Token. Now, you should fill correctly inside of VSCode.

Hope the previous steps can help you. it works for me. :)

Troubleshooting page is created here.

Anyone, who has fixed the problem like users above can add information there to help other guys.
https://github.com/shanalikhan/code-settings-sync/wiki/Troubleshooting

Was this page helpful?
0 / 5 - 0 ratings