Publishing packages doesn't prompt for Github credentials, fails


#1

Hi there,

Reading the discourse here about folks who have encountered similar problems publishing packages, but they do not seem to address the situation I’m facing.

Long story short, I’m not able to publish packages and I get the following error:
That repo does not exist, isn't an atom package, or you do not have access

I checked my package.json – the relevant data pointing correctly to my github repository, which has already been pushed and is clean.

I suspect it’s due to the change in my Github login credentials. Ever since I changed my password / Github access tokens, apm publish minor no longer prompts me for my new github login/password, instead outputting the error above.

How do I get apm to prompt me for my github credentials again? I’ve already deleted all of my osx keychain credentials for github.


#2

Already tried apm login?


#3

Edit: Doh. Try @frabert’s suggestion, that sounds so much simpler. :slight_smile:

What protocol are you using? I don’t know how the OS X Keychain works, but I use Windows and if I publish over https I need to enter my credentials every time, so for my own repositories I use ssh. I realize that does not answer your question directly, since if this method works it will not ask you for your credentials, but instead authenticate you automatically. The credentials for ssh are stored in ~/.ssh, perhaps you can try the following:

  • Generate a private/public keypair (if you don’t have one already) and save it as ~/.ssh/github_rsa and ~/.ssh/github_rsa.pub, respectively.
  • Add the public key to your GitHub account.
  • Create (or append to, if it already exists) ~/.ssh/config with an entry like this:
User            github_username
Host            github.com
HostName        github.com
IdentityFile    ~/.ssh/github_rsa

To make sure git uses ssh, cd into your repository’s directory and enter:
git remote set-url origin git@github.com:github_username/repository_name.git

That should at least let you publish again. If you find out what prevents you from being prompted and want to switch back to https:
git remote set-url origin https://github.com/github_username/repository_name.git


#4

@Alchiadus, @frabert, unfortunately I did try apm login as the first course of action while going through all the similar posts made in this forum. It simply presented me with the atom api key prompt, but does not prompt me further to provide credentials for my github account.

Thanks for the info on the differences between ssh/https-based publishing; I’ll try the bit about regenerating my ssh keypairs and see how that goes.


#5

Taking a stab at this again, but still no go.

It’s the same – apm login prompted me for my atom.io access token, which my atom.io account happily regenerated for me – no errors when I save this to my keychain.

However, attempting apm publish minor on my repo still gives me:

Registering package in chuank/particle-offline-compiler repository failed: That repo does not exist, isn’t an atom package, or you do not have access

I know this has to do with my Github 2FA, but apm for some reason never asks me for my github credentials/access token anymore.

@Alchiadus, attempting this via ssh didn’t work; still getting the same error.

What should I do to completely wipe out apm and start over?


#6

At some point did you delete the GitHub repository that you originally published the package from and recreate it?


#7

That happened to another package (particle-offline-compile) that I first tried to publish. It is now orphaned on https://atom.io/packages/particle-offline-compile (and removing that is my next goal after I fix this issue I’m having with apm on new repos).

I’ve since attempted to create a new package (particle-offline-compiler). It’s this repo (https://github.com/chuank/particle-offline-compiler) that I’m having trouble with.

I’ve completely reinstalled atom (including removal of all preferences), but still get the same error. It just seems like the authentication done in apm is somehow not validating.


#8

Thinking it might be related, I went back to my first orphaned-but-published package (particle-offline-compile), and created an empty repo scaffold using apm init.

Attempting to do apm publish minor did prompt me for my Github credentials, which I provided my newly-created Github access token for. This is what I got:

A further attempt to apm unpublish results in:

So after this, I went back to the package that I intended to publish (particle-offline-compiler) - note the additional ‘r’ - and tried apm publish again. Still no go:


#9

Hi @leedohm, pinging to see if you might have encountered this from others before, or if there’s a fix I can try. I don’t mind wiping my entire apm account since this is the first time I’m attempting to publish an atom package.

The only time apm prompts me for my github credentials is when I attempt apm publish minor on the older orphaned package (particle-offline-compiler). I never get prompted otherwise.


#10

Unfortunately, since I neither work for GitHub nor am a member of the Atom Core team, I don’t have visibility into the back-end database which is where the problem most likely lies. Your best bet is to either:

  1. Log in to Slack (instructions pinned at the top of the board) and post for help in the #atom-dot-io channel
  2. Post an Issue on https://github.com/atom/atom.io

Either one should get you in touch with the people that have visibility into that and get you help. Sorry about the lack of response :frowning:


#11

Thanks @leedohm, I’ll try posting this on Slack.


#12

Copying my response from the issue here:

Try logging out and in on the atom.io website and then trying to publish again from the command line. Recently GitHub expired a bunch of idle credentials so it’s possible that refreshing them in this way will fix your API issues.