Code-settings-sync: invalid gist id

Created on 22 Aug 2017  ·  22Comments  ·  Source: shanalikhan/code-settings-sync

Visual Studio Code Version : 1.15.1
Code Settings Sync Version : 2.8.3
Operating System : [ win10 ]
Occurs On: [ Download ]
Proxy Enabled: [ No ]
GIst Id: d02a0d9368037db46ea3df8e22c6316f87ba2596

Hello I have an error after entering gist on another vscode. I checked gist and it is fine and is accessible via username/gist url.
Sync : Invalid Gist Id Entered. Verify your gist : https://gist.github.com//.
Where it tries to take that userName from?

question ❓

Most helpful comment

I had the same issue as @agne-a-t last discribed.
Solved by visiting https://gist.github.com//
Then enter the gist called "cloudSettings"
And finally copied the token shown IN THE ADDRESS BAR!!!
That is the correct token!

All 22 comments

Me too
this gist is working:
https://gist.github.com/liucan89096/78c422cd0bb4ce494e370ebdfe91089abec8add3

But it's not working for code-settings-sync

These are my keys:
GITHUB TOKEN: 78c422cd0bb4ce494e370ebdfe91089abec8add3
GITHUB GIST: 3d4f56564770588e03fb1d5d7e76b3bf
GITHUB GIST TYPE: Secret

@liucan89096

GITHUB TOKEN: 78c422cd0bb4ce494e370ebdfe91089abec8add3

You have set gist value as TOKEN

shanalikhan - but how it can be - i installed sync plugin, once uploaded for first time i was asked for gist. I entered it and uploaded everything. All works on that machine. So why gist is not uploaded because you can see all settings is stored there?

what is your uploaded Gist URL.
Can you see from the gist and share the url uploaded

Hmmm interesting scenario happened can you explain how?
I created gist following your manual
I stored that gist for future use it was (d02a0d9368037db46ea3df8e22c6316f87ba2596)
On source machine i uploaded settings for first time entering that gist (shown over)
On target machine I installed sync plugin and tried to download using same gist
Later I i find out that in sync settings under sync.gist there is completely different gist: 4d0dd50707241eec170f3c6cd6c1ea10
It seams like d02a0d9368037db46ea3df8e22c6316f87ba2596 ( https://gist.github.com/agne-a-t/d02a0d9368037db46ea3df8e22c6316f87ba2596) is pointing not to exact sync settings but to all gists...?!!
Why? if after gist creation it was advised to save that gist and first upload was working fine....?

is pointing not to exact sync settings

I think the old gist setting was somehow removed from the code settings depending on which activities on code you performed between first and second upload.
and when you hit the uploaded , it created new one, and new one in all computers to sync.

I had the same issue as @agne-a-t last discribed.
Solved by visiting https://gist.github.com//
Then enter the gist called "cloudSettings"
And finally copied the token shown IN THE ADDRESS BAR!!!
That is the correct token!

@rafaelbdb that worked for me! +1

Hi guys. I encountered recently the same problem and I manage to fixed after all. If you still did not sort it out I recommend you follow these steps:

  1. Make sure your gist is public.
  2. Navigate to View > Command Palette in Visual Studio Code and type sync. Now click on "Sync: Reset Extention Settings".
  3. After that follow again the step 2 and choose "Sync: Download Settings" this time.
  4. Now enter the link for your public gist and it should install your settings.

I hope this is helpful.

The solution @rafaelbdb proposed follows from reading system messages. Gist ID and token are two different character strings; this may seem natural to those better versed in Git, so it's not empathized anywhere, but I assume that's what got @agne-a-t confused initially. You create a GitHub token that is used for upload, but to download settings on another machine you need its corresponding Gist ID; it's reported on successful upload in-app, it literally says «Please copy and use this ID in other machines to download settings» there. Granted, you need both on every machine for 2-way sync.

I've just spent too much time figuring it out, so I'm leaving this here for others who may find themselves in the same situation.

@rafaelbdb that worked for me! +1

I'm always looking to improve the documentation for understanding if its hard for anyone.
Send me pull request and i will release it

on every machine you have a "token:" in syncLocalSettings.json and a "sync.gist:" on the local settings (this is the GIST ID). You must share the same valid token-gistID pair everywhere

As suggested in #448, I'd also like to urge @shanalikhan to clarify in README that there are two hash strings (Token and Gist Id) when you use this wonderful extension.

A Token is a hash you get right after fill in a description check the box for gist.
A Gist Id is another hash the extension returns you when you upload your setting.

During uploading, you need the Token (and the extension will return you Gist Id).
During downloading, you first need the Token and then the Gist Id.

The fact that they both are hash strings confuses the first-time users.

@JeremyCCHsu Send me pull request where you think documentation can be improved.
I will accept :)

@rafaelbdb yes,I also use the gist in atom,so the gist has two files. thank you

@JeremyCCHsu Thank you, I've been entering those 2 other way around.

my gist address is working. but it gives me the error Invalid / Expired GitHub Token, when I run the command sync : Download Settings,.

I solved this problem by these step

  1. copy the value of sync.gist from file settings.json and paste it to target machine.
  2. copy the value of token from file syncLocalSettings.json and paste it to target machine.
  3. run the command sync : Download Settings

Hope that helps!

This is one more example of how _great coders_ are _horrible documenters_. 😅

Summarizing what @lizijie and @JeremyCCHsu eloquently pointed, simply IGNORE the official documentation and understand you will need TWO sets of keys: the TOKEN and the GIST-ID.

The TOKEN is obtained from the "_Personal access tokens_" screen on Github, and it is needed to start the process and upload your VSCode Config to Gist.

To download your settings in another machine, you MUST know your GIST-ID. There are three ways it can be done:

  1. Immediately after the first upload is complete, yet on the original machine, by looking into your _User Settings_ (it is listed as "sync.gist")
  2. If you have your VSCode set to display Output Logs, after the upload is complete you can see all the _### keys_ in the OUTPUT Console as:

    ```
    CODE SETTINGS SYNC UPLOAD SUMMARY
    Version: 2.9.2


GitHub Token: TOKEN*
GitHub Gist: **GIST-ID

GitHub Gist Type: Secret
```

  1. At any time by accessing https://gist.github.com/ and clicking on the Gist called "cloudSettings". Your GIST-ID will be the last element of the URL, after your /<userid>/. Example: https://gist.github.com/<userid>/**GIST-ID**

On every other machine you want to sync, you can simply edit your USER SETTINGS and manually add the GIST-ID in the "sync.gist" variable before invoking the Sync Download using SHIFT+ALT+D for the first time. Then, if asked, enter the TOKEN.

Most likely you WILL need the *TOKEN in the other machines to perform further uploads.

It seems like a simple process, and it is!!! Sadly, a badly written documentation can deceive even the most experienced user. I was about to drop this valuable extension because of this mess. Thanks everyone for the tips.

I hope someone fixes the documentation now (this thread is already 11 months old and it will be a shame to celebrate its first birthday yet having the problem bugging around).

IMPORTANT: Do not follow @bluecondor's advise to make your Gist public. I know the intention was to help but you do not want this specific Gist to be public. If you did it, I strongly suggest you go back and revert your gist to private.

ADDITIONAL INFORMATION (TIP): I shared my "cloudSettings Gist" with a colleague at the office, and he was able to embbed my settings into his onw VSCode settings. Pretty cool, hum? 😈 The process was very simple: First I obtained my Gist Sharing Link (some info and _how-tos_ here: https://help.github.com/articles/forking-and-cloning-gists/) and send it to him. He then FORKED my "cloudSettings Gist". After that, as the GIST-ID was already created for the _forked Gist_, it was a simple matter of creating the TOKEN on Github. With both _keys_ at hand, he installed the _Settings Sync extension_ and pressed ALT+SHIT+D to start the download proccess. The extension asked for the TOKEN, and immediately after asked for the GIST-ID. We entered both and it worked flawlessly. I hope it also goes to the documentation (which, BTW, has all info we discussed around this thread, just "really messy" and "confusing" after the TOKEN creation).

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

Related issues

axetroy picture axetroy  ·  4Comments

betimer picture betimer  ·  3Comments

that70schris picture that70schris  ·  5Comments

pravic picture pravic  ·  5Comments

darkvertex picture darkvertex  ·  4Comments