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.

Cannot Publish to Private GitHub - 404 Not Found - Method undefined url

See original GitHub issue
  • Version: 20.38.5
  • Target: Windows ia32 and x64
I'm trying to push the project to GitHub releases in a private repository.

The main target is Win ia32 and x64.

I setted the token in the console by

set GH_TOKEN=<blabla>

And at the package.json file:

"publish": {
      "provider": "github",
      "repo": "electron-todo-tasks",
      "owner": "AndreD23",
      "host": "github.com",
      "protocol": "https",
      "releaseType": "draft",
      "token": "<blablabla>",
      "private": true
    }

I’m the only one who will have access to the project, so updating the token in the file apparently not a problem.

But, when I run:

electron-builder --x64 --ia32 --publish always

It shows me the error:

Error: Cannot cleanup:

Error #1 --------------------------------------------------------------------------------
HttpError: 404 Not Found
"method: undefined url: https://github.com/repos/AndreD23/electron-todo-tasks/releases\n\nPlease double check that your authentication token is correct. Due to security reasons actual status maybe not reported, but 404.\n"

I’ll attach the hole error.

2019-03-22T13_04_27_992Z-debug.log

electron publish error.txt

I tried to change the option always to onTag or onTagOrDraft and change releaseType to release.

I tried to manually create a draft on GitHub first, not works.

I tried to make the repository public for tests, not work too.

I tried to regenerate the token two times and updated at the envs, console and package.json, not works.

There are some configuration that I’ve missed? What I have to do for the electron publish to GitHub?

At the error, it says that cannot find https://github.com/repos/AndreD23/electron-todo-tasks/releases. Openning it on web browser, it returns 404. I found strange the link, because it adds the word “repos” after github.com, and removing it in the browser it loads fine. This word is setting automatically?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

5reactions
edelCustodiocommented, Apr 26, 2019

Hi @AndreD23

This works for me, on PowerShell type this [Environment]::SetEnvironmentVariable("GH_TOKEN","my-personal-token","User") and be sure that you package.json will be like this:

"build": {
    "appId": "com.friasoftit.electron-auto-update",
    "productName": "Electron Auto Update",
    "publish": [
      {
        "provider": "github",
        "owner": "edelCustodio",
        "repo": "electron-auto-update"
      }
    ],
    "win": {
      "publish": [
        "github"
      ],
      "target": [
        {
          "target": "nsis",
          "arch": [
            "x64",
            "ia32"
          ]
        }
      ]
    }
  },

And then I run this command yarn run publish and this is how is my publish is on my package.json "publish": "build --win -p always" don’t forget to close and open a new PowerShell terminal

3reactions
yannxavercommented, Aug 9, 2020

I’ve had the same issue as well and the problem is indeed that the automatically generated URL contains /repos/ which breaks the link. Not specifying host as github.com and protocol as https solved the problem.

@maintainers: Is that the intended behavior?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting 404 when attempting to publish new package to NPM
You need to have registered "supericium" ( npm adduser ) as a username at the registry and be logged in ( npm login...
Read more >
octokit/rest.js
If the repository is private you must use an access token with the repo scope. ... This endpoint returns a 404 Not Found...
Read more >
Common errors | npm Docs
It's most likely a temporary npm registry glitch. Check npm server status and try again later. If the error persists, perhaps the published...
Read more >
Troubleshooting - Unity - Manual
Error refreshing assets (or Error refreshing packages). If your network can't reach the package registry server, it's probably because there is a connection ......
Read more >
YouTube Data API - Errors | Google Developers
The request is not properly authorized. notFound (404), channelNotFound, The channel ID identified by the request's channelId parameter cannot ...
Read more >

github_iconTop Related Medium Post

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