question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Downloading update from private GitHub repository — mac support

See original GitHub issue

electron-updater

  • Version: 1.9.0
  • Target: dmg

I’ve been debugging Update download failed. The server sent an invalid response. Try again later. after electron-updater attempts to download from a private GitHub repo. I wanted to confirm the authentication token wasn’t the problem, so I replicated the request in Postman. Here’s the GET request I’m using:

Url: "https://api.github.com/repos/__OWNER__/__REPO__/releases/assets/__ASSET_ID__"
Headers: {
  Accept: "application/octet-stream"
  Authorization: __TOKEN__
}

This request fails, because Github requires query-token authentication over header authentication for octet stream requests. See the error returned:

<?xml version="1.0" encoding="UTF-8"?>
<Error>
    <Code>InvalidArgument</Code>
    <Message>Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified</Message>
    <ArgumentName>Authorization</ArgumentName>
    <ArgumentValue>token __TOKEN__</ArgumentValue>
    <RequestId>88A9E737F583B6C9</RequestId>
    <HostId>TqzUjnu1qvKvN8WfyGNt7d0sNXkhF58kH3KsKZu1WCqZALaP4UADqQXl42v6+8NLbkDVueuYLhI=</HostId>
</Error>

Anyways, the solution to my postman error was changing the authentication to a query string:

Url: "https://api.github.com/repos/__OWNER__/__REPO__/releases/assets/__ASSET_ID__?access_token=__TOKEN__"
Headers: {
  Accept: "application/octet-stream"
}

The file from the private GitHub repo is then successfully downloaded.

Since this request in Postman worked, I manually made the change in the npm module to see if it fixed the Update download failed. The server sent an invalid response. Try again later. error. However, the same error message is still returned, and the download fails. I’m stuck for now and need some input on how to proceed. 🤔

Thank you 👍

(btw: I am using placeholder __VARS__ throughout my example code. Their actual values do appear in the error messages)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:48 (28 by maintainers)

github_iconTop GitHub Comments

3reactions
ghostcommented, Dec 19, 2017

@amok it is a bug, After looking at recent changes, about 13 days ago they moved the auth headers removal from PrivateGithubProvider to electronHttpExecuter, or at least it seems like that.

@KrzysZG37 I will be more than happy to help, I think you should open a new issue

2reactions
vinogradov-mcommented, Mar 16, 2017

@develar I’m sorry, maybe I misunderstood you. I just meant that electron-updater uses ElectronHttpExecutor (which extends HttpExecutor) where method doApiRequest() is overridden, and net module of electron is used to download update packages from github via api requests: https://github.com/electron-userland/electron-builder/blob/master/packages/electron-updater/src/electronHttpExecutor.ts#L40

Anyway, I’m investigating this issue and will do PR if I find an acceptable solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cloning a repository - GitHub Docs
Above the list of files, click Code. Click Open with GitHub Desktop to clone and open the repository with GitHub Desktop.
Read more >
git - Clone A Private Repository (Github) - Stack Overflow
August 13, 2021 update · Go to your Git account · Go to Settings-> Developer Settings->Personal Access Token · Click on Generate new...
Read more >
Setting up a Git Repository - Visual Studio for Mac
Creating a remote repo on GitHub · Create a new Git repo at github.com: Create new git repo · Set Repo Name, description,...
Read more >
git clone - Downloading an existing repository from a remote ...
The "clone" command downloads an existing Git repository to your local computer. You will then have a full-blown, local version of that Git...
Read more >
How to Use a Private Go Module in Your Own Project
An empty private GitHub repository named mysecret for your ... you configured Git to use SSH to download Go modules by updating your ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found