Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub release failed when trying to publish (404 "Not Found") #14

Closed
gotofritz opened this issue Dec 15, 2016 · 19 comments

Comments

@gotofritz
Copy link
Contributor

@gotofritz gotofritz commented Dec 15, 2016

Hi. On OS X, node v6.9.1, npm 3.10.8

When I try to publish with npm run release (where release is simply npmpub) it gets to the end and then I get this error

馃摝  Publishing...
+ xxx@0.1.3
Everything up-to-date

xxx/node_modules/github-release-from-changelog/github-release-from-changelog.js:112
    throw err
    ^
Error: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
馃摝  GitHub release failed.
@MoOx

This comment has been minimized.

Copy link
Owner

@MoOx MoOx commented Dec 16, 2016

This can happen if github is "to slow" to detect the tag npmpub just pushed.
Can you try the following command in your terminal ?

./node_modules/github-release-from-changelog/github-release-from-changelog.js

Should works.

@gotofritz

This comment has been minimized.

Copy link
Contributor Author

@gotofritz gotofritz commented Dec 16, 2016

I get exactly the same error.

@MoOx

This comment has been minimized.

Copy link
Owner

@MoOx MoOx commented Dec 16, 2016

Does the tag of your release exists on github?

@gotofritz

This comment has been minimized.

Copy link
Contributor Author

@gotofritz gotofritz commented Dec 16, 2016

No, it doesn't

@MoOx

This comment has been minimized.

Copy link
Owner

@MoOx MoOx commented Dec 16, 2016

it should.

Can you try git push --follow-tags and see if that's pushing the git tag? You may have a global git config option that interfer somehow... Not sure what is causing this issue.

@gotofritz

This comment has been minimized.

Copy link
Contributor Author

@gotofritz gotofritz commented Dec 16, 2016

There is no error message or log saying that didn't work. The output on the CLI is

馃摝  Preparing v0.1.4.
馃摝  Running 'npm install'. This can take a while.
馃摝  Running tests...
(a bunch of tests)
馃摝  Publishing...
+ stylelint-config-pv@0.1.5
Everything up-to-date

./node_modules/github-release-from-changelog/github-release-from-changelog.js:112
    throw err
    ^
Error: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
馃摝  GitHub release failed.

If I then just run the commend you suggested

> ./node_modules/github-release-from-changelog/github-release-from-changelog.js

./node_modules/github-release-from-changelog/github-release-from-changelog.js:112
    throw err
    ^
Error: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}

Tag exists locally but not on github

@gotofritz

This comment has been minimized.

Copy link
Contributor Author

@gotofritz gotofritz commented Dec 16, 2016

Ah sorry, just saw your reply. No, tags do not get pushed... strange. I will investigate, thanks.

@gotofritz

This comment has been minimized.

Copy link
Contributor Author

@gotofritz gotofritz commented Dec 16, 2016

git push --tags works. git push --follow-tags doesn't. I see from the documentation that

The new option "--follow-tags" tells "git push" to push annotated tags that are missing from the other side and that can be reached by the history that is otherwise pushed out.

It seems that the tag created by npmpub is not annotated

@MoOx

This comment has been minimized.

Copy link
Owner

@MoOx MoOx commented Dec 16, 2016

Yeah, see #11
Not sure why it's working for so many people for such a long time haha.
What is your version of git?

@gotofritz

This comment has been minimized.

Copy link
Contributor Author

@gotofritz gotofritz commented Dec 16, 2016

2.9, just updated to 2.11

I have tried changing line 173 to const gitTag = exec("git tag -a " + version + " -m \"Tag " + version + " created with npmpub\""); - now the tag does get pushed, but I still get the same error....

@MoOx

This comment has been minimized.

Copy link
Owner

@MoOx MoOx commented Dec 16, 2016

github-release-from-changelog should just convert a tag to a github release by pushing your CHANGELOG notes. If the tag is visible on github, it should just work.

@gotofritz

This comment has been minimized.

Copy link
Contributor Author

@gotofritz gotofritz commented Dec 16, 2016

Well github is not happy about something. So there are two issues - one is that npmpub doesn't create annotated tag (I am happy to submit a PR to fix that). The other is that in my case github-release-from-changelog doesn't work for me. Do you want me to open an issue there?

@gotofritz

This comment has been minimized.

Copy link
Contributor Author

@gotofritz gotofritz commented Dec 16, 2016

FYI, this is what I get when I set the github API wrapper to debug

REQUEST:  { host: 'api.github.com',
  port: 443,
  path: '/repos/pro-vision/style-config-pv/releases?access_token=xxxx',
  method: 'post',
  headers: 
   { host: 'api.github.com',
     'content-length': 76,
     'content-type': 'application/json; charset=utf-8',
     'user-agent': 'NodeJS HTTP Client',
     accept: 'application/vnd.github.v3+json' },
  ca: undefined }
REQUEST BODY: {"tag_name":"0.1.7","name":"0.1.7","body":"\n-   Fixed publishing issues\n"}

STATUS: 404
HEADERS: {"server":"GitHub.com","date":"Fri, 16 Dec 2016 08:52:05 GMT","content-type":"application/json; charset=utf-8","content-length":"77","connection":"close","status":"404 Not Found","x-ratelimit-limit":"5000","x-ratelimit-remaining":"4997","x-ratelimit-reset":"1481881150","x-oauth-scopes":"public_repo","x-accepted-oauth-scopes":"repo","x-github-media-type":"github.v3; format=json","access-control-expose-headers":"ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval","access-control-allow-origin":"*","content-security-policy":"default-src 'none'","strict-transport-security":"max-age=31536000; includeSubdomains; preload","x-content-type-options":"nosniff","x-frame-options":"deny","x-xss-protection":"1; mode=block","x-github-request-id":"xxx"}
[error] { [Error: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}]
[error]   message: '{"message":"Not Found","documentation_url":"https://developer.github.com/v3"}',
[error]   code: 404,
[error]   status: 'Not Found',
[error]   headers: 
[error]    { server: 'GitHub.com',
[error]      date: 'Fri, 16 Dec 2016 08:52:05 GMT',
[error]      'content-type': 'application/json; charset=utf-8',
[error]      'content-length': '77',
[error]      connection: 'close',
[error]      status: '404 Not Found',
[error]      'x-ratelimit-limit': '5000',
[error]      'x-ratelimit-remaining': '4997',
[error]      'x-ratelimit-reset': '1481881150',
[error]      'x-oauth-scopes': 'public_repo',
[error]      'x-accepted-oauth-scopes': 'repo',
[error]      'x-github-media-type': 'github.v3; format=json',
[error]      'access-control-expose-headers': 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval',
[error]      'access-control-allow-origin': '*',
[error]      'content-security-policy': 'default-src \'none\'',
[error]      'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
[error]      'x-content-type-options': 'nosniff',
[error]      'x-frame-options': 'deny',
[error]      'x-xss-protection': '1; mode=block',
[error]      'x-github-request-id': 'xxx' } } { owner: 'pro-vision',
[error]   repo: 'style-config-pv',
[error]   tag_name: '0.1.7',
[error]   target_commitish: undefined,
[error]   name: '0.1.7',
[error]   body: '\n-   Fixed publishing issues\n',
[error]   prerelease: undefined } null

@MoOx

This comment has been minimized.

Copy link
Owner

@MoOx MoOx commented Dec 16, 2016

Did you defined the GITHUB_TOKEN as mentionned in the doc?

@gotofritz

This comment has been minimized.

Copy link
Contributor Author

@gotofritz gotofritz commented Dec 16, 2016

Yes, if I do echo $GITHUB_TOKEN it's visible

@gotofritz

This comment has been minimized.

Copy link
Contributor Author

@gotofritz gotofritz commented Dec 16, 2016

  • I went https://github.com/settings/tokens created clicked on "personal access tokens"
  • clicked on Generate new token
  • Ticked on ALL permissions
  • in my machine, i put it into a ~/.github_token file
  • in my .bash_profile I added export GITHUB_TOKEN=$(cat $HOME/.github_token)
  • reloaded bash with . ~/.bash_profile
  • run echo $GITHUB_TOKEN to test - got a token.

Am I missing something / doing something wrong?

@MoOx

This comment has been minimized.

Copy link
Owner

@MoOx MoOx commented Dec 16, 2016

Not sure what wrong here. You are getting a 404 from github like if you have no right or if the resource not exist.

I just used it a few hours ago without any issue.

Can you share:

  • your package npm name (from your package.json/name)
  • your repo url
@MoOx

This comment has been minimized.

Copy link
Owner

@MoOx MoOx commented Dec 16, 2016

If I go here for example https://api.github.com/repos/MoOx/npmpub/releases I have the releases listed.

You are getting a 404 on https://api.github.com/repos/pro-vision/style-config-pv/releases so you need to check this is accessible. After that should work out of the box.

@MoOx MoOx changed the title "Not Found" when trying to publish GitHub release failed when trying to publish (404 "Not Found") Dec 16, 2016
@gotofritz

This comment has been minimized.

Copy link
Contributor Author

@gotofritz gotofritz commented Dec 16, 2016

You are right. I created a another local repo and it worked.
Thanks for your help.

@gotofritz gotofritz closed this Dec 16, 2016
This was referenced Dec 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.