Code-settings-sync: Stoped to work after update to 2.4.2

Created on 9 Jan 2017  路  34Comments  路  Source: shanalikhan/code-settings-sync

Visual Studio Code Version : 1.8.1
Code Sync Settings Version : 2.4.2
Operating System : Fedora 25
Occurs On: Startup and every time I try to run a sync command
Proxy Enabled: No

Right after I update it to the last version, I got this error message at realod and every time I try to run a sync command:

captura de tela de 2017-01-09 15-49-29

This is the message:
"Error Logged In Console (Help menu > Toggle Developer Tools). You may open an issue using 'Sync : Open Issue' from advance setting command."

I tryed to uninstall and install again, restart the computer and so on. =/

bug 馃悰 code-limitation fixed

Most helpful comment

actually, this is caused by code API itself while saving the old extension setting syncSettings.json content to code settings.json file.

Similar issue is opened already in code.
https://github.com/Microsoft/vscode/issues/3641

As its from the API, I will see what can be done from the extension side

All 34 comments

I got this error message too.

Visual Studio Code Version : 1.8.1
Code Sync Settings Version : 2.4.2
Operating System : Windows7 64bit
Occurs On: Startup and every time

Same here, I now get this error each time I open VSCode

Same/Similar issue on OSX.
VSC Version 1.8.0 and 1.8.1
Code Sync: 2.4.2
OSX 10.12.3
2017-01-09 at 6 46 pm

2017-01-09 at 6 48 pm

Occurs On: Startup and every time I try to run a sync command

As it runs in on code start. I need to identify please answer

Do you have auto upload enabled or auto download enabled?
Are all the settings are migrated to code configurations?
Is the syncSettings.json file deleted in the User folder?

auto upload or download is disabled
i did not migrate the settings to code configurations
syncSettings.json is not deleted

+1

FYI in my case it was a fresh install. I'd never used/installed this extension before.

@shanalikhan, I can't see my options, because I'm not able to open up they anymore. =/

I had the same problem with code sync also in my PC:

code-sync-error-windows-10

My sync options are public here:
https://gist.github.com/willgm/d7c954a6bbd12e8e3e79e1b7b01619cf

Coudn't find the syncSettings.json at my windows pc, and I'm not with my Fedora today.

Coudn't find the syncSettings.json at my windows pc

Because all the settings from syncsettings.json is now in code settings file, u can check its available and old file is deleted.

.......

Solution
The Gist you have provided has not valid JSON in settings.json , can you please edit it manually and update Also check code settings file is also valid JSON file, as your current settings.json file is not valid and extension is failing in start up due to this in my computer also.

.....

@dylove1010 can you also please provide the GIST you last synced if its possible

@shanalikhan, I removed the extra comma at the settings.json as you asked, and now code sync is fine again! That was probably the issue.

I'm used to use trailing commas in object literals, as explaned here:
http://www.2ality.com/2013/07/trailing-commas.html

Of course it makes an invalid json, but is a valid ES5 and as VSC never complained about it.

What about give more meaningful feedback for this kind of problems?

actually, this is caused by code API itself while saving the old extension setting syncSettings.json content to code settings.json file.

Similar issue is opened already in code.
https://github.com/Microsoft/vscode/issues/3641

As its from the API, I will see what can be done from the extension side

Got it!

Thanks for this great tool man! Keep it up! =)

I think this is the problem for other users also.

I'm keeping this issue open and fill show a message to user to make sure it have valid JSON in all the Code configurations files in the next version.

Still not working for me. I tried creating a blank syncSettings.json file, changed the error but still didn't work... I tried dropping the content from my settings.json file in there, still didn't work.

At this point I've given up (I don't really need it anymore, I've manually copied settings around as needed).

It does seem a handy tool, although personally I'd rather just put these files in something like dropbox (personally I don't really need to share publicly, just across machines).

I have two machines where the syncing doesn't work and another one where it does.

On the machines where it doesn't work, this is what I get as the output messages when attempting to download the gist (made by the other machine where this extension works):

[Extension Host] Linux
[Extension Host] {"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}
[Extension Host] Output omitted for a large object that exceeds the limits
Error Logged In Console (Help menu > Toggle Developer Tools). You may open an issue using 'Sync : Open Issue' from advance setting command.

Do you have any idea of what might be the cause ?

@farrajota

Bad credentials

Check this link. https://github.com/shanalikhan/code-settings-sync/issues/177

@jb510 are you sure you have all the files .json in user folder are valid JSON ? no trailing commas, try with putting simple {} in the settings.json and json files and try again

@shanalikhan thanks, that solved my problem.

@shanalikhan I tried again, and yes there was a trailing comma in one of the settings files... removing that fixed it and code-settings-sync worked!

Thank you for the helpful tool and the help getting it working!

I was able to resolve this by a simple rest of the extension settings and re-adding the token.
I also uninstalled and reinstalled the extension.

IMO you can try to read the json file like this:
https://github.com/palantir/tslint/blob/master/src/configuration.ts#L172-L177

This way you can read json file with comments.

The settings.json has comments in it when first created by vscode. So most users have comments in that file and will receive this error. 馃尫

Looks like alot of users are having problem. I'm busy nowadays in other work. If anyone can send me pull request i will make release newer version fixing this problem otherwise you guys need to wait until my exams are over 馃槃 in week or so, i'm sorry for that.

@unional Thanks, i will check it out.

Sorry I'm a complete newbie at this. So how do I check the settings.json file again?

Command prompt

Preferences : Open User Settings

I just checked my settings.json and it only has my custom settings which is editor.renderIndentGuides, editor.fontSize and editor.fontFamily.

I thought when I first initialised sync is that the GIST ID will be listed here??

Also, is it normal to have 1 error: property expect (11,1)

    // Controls the font family.
    "editor.fontFamily": "'SFNS Display', Menlo, Monaco, 'Courier New', monospace",
} <-- error is at this line

You have an extra comma at the end

Oh nice! That solved the whole error part. So perhaps for sync to work, it needs to have a 0 error in the settings.json file?

Yes, because currently it is ready the file as JSON, so for it to work, the file must be valid JOSN. Meaning no extra comma, no comments.

Comments like this is fine though:

// Controls the font family.

Same Problem here :/

@davidhellmann have you checked your user settings JSON file? It must not have any red errors in it.

Same issue for two people I know doing a fresh install.

@brunolm I had this issue with a fresh install as well, have they checked their settings.json?

I cant save that file in JSON as i have to use their API to save the settings in settings.json
Code API gives that error while saving the settings.
I have released the newer version in order to give proper error to make it valid JSON to make extension work.
Comments are allowed but i think trailing commas are not allowed.

.......
Solution
Make sure you dont have trailing commas in settings.json file
.....

Iam going to open issue in code and let them know about the API behavior.

You can up vote and give ideas there.

@wheelhot according to one of them he saw this thread and tried to remove trailing commas and all comments, but it still didn't work.

The next day it worked. Maybe he needed to restart something, I don't know exactly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mklement0 picture mklement0  路  5Comments

dawsbot picture dawsbot  路  5Comments

that70schris picture that70schris  路  5Comments

larrym picture larrym  路  4Comments

pravic picture pravic  路  5Comments