atom-community / sync-settings

Synchronize all your settings and packages across atom instances
https://atom.io/packages/sync-settings
MIT License
1.14k stars 105 forks source link

Uncaught SyntaxError: Unexpected token c in JSON at position 0 #315

Closed satoyoshiki closed 7 years ago

satoyoshiki commented 7 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.12.5 Electron Version: 1.3.9 System: Mac OS X 10.12.1 Thrown From: sync-settings package, v0.7.2

Stack Trace

Uncaught SyntaxError: Unexpected token c in JSON at position 0

At file:///Applications/Atom.app/Contents/Resources/app.asar/static/index.html#%7B%22initialPaths%22%3A%5B%5D%2C%22locationsToOpen%22%3A%5B%7B%7D%5D%2C%22windowInitializationScript%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%2Fsrc%2Finitialize-application-window.js%22%2C%22resourcePath%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22profileStartup%22%3Afalse%2C%22clearWindowState%22%3Afalse%2C%22env%22%3A%7B%22TMPDIR%22%3A%22%2Fvar%2Ffolders%2Fp8%2Fvz5chjn91td6k2x_dj4jt_tm0000gn%2FT%2F%22%2C%22__CF_USER_TEXT_ENCODING%22%3A%220x1F5%3A0x1%3A0xE%22%2C%22HOME%22%3A%22%2FUsers%2Fyoshiki%22%2C%22SHELL%22%3A%22%2Fbin%2Fbash%22%2C%22Apple_PubSub_Socket_Render%22%3A%22%2Fprivate%2Ftmp%2Fcom.apple.launchd.aLl6DeerLP%2FRender%22%2C%22SSH_AUTH_SOCK%22%3A%22%2Fprivate%2Ftmp%2Fcom.apple.launchd.FNwiRMrlDw%2FListeners%22%2C%22PATH%22%3A%22%2Fusr%2Fbin%3A%2Fbin%3A%2Fusr%2Fsbin%3A%2Fsbin%22%2C%22LOGNAME%22%3A%22yoshiki%22%2C%22XPC_SERVICE_NAME%22%3A%22com.github.atom.1460%22%2C%22COMMAND_MODE%22%3A%22unix2003%22%2C%22USER%22%3A%22yoshiki%22%2C%22XPC_FLAGS%22%3A%220x0%22%2C%22GOOGLE_API_KEY%22%3A%22AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q%22%2C%22ATOM_HOME%22%3A%22%2FUsers%2Fyoshiki%2F.atom%22%7D%2C%22appVersion%22%3A%221.12.5%22%2C%22atomHome%22%3A%22%2FUsers%2Fyoshiki%2F.atom%22%2C%22shellLoadTime%22%3A406%7D:1

SyntaxError: Unexpected token c in JSON at position 0
    at Object.parse (native)
    at /Users/yoshiki/.atom/packages/sync-settings/lib/sync-settings.coffee:204:24
    at global.sendError (/Users/yoshiki/.atom/packages/sync-settings/node_modules/github4/index.js:729:13)
    at /Users/yoshiki/.atom/packages/sync-settings/node_modules/github4/index.js:736:29
    at callCallback (/Users/yoshiki/.atom/packages/sync-settings/node_modules/github4/index.js:613:17)
    at ClientRequest.<anonymous> (/Users/yoshiki/.atom/packages/sync-settings/node_modules/github4/index.js:684:17)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at TLSSocket.socketErrorListener (_http_client.js:308:9)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at emitErrorNT (net.js:1272:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Commands

     -1:26.5.0 sync-settings:view-backup (atom-text-editor.editor.is-focused)
     -1:15.2.0 sync-settings:restore (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "telemetryConsent": "no"
  },
  "sync-settings": {
    "_analyticsUserId": "c73fcbf9-dc41-4a36-9edb-8a29648bdcae",
    "gistId": "992d60e39c46168856f0bf048e837d6d",
    "personalAccessToken": "xxxxx"
  }
}

Installed Packages

# User
dash, v1.7.0 (inactive)
sync-settings, v0.7.2 (active)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.52.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.45.0 (inactive)
base16-tomorrow-dark-theme, v1.3.0 (inactive)
base16-tomorrow-light-theme, v1.3.0 (inactive)
one-dark-ui, v1.6.2 (active)
one-light-ui, v1.6.2 (inactive)
one-dark-syntax, v1.5.0 (active)
one-light-syntax, v1.5.0 (inactive)
solarized-dark-syntax, v1.0.5 (inactive)
solarized-light-syntax, v1.0.5 (inactive)
about, v1.7.0 (active)
archive-view, v0.62.0 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.13.1 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.4 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (active)
background-tips, v0.26.1 (active)
bookmarks, v0.42.0 (active)
bracket-matcher, v0.82.2 (active)
command-palette, v0.39.0 (inactive)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.40.0 (active)
find-and-replace, v0.202.2 (inactive)
fuzzy-finder, v1.4.0 (active)
git-diff, v1.1.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.2 (active)
image-view, v0.60.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.2 (inactive)
markdown-preview, v0.158.8 (active)
metrics, v1.1.2 (active)
notifications, v0.65.1 (active)
open-on-github, v1.2.1 (inactive)
package-generator, v1.0.1 (inactive)
settings-view, v0.243.1 (active)
snippets, v1.0.4 (active)
spell-check, v0.68.4 (active)
status-bar, v1.4.1 (active)
styleguide, v0.47.2 (active)
symbols-view, v0.113.1 (inactive)
tabs, v0.103.0 (active)
timecop, v0.33.2 (active)
tree-view, v0.210.0 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.35.1 (active)
whitespace, v0.35.0 (active)
wrap-guide, v0.38.2 (active)
language-c, v0.54.0 (active)
language-clojure, v0.22.1 (active)
language-coffee-script, v0.48.0 (active)
language-csharp, v0.13.0 (active)
language-css, v0.40.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (active)
language-go, v0.43.0 (active)
language-html, v0.47.1 (active)
language-hyperlink, v0.16.1 (active)
language-java, v0.24.0 (active)
language-javascript, v0.122.0 (active)
language-json, v0.18.3 (active)
language-less, v0.29.6 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.37.0 (active)
language-php, v0.37.3 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.1 (active)
language-ruby, v0.70.2 (active)
language-ruby-on-rails, v0.25.1 (active)
language-sass, v0.57.0 (active)
language-shellscript, v0.23.0 (active)
language-source, v0.9.0 (active)
language-sql, v0.25.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.29.1 (active)
language-toml, v0.18.1 (active)
language-xml, v0.34.12 (active)
language-yaml, v0.27.1 (active)

# Dev
No dev packages
dirk-thomas commented 7 years ago

In the above error report you have shared your personalAccessToken. You must revoke it to prevent abuse.

gaco commented 7 years ago

Same issue with me. I can share the packages too, if needed. I didn't share to not overpopulate this topic.

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.12.6 Electron Version: 1.3.9 System: Microsoft Windows 7 Enterprise Thrown From: sync-settings package, v0.7.2

Stack Trace

Uncaught SyntaxError: Unexpected token g in JSON at position 0

At file:///C:/Users/gcortes/AppData/Local/atom/app-1.12.6/resources/app.asar/static/index.html#%7B%22initialPaths%22%3A%5B%22C%3A%5C%5CDevelopment%5C%5CMIM%5C%5CLearning%5C%5CJavascript%22%5D%2C%22locationsToOpen%22%3A%5B%7B%22pathToOpen%22%3A%22C%3A%5C%5CDevelopment%5C%5CMIM%5C%5CLearning%5C%5CJavascript%22%2C%22initialLine%22%3Anull%2C%22initialColumn%22%3Anull%2C%22forceAddToWindow%22%3Afalse%7D%5D%2C%22windowInitializationScript%22%3A%22C%3A%5C%5CUsers%5C%5Cgcortes%5C%5CAppData%5C%5CLocal%5C%5Catom%5C%5Capp-1.12.6%5C%5Cresources%5C%5Capp.asar%5C%5Csrc%5C%5Cinitialize-application-window.js%22%2C%22resourcePath%22%3A%22C%3A%5C%5CUsers%5C%5Cgcortes%5C%5CAppData%5C%5CLocal%5C%5Catom%5C%5Capp-1.12.6%5C%5Cresources%5C%5Capp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22profileStartup%22%3Afalse%2C%22clearWindowState%22%3Afalse%2C%22env%22%3A%7B%22AIF_HOME%22%3A%22C%3A%5C%5CAIF_900010_HF%5C%5Cdist%22%2C%22ALLUSERSPROFILE%22%3A%22C%3A%5C%5CProgramData%22%2C%22AMDOCS_PM_HOME%22%3A%22C%3A%5C%5Capm%5C%5CAPM9.0.0.pb03_hf03%22%2C%22APPDATA%22%3A%22C%3A%5C%5CUsers%5C%5Cgcortes%5C%5CAppData%5C%5CRoaming%22%2C%22ARISHOME71%22%3A%22C%3A%5C%5CProgram%20Files%5C%5CARIS7.1%5C%5C%22%2C%22ATOM_HOME%22%3A%22C%3A%5C%5CUsers%5C%5Cgcortes%5C%5C.atom%22%2C%22ATOM_NODE_URL%22%3A%22http%3A%2F%2Fgh-contractor-zcbenz.s3.amazonaws.com%2Fatom-shell%2Fdist%20%2FM%22%2C%22BEA_HOME%22%3A%22C%3A%5C%5CBEA1212%22%2C%22ChocolateyInstall%22%3A%22C%3A%5C%5CProgramData%5C%5Cchocolatey%22%2C%22ChocolateyLastPathUpdate%22%3A%22Mon%20Nov%2021%2010%3A45%3A54%202016%22%2C%22CMDER_ROOT%22%3A%22C%3A%5C%5CDevelopment%5C%5COMS%5C%5CTools%5C%5Ccmder%22%2C%22CommonProgramFiles%22%3A%22C%3A%5C%5CProgram%20Files%20(x86)%5C%5CCommon%20Files%22%2C%22CommonProgramFiles(x86)%22%3A%22C%3A%5C%5CProgram%20Files%20(x86)%5C%5CCommon%20Files%22%2C%22CommonProgramW6432%22%3A%22C%3A%5C%5CProgram%20Files%5C%5CCommon%20Files%22%2C%22COMPUTERNAME%22%3A%22GCORTES03%22%2C%22ComSpec%22%3A%22C%3A%5C%5CWINDOWS%5C%5Csystem32%5C%5Ccmd.exe%22%2C%22DEV%22%3A%22C%3A%5C%5CDevelopment%22%2C%22DEV_HOME%22%3A%22C%3A%5C%5Coms%5C%5C1701-Dev-Main%5C%5Ccust%5C%5Coms%5C%5Cbb%22%2C%22FP_NO_HOST_CHECK%22%3A%22NO%22%2C%22GOOGLE_API_KEY%22%3A%22AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q%22%2C%22HF_DB_PASS%22%3A%22GCORTES%22%2C%22HF_DB_PORT%22%3A%221521%22%2C%22HF_DB_USER%22%3A%22GCORTES%22%2C%22HOMEDRIVE%22%3A%22C%3A%22%2C%22HOMEPATH%22%3A%22%5C%5CUsers%5C%5Cgcortes%22%2C%22HOST%22%3A%22localhost%22%2C%22JAVAWS_VM_ARGS%22%3A%22-Xdebug%20-Xrunjdwp%3Atransport%3Ddt_socket%2Cserver%3Dy%2Csuspend%3Dn%2Caddress%3D8585%22%2C%22JAVA_HOME%22%3A%22C%3A%5C%5CProgra~1%5C%5CJava%5C%5Cjdk1.7.0_60%22%2C%22JAVA_HOME_32%22%3A%22C%3A%5C%5CProgram%20Files%20(x86)%5C%5CJava%5C%5Cjre7%5C%5C%22%2C%22LOCALAPPDATA%22%3A%22C%3A%5C%5CUsers%5C%5Cgcortes%5C%5CAppData%5C%5CLocal%22%2C%22LOGONSERVER%22%3A%22%5C%5C%5C%5CSTLDC1%22%2C%22MAVEN_HOME%22%3A%22C%3A%5C%5Capache-maven-3.2.5%22%2C%22MAVEN_OPTS%22%3A%22-Xmx1024m%20-XX%3AMaxPermSize%3D256M%20-Dfile.encoding%3D%5C%22UTF-8%5C%22%22%2C%22NUMBER_OF_PROCESSORS%22%3A%224%22%2C%22OMS_DB_HOST%22%3A%22scolin01%22%2C%22OMS_DB_SID%22%3A%22VVLOMSB%22%2C%22ORACLE_HOME%22%3A%22O%3A%5C%5Cora1210%22%2C%22OS%22%3A%22Windows_NT%22%2C%22Path%22%3A%22C%3A%5C%5CPython35%5C%5CScripts%5C%5C%3BC%3A%5C%5CPython35%5C%5C%3BO%3A%5C%5Cora1210%5C%5CBIN%3BO%3A%5C%5Cora1210%5C%5CBIN%3BC%3A%5C%5CWINDOWS%5C%5Csystem32%3BC%3A%5C%5CWINDOWS%3BC%3A%5C%5CWINDOWS%5C%5CSystem32%5C%5CWbem%3BC%3A%5C%5CWINDOWS%5C%5CSystem32%5C%5CWindowsPowerShell%5C%5Cv1.0%5C%5C%3BC%3A%5C%5CProgram%20Files%5C%5CPerforce%3BC%3A%5C%5Capache-maven-3.2.5%5C%5Cbin%3BC%3A%5C%5CProgra~1%5C%5CJava%5C%5Cjdk1.7.0_60%5C%5Cbin%3BC%3A%5C%5CProgram%20Files%20(x86)%5C%5CPerforce%3BC%3A%5C%5CProgram%20Files%20(x86)%5C%5CPerforce%5C%5CDVCS%5C%5C%3BC%3A%5C%5CDevelopment%5C%5COMS%5C%5CTools%5C%5Ccmder%5C%5C%3BC%3A%5C%5CProgram%20Files%5C%5CMicrosoft%20SQL%20Server%5C%5C130%5C%5CTools%5C%5CBinn%5C%5C%3BC%3A%5C%5CProgram%20Files%5C%5CGit%5C%5Ccmd%3BC%3A%5C%5CProgramData%5C%5Cchocolatey%5C%5Cbin%3BC%3A%5C%5CProgram%20Files%5C%5Cnodejs%5C%5C%3BC%3A%5C%5CProgram%20Files%20(x86)%5C%5CYarn%5C%5Cbin%3BC%3A%5C%5Capache-maven-3.2.5%5C%5Cbin%3BO%3A%5C%5Cora1210%5C%5CBIN%3BC%3A%5C%5CUsers%5C%5Cgcortes%5C%5CAppData%5C%5CLocal%5C%5CPandoc%5C%5C%3BC%3A%5C%5Cbabun%5C%5C.babun%3BC%3A%5C%5CProgram%20Files%20(x86)%5C%5CMicrosoft%20VS%20Code%5C%5Cbin%3BC%3A%5C%5CUsers%5C%5Cgcortes%5C%5CAppData%5C%5CLocal%5C%5Catom%5C%5Cbin%3BC%3A%5C%5CUsers%5C%5Cgcortes%5C%5CAppData%5C%5CRoaming%5C%5Cnpm%3BC%3A%5C%5CUsers%5C%5Cgcortes%5C%5CAppData%5C%5CLocal%5C%5CYarn%5C%5C.bin%22%2C%22PATHEXT%22%3A%22.COM%3B.EXE%3B.BAT%3B.CMD%3B.VBS%3B.VBE%3B.JS%3B.JSE%3B.WSF%3B.WSH%3B.MSC%3B.PY%3B.PYW%22%2C%22personal%22%3A%22C%3A%5C%5CDevelopment%5C%5COMS%5C%5CPersonalDocs%22%2C%22PROCESSOR_ARCHITECTURE%22%3A%22x86%22%2C%22PROCESSOR_ARCHITEW6432%22%3A%22AMD64%22%2C%22PROCESSOR_IDENTIFIER%22%3A%22Intel64%20Family%206%20Model%2058%20Stepping%209%2C%20GenuineIntel%22%2C%22PROCESSOR_LEVEL%22%3A%226%22%2C%22PROCESSOR_REVISION%22%3A%223a09%22%2C%22ProgramData%22%3A%22C%3A%5C%5CProgramData%22%2C%22ProgramFiles%22%3A%22C%3A%5C%5CProgram%20Files%20(x86)%22%2C%22ProgramFiles(x86)%22%3A%22C%3A%5C%5CProgram%20Files%20(x86)%22%2C%22ProgramW6432%22%3A%22C%3A%5C%5CProgram%20Files%22%2C%22PSModulePath%22%3A%22C%3A%5C%5CWINDOWS%5C%5Csystem32%5C%5CWindowsPowerShell%5C%5Cv1.0%5C%5CModules%5C%5C%22%2C%22PUBLIC%22%3A%22C%3A%5C%5CUsers%5C%5CPublic%22%2C%22SESSIONNAME%22%3A%22Console%22%2C%22SystemDrive%22%3A%22C%3A%22%2C%22SystemRoot%22%3A%22C%3A%5C%5CWINDOWS%22%2C%22TEMP%22%3A%22C%3A%5C%5CUsers%5C%5Cgcortes%5C%5CAppData%5C%5CLocal%5C%5CTemp%22%2C%22TMP%22%3A%22C%3A%5C%5CUsers%5C%5Cgcortes%5C%5CAppData%5C%5CLocal%5C%5CTemp%22%2C%22UATDATA%22%3A%22C%3A%5C%5CWINDOWS%5C%5CCCM%5C%5CUATData%5C%5CD9F8C395-CAB8-491d-B8AC-179A1FE1BE77%22%2C%22USERDNSDOMAIN%22%3A%22CORP.AMDOCS.COM%22%2C%22USERDOMAIN%22%3A%22NTNET%22%2C%22USERDOMAIN_ROAMINGPROFILE%22%3A%22NTNET%22%2C%22USERNAME%22%3A%22gcortes%22%2C%22USERPROFILE%22%3A%22C%3A%5C%5CUsers%5C%5Cgcortes%22%2C%22USER_MEM_ARGS%22%3A%22-XX%3APermSize%3D1024M%20-XX%3AMaxPermSize%3D1024M%22%2C%22VS140COMNTOOLS%22%3A%22C%3A%5C%5CProgram%20Files%20(x86)%5C%5CMicrosoft%20Visual%20Studio%2014.0%5C%5CCommon7%5C%5CTools%5C%5C%22%2C%22windir%22%3A%22C%3A%5C%5CWINDOWS%22%2C%22windows_tracing_flags%22%3A%223%22%2C%22windows_tracing_logfile%22%3A%22C%3A%5C%5CBVTBin%5C%5CTests%5C%5Cinstallpackage%5C%5Ccsilogfile.log%22%2C%22WL_PORT%22%3A%227001%22%7D%2C%22appVersion%22%3A%221.12.6%22%2C%22atomHome%22%3A%22C%3A%5C%5CUsers%5C%5Cgcortes%5C%5C.atom%22%2C%22shellLoadTime%22%3A627%7D:1

SyntaxError: Unexpected token g in JSON at position 0
    at Object.parse (native)
    at file:///C:/Users/gcortes/.atom/packages/sync-settings/lib/sync-settings.coffee:178:24
    at global.sendError (C:\Users\gcortes\.atom\packages\sync-settings\node_modules\github4\index.js:729:13)
    at C:\Users\gcortes\.atom\packages\sync-settings\node_modules\github4\index.js:736:29
    at callCallback (C:\Users\gcortes\.atom\packages\sync-settings\node_modules\github4\index.js:613:17)
    at ClientRequest.<anonymous> (C:\Users\gcortes\.atom\packages\sync-settings\node_modules\github4\index.js:684:17)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at TLSSocket.socketErrorListener (_http_client.js:308:9)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at connectErrorNT (net.js:1016:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Commands

     -0:09.2.0 sync-settings:backup (atom-text-editor.editor.is-focused)
gaco commented 7 years ago

Hi, updating... I was able to solve the issue. In my case it was a proxy configuration in git.

I noticed that besides the related problem, I was also getting the following error when opening atom:

sync-settings: Error retrieving your settings. (getaddrinfo ENOTFOUND api.github.com api.github.com:443)

This error is related to proxy configuration. And I am behind a corporate proxy. After some search, I found the simplest solution for me. I simply created this environment variable (I am at windows): http_proxy=MY PROXY

@satoyoshiki , if you are behind a corporate proxy as well, that solution might help you too. To know what is your proxy, you can either ask someone in your company or follow this guide: http://superuser.com/questions/346372/how-do-i-know-what-proxy-server-im-using

dirk-thomas commented 7 years ago

This is likely a duplicate of #273.