Skip to content

Creating or cloning new repositories fails when behind a proxy #1998

Closed

Description

@ianmackenzie

Description

When behind my corporate proxy, GitHub Desktop works fine for pulling/pushing repositories that already exist both on GitHub and my local machine. However, if I create a new repository on my local machine I cannot publish it to GitHub, and if I create a new repository on GitHub I cannot clone it to my local machine.

In each case I get an error message related to api.github.com, so it looks like perhaps normal Git operations are properly respecting the http_proxy and https_proxy environment variables I have set but GitHub API calls are not. (If I connect the same machine to a different network such as my phone's hotspot and remove the http_proxy and https_proxy environment variables, everything works fine.)

Version

GitHub Desktop version: 0.6.1
OS version: Microsoft Windows [Version 10.0.14393]

Steps to Reproduce

  1. Create a new local repository using GitHub Desktop
  2. Attempt to publish to GitHub

Expected behaviour: Repository successfully published
Actual behaviour: ECONNREFUSED error message related to api.github.com

github desktop error message

Reproduces how often: 100%

Logs

2017-06-13T22:48:02.172Z - error: [ui] Unable to deserialize JSON string to object request to https://api.github.com/user/repos failed, reason: connect ECONNREFUSED 192.30.253.117:443
SyntaxError: Unexpected token r in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.<anonymous> (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\src\lib\http.ts:18:36)
    at Generator.next (<anonymous>)
    at C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\src\lib\http.ts:63:2
    at U (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\src\lib\http.ts:63:2)
    at Object.I.deserialize (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\src\lib\http.ts:12:65)
    at I.API.<anonymous> (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\src\lib\api.ts:324:6)
    at Generator.throw (<anonymous>)
    at Pe (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\src\lib\api.ts:654:2)
    at process._tickCallback (internal/process/next_tick.js:103:7)
2017-06-13T22:48:02.174Z - error: [ui] createRepository return an unknown error
L: request to https://api.github.com/user/repos failed, reason: connect ECONNREFUSED 192.30.253.117:443
    at ClientRequest.<anonymous> (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\~\node-fetch\index.js:133:1)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at TLSSocket.socketErrorListener (_http_client.js:309:9)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at emitErrorNT (net.js:1281:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
2017-06-13T22:48:22.398Z - error: [ui] fetchRepository: not found for 'ianmackenzie' and 'ianmackenzie/ianmackenzie.github.io'
L: request to https://api.github.com/repos/ianmackenzie/ianmackenzie.github.io failed, reason: connect ECONNREFUSED 192.30.253.116:443
    at ClientRequest.<anonymous> (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\~\node-fetch\index.js:133:1)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at TLSSocket.socketErrorListener (_http_client.js:309:9)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at emitErrorNT (net.js:1281:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
2017-06-13T22:48:28.892Z - error: [ui] Unable to deserialize JSON string to object request to https://api.github.com/user/repos failed, reason: connect ECONNREFUSED 192.30.253.116:443
SyntaxError: Unexpected token r in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.<anonymous> (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\src\lib\http.ts:18:36)
    at Generator.next (<anonymous>)
    at C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\src\lib\http.ts:63:2
    at U (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\src\lib\http.ts:63:2)
    at Object.I.deserialize (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\src\lib\http.ts:12:65)
    at I.API.<anonymous> (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\src\lib\api.ts:324:6)
    at Generator.throw (<anonymous>)
    at Pe (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\src\lib\api.ts:654:2)
    at process._tickCallback (internal/process/next_tick.js:103:7)
2017-06-13T22:48:28.893Z - error: [ui] createRepository return an unknown error
L: request to https://api.github.com/user/repos failed, reason: connect ECONNREFUSED 192.30.253.116:443
    at ClientRequest.<anonymous> (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\~\node-fetch\index.js:133:1)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at TLSSocket.socketErrorListener (_http_client.js:309:9)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at emitErrorNT (net.js:1281:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Activity

  1. shiftkey commented on Jun 14, 2017

    @shiftkey
    Member

    However, if I create a new repository on my local machine I cannot publish it to GitHub, and if I create a new repository on GitHub I cannot clone it to my local machine.

    These calls should be using the system proxy settings of Windows, which are separate to the http_proxy and https_proxy environment variables that Git looks for.

    2017-06-13T22:48:22.398Z - error: [ui] fetchRepository: not found for 'ianmackenzie' and 'ianmackenzie/ianmackenzie.github.io'
    L: request to https://api.github.com/repos/ianmackenzie/ianmackenzie.github.io failed, reason: connect ECONNREFUSED 192.30.253.116:443
        at ClientRequest.<anonymous> (C:\Users\ian.mackenzie\AppData\Local\GitHubDesktop\app-0.6.1\webpack:\app\~\node-fetch\index.js:133:1)
        at emitOne (events.js:96:13)
        at ClientRequest.emit (events.js:188:7)
        at TLSSocket.socketErrorListener (_http_client.js:309:9)
        at emitOne (events.js:96:13)
        at TLSSocket.emit (events.js:188:7)
        at emitErrorNT (net.js:1281:8)
        at _combinedTickCallback (internal/process/next_tick.js:74:11)
        at process._tickCallback (internal/process/next_tick.js:98:9)
    

    This stack trace here suggests we're using node-fetch in octokat, rather than the native window.fetch API that's available in the renderer for Electron.

  2. added
    bug
    investigation-needed
    on Jun 14, 2017
  3. self-assigned this
    on Jun 14, 2017
  4. removed their assignment
    on Jun 29, 2017
  5. joshaber commented on Jun 29, 2017

    @joshaber
    Contributor

    We made some pretty big changes to how API requests are done in 0.6.2, such that it should pick up your system level network settings.

    I'm gonna roll this into #2054. Feel free to follow along over there.

  6. ianmackenzie commented on Jun 29, 2017

    @ianmackenzie
    Author

    Just tried pushing and pulling some new repositories using 0.6.2 and everything seems to work now - thanks!

  7. locked as resolved and limited conversation to collaborators on Jul 21, 2018
  8. 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

No one assigned

    Labels

    buginvestigation-needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions