Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Error on getPackageConfig with jsmp v0.13.26 #137

Open
omkarvijf41 opened this issue May 7, 2021 · 13 comments
Open

Error on getPackageConfig with jsmp v0.13.26 #137

omkarvijf41 opened this issue May 7, 2021 · 13 comments

Comments

@omkarvijf41
Copy link

Unauthorized response for GitHub API.

 Use jspm registry config github to reconfigure the credentials, or update them in your ~/.netrc file.
 
 I am getting above error while doing builds. Could you please help us resolving this issue. 
 Thank you in advance. 
@omkarvijf41
Copy link
Author

omkarvijf41 commented May 7, 2021

@guybedford/ Someone could you please help resolving this issue. Multiple apps builds are failings and it's blocking our scheduled releases. Hope you understand the urgency resolving this issue. Thank you.
image

@sudhakar-reddyk
Copy link

sudhakar-reddyk commented May 17, 2021

I got the same issue, thought to change my git token, But it's also failing like below

Enter your GitHub password or access token:
err (jspm) Error: Bad GitHub API response code 404: Not Found
    at getAPIToken (/Users/rshn/.nvm/versions/node/v16.1.0/lib/node_modules/jspm/node_modules/@jspm/github/github.js:172:17)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async GithubEndpoint.configure (/Users/rshn/.nvm/versions/node/v16.1.0/lib/node_modules/jspm/node_modules/@jspm/github/github.js:73:5)
    at async RegistryManager.configure (/Users/sudha/.nvm/versions/node/v16.1.0/lib/node_modules/jspm/lib/install/registry-manager.js:134:9)
    at async cliHandler (/Users/rshn/.nvm/versions/node/v16.1.0/lib/node_modules/jspm/lib/cli.js:628:17)

@rasialaAF
Copy link

Having exactly the same issue since last week while using jspm 0.16.x is there a known solution / workaround ?

@guybedford
Copy link
Member

Please do confirm you're running the latest jspm-github 0.13.26.

//cc @yafanasiev who worked on the support of the new token format here in #135. I'm not sure if this is a problem caused by that PR, or simply a result of the token format change with GitHub.

@sudhakar-reddyk
Copy link

I'm using
"jspm": "^0.16.53",
"jspm-github": "0.13.26",

@rasialaAF
Copy link

Using:

  • jspm 0.16.0
  • jspm-github: 0.13.26

Tried old and new token format without any luck

@yafanasiev
Copy link

Works for me on

    "node_modules/jspm": {      
      "version": "0.16.55" 
      ...  
    "node_modules/jspm-github": {      
      "version": "0.13.26" 
      ...  

with new token format. Can you share more details or a minimal reproducible setup? Also, can you check if your install will error on public-only repositories? Token will still be used in requests, but that would eliminate issues with specific private dependencies.

@sudhakar-reddyk
Copy link

sudhakar-reddyk commented May 19, 2021

used this command jspm registry config github which prompted me for github username and token
after validating connection it stored an auth value in ~/.jspm/config like below in local machine

{
  "defaultRegistry": "npm",
  "registries": {
    "github": {
      "handler": "jspm-github",
      "remote": "https://github.jspm.io",
      "auth": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    },
    "npm": {
      "handler": "jspm-npm",
      "remote": "https://npm.jspm.io"
    },`
    "jspm": {
      "handler": "jspm-registry",
      "remote": "https://registry.jspm.io"
    }
  },
  "defaultTranspiler": "babel",
  "strictSSL": true
}

then we're using this xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx in our package.json jspm config registries.github.auth xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx for jenkins to pickup this credential
and we're using

  • jspm:^0.16.53
  • jspm-github: 0.13.26

@rasialaAF
Copy link

rasialaAF commented May 19, 2021

Hello @yafanasiev,
We previously only accessed public repositories, I switched them to npm or removed them in order to go forward on debugging.
Still have the errors for required dependencies of jspm (among others):

warn Error on download for github:jspm/nodelibs-process
Unauthorized response for GitHub API.
Use jspm registry config github to reconfigure the credentials, or update them in your ~/.netrc file.

warn Error on download for github:systemjs/plugin-css
Unauthorized response for GitHub API.
Use jspm registry config github to reconfigure the credentials, or update them in your ~/.netrc file.

I tried running the build using jspm 0.16.55 using node 6.15.1, and tried the jspm registry config github which outputed that the connection to github is OK.

Don't know if this is important but the jspm install is called in the postinstall npm lifecycle like below:
"postinstall": "... registry config ... && jspm config registries.github.auth base64encoding(username:githubtoken) && jspm install"
EDIT: When I remove the token configuration in the postinstall, I will of course reach the github limit, when I enter my credentials when prompted the installation goes through with no errors...

@yafanasiev
Copy link

@sudhakar-reddyk @rasialaAF unfortunately I can't reproduce the issue even on simple setup. I've got a correct request built in

getPackageConfig: function(repo, version, hash, meta) {
, and it returns 200 as expected, so I doubt that there is an issue in Github API. I would recommend manually downgrading jspm-github to see if any of recent changes brought this issue, or creating a minimal reproducible repo to check this further.

@sudhakar-reddyk
Copy link

sudhakar-reddyk commented May 21, 2021

@yafanasiev what is your setup? what's your git token format, and how are you providing it to jspm-github?

@yafanasiev
Copy link

We use new format token with repo permissions, and we set configuration before each build as such:

jspm config registries.github.auth <token>

@jfstephe
Copy link

I went around this several times and I think it probably is ok.

In case this helps I think I had an old format (and expired) token in an env variable, and despite all the jspm config commands I suspect it was still being used. I updated the env var and my problems seem(!) to have gone away.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants