Skip to content

Unexpected token � in JSON at position 0. #3399

Closed

Description

@LSmyrnaios

Description

Hi,
Today I updated manually GitHub Desktop on Windows, from version 1.0.8 to 1.0.9.
After relaunching, I got the following error:

Unexpected token � in JSON at position 0.

It happens every time I launch GitHub Desktop.
Here is a screenshot: http://prntscr.com/hdetun
Note that it hasn't happened before.
Thanks.

Version

GitHub Desktop version: [1.0.9]
OS version: [Windows 10 Home version:1709]

Steps to Reproduce

  1. Update manually by going to: Help->About GitHub Desktop -> Check for updates.
  2. Install update and wait for relaunch (the program relaunches by itself).

Expected behavior: No error.
Actual behavior: Error at program's launch

Reproduces how often: [100%]

Logs

2017-11-21T17:45:25.594Z - info: [ui] [AppStore] loading 1 repositories from store
2017-11-21T17:45:25.597Z - info: [ui] [AppStore] found account: LSmyrnaios (Lampros A. Smyrnaios)
2017-11-21T17:45:27.478Z - warn: [ui] Unable to deserialize JSON string to object [object Response]
SyntaxError: Unexpected token � in JSON at position 0
2017-11-21T17:45:27.479Z - warn: [ui] fetchPullRequests: failed for repository wheatvivo/datasources
SyntaxError: Unexpected token � in JSON at position 0
2017-11-21T17:45:27.480Z - warn: [ui] Error refreshing pull requests for 'datasources'
SyntaxError: Unexpected token � in JSON at position 0
2017-11-21T17:45:27.493Z - warn: [ui] Unable to deserialize JSON string to object [object Response]
TypeError: Failed to fetch
2017-11-21T17:45:27.495Z - warn: [ui] fetchMentionables: failed for wheatvivo/datasources
TypeError: Failed to fetch
2017-11-21T17:45:27.894Z - info: [ui] launching: 1.0.9 (Windows 10.0.16299)

Activity

  1. shiftkey commented on Nov 22, 2017

    @shiftkey
    Member

    @LSmyrnaios I'd love to see what the response body is for these requests - maybe something is intercepting the request and serving up different, non-JSON content?

    Here's what I'd like to try:

    • launch the app, then click View | Toggle Developer Tools
    • switch to the Network tab
    • trigger the issue (by switching repository or whatever)
    • select a problem request and inspect the Headers and Response

    If you find something interesting, could you attach that here?

  2. added
    investigation-needed
    on Nov 22, 2017
  3. LSmyrnaios commented on Nov 22, 2017

    @LSmyrnaios
    Author

    Here is what's written in the console window when I try to switch from adminapp repository to datasources:
    http://prntscr.com/hdsxi6

  4. shiftkey commented on Nov 22, 2017

    @shiftkey
    Member

    @LSmyrnaios the details from your first reply are what I was looking for, but instead of looking at images are you able to see the response for users or datasources when you switch to it?

  5. LSmyrnaios commented on Nov 23, 2017

    @LSmyrnaios
    Author

    These are the screenshots for "users":
    Headers1: http://prntscr.com/he6rbn
    Headers2: http://prntscr.com/he6t4k
    Response: http://prntscr.com/he6scf

    These are for "datasources":
    Headers1: http://prntscr.com/he6so0
    Headers2: http://prntscr.com/he6szl
    Response:

    {
      "id": 71882701,
      "name": "datasources",
      "full_name": "WheatVIVO/datasources",
      "owner": {
        "login": "WheatVIVO",
        "id": 22769200,
        "avatar_url": "https://avatars3.githubusercontent.com/u/22769200?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/WheatVIVO",
        "html_url": "https://github.com/WheatVIVO",
        "followers_url": "https://api.github.com/users/WheatVIVO/followers",
        "following_url": "https://api.github.com/users/WheatVIVO/following{/other_user}",
        "gists_url": "https://api.github.com/users/WheatVIVO/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/WheatVIVO/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/WheatVIVO/subscriptions",
        "organizations_url": "https://api.github.com/users/WheatVIVO/orgs",
        "repos_url": "https://api.github.com/users/WheatVIVO/repos",
        "events_url": "https://api.github.com/users/WheatVIVO/events{/privacy}",
        "received_events_url": "https://api.github.com/users/WheatVIVO/received_events",
        "type": "Organization",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/WheatVIVO/datasources",
      "description": null,
      "fork": false,
      "url": "https://api.github.com/repos/WheatVIVO/datasources",
      "forks_url": "https://api.github.com/repos/WheatVIVO/datasources/forks",
      "keys_url": "https://api.github.com/repos/WheatVIVO/datasources/keys{/key_id}",
      "collaborators_url": "https://api.github.com/repos/WheatVIVO/datasources/collaborators{/collaborator}",
      "teams_url": "https://api.github.com/repos/WheatVIVO/datasources/teams",
      "hooks_url": "https://api.github.com/repos/WheatVIVO/datasources/hooks",
      "issue_events_url": "https://api.github.com/repos/WheatVIVO/datasources/issues/events{/number}",
      "events_url": "https://api.github.com/repos/WheatVIVO/datasources/events",
      "assignees_url": "https://api.github.com/repos/WheatVIVO/datasources/assignees{/user}",
      "branches_url": "https://api.github.com/repos/WheatVIVO/datasources/branches{/branch}",
      "tags_url": "https://api.github.com/repos/WheatVIVO/datasources/tags",
      "blobs_url": "https://api.github.com/repos/WheatVIVO/datasources/git/blobs{/sha}",
      "git_tags_url": "https://api.github.com/repos/WheatVIVO/datasources/git/tags{/sha}",
      "git_refs_url": "https://api.github.com/repos/WheatVIVO/datasources/git/refs{/sha}",
      "trees_url": "https://api.github.com/repos/WheatVIVO/datasources/git/trees{/sha}",
      "statuses_url": "https://api.github.com/repos/WheatVIVO/datasources/statuses/{sha}",
      "languages_url": "https://api.github.com/repos/WheatVIVO/datasources/languages",
      "stargazers_url": "https://api.github.com/repos/WheatVIVO/datasources/stargazers",
      "contributors_url": "https://api.github.com/repos/WheatVIVO/datasources/contributors",
      "subscribers_url": "https://api.github.com/repos/WheatVIVO/datasources/subscribers",
      "subscription_url": "https://api.github.com/repos/WheatVIVO/datasources/subscription",
      "commits_url": "https://api.github.com/repos/WheatVIVO/datasources/commits{/sha}",
      "git_commits_url": "https://api.github.com/repos/WheatVIVO/datasources/git/commits{/sha}",
      "comments_url": "https://api.github.com/repos/WheatVIVO/datasources/comments{/number}",
      "issue_comment_url": "https://api.github.com/repos/WheatVIVO/datasources/issues/comments{/number}",
      "contents_url": "https://api.github.com/repos/WheatVIVO/datasources/contents/{+path}",
      "compare_url": "https://api.github.com/repos/WheatVIVO/datasources/compare/{base}...{head}",
      "merges_url": "https://api.github.com/repos/WheatVIVO/datasources/merges",
      "archive_url": "https://api.github.com/repos/WheatVIVO/datasources/{archive_format}{/ref}",
      "downloads_url": "https://api.github.com/repos/WheatVIVO/datasources/downloads",
      "issues_url": "https://api.github.com/repos/WheatVIVO/datasources/issues{/number}",
      "pulls_url": "https://api.github.com/repos/WheatVIVO/datasources/pulls{/number}",
      "milestones_url": "https://api.github.com/repos/WheatVIVO/datasources/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/WheatVIVO/datasources/notifications{?since,all,participating}",
      "labels_url": "https://api.github.com/repos/WheatVIVO/datasources/labels{/name}",
      "releases_url": "https://api.github.com/repos/WheatVIVO/datasources/releases{/id}",
      "deployments_url": "https://api.github.com/repos/WheatVIVO/datasources/deployments",
      "created_at": "2016-10-25T09:46:49Z",
      "updated_at": "2017-11-22T14:42:54Z",
      "pushed_at": "2017-11-05T10:48:29Z",
      "git_url": "git://github.com/WheatVIVO/datasources.git",
      "ssh_url": "[email protected]:WheatVIVO/datasources.git",
      "clone_url": "https://github.com/WheatVIVO/datasources.git",
      "svn_url": "https://github.com/WheatVIVO/datasources",
      "homepage": null,
      "size": 542,
      "stargazers_count": 1,
      "watchers_count": 1,
      "language": "Java",
      "has_issues": true,
      "has_projects": true,
      "has_downloads": true,
      "has_wiki": true,
      "has_pages": false,
      "forks_count": 0,
      "mirror_url": null,
      "archived": false,
      "open_issues_count": 3,
      "forks": 0,
      "open_issues": 3,
      "watchers": 1,
      "default_branch": "master",
      "permissions": {
        "admin": true,
        "push": true,
        "pull": true
      },
      "allow_squash_merge": true,
      "allow_merge_commit": true,
      "allow_rebase_merge": true,
      "organization": {
        "login": "WheatVIVO",
        "id": 22769200,
        "avatar_url": "https://avatars3.githubusercontent.com/u/22769200?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/WheatVIVO",
        "html_url": "https://github.com/WheatVIVO",
        "followers_url": "https://api.github.com/users/WheatVIVO/followers",
        "following_url": "https://api.github.com/users/WheatVIVO/following{/other_user}",
        "gists_url": "https://api.github.com/users/WheatVIVO/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/WheatVIVO/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/WheatVIVO/subscriptions",
        "organizations_url": "https://api.github.com/users/WheatVIVO/orgs",
        "repos_url": "https://api.github.com/users/WheatVIVO/repos",
        "events_url": "https://api.github.com/users/WheatVIVO/events{/privacy}",
        "received_events_url": "https://api.github.com/users/WheatVIVO/received_events",
        "type": "Organization",
        "site_admin": false
      },
      "network_count": 0,
      "subscribers_count": 1
    }
    
    
  6. shiftkey commented on Nov 23, 2017

    @shiftkey
    Member

    @LSmyrnaios that's interesting - so it's working now? Are you able to reproduce the error at all?

  7. added
    more-info-needed
    and removed
    investigation-needed
    on Nov 24, 2017
  8. LSmyrnaios commented on Nov 24, 2017

    @LSmyrnaios
    Author

    @shiftkey Nope, it keeps doing the same thing when I am starting the program with "datasources" repository or trying to switch to it from "adminapp" repository.

    Here is a screenshot from the Network tab, showing the indication "failed" for "users".
    http://prntscr.com/hepn2d
    The "Headers" and "Response" are the same as the ones appearing on the previous screenshots that I sent you.

  9. shiftkey commented on Nov 26, 2017

    @shiftkey
    Member

    I'm still kind of puzzled, because this screenshot does show the error, rather than a 304:

    screen shot 2017-11-27 at 8 24 46 am

    But the response header in here suggests it's a 304 like the earlier requests:

    Stepping back: a 304 Not Modified isn't supposed to return any content in the response body, but then it's trying to deserialize something that's supposed to be locally cached by the browser (and failing). Maybe we just need to be less trusting of the locally cached content when deserializing?

  10. self-assigned this
    on Nov 26, 2017
  11. locked as resolved and limited conversation to collaborators on Jul 19, 2018
  12. unlocked this conversation on Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

more-info-needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions