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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could the "Access Denied." message be made more informative, after trying "gem push *.gem" and failing at that? #7595

Open
rubyFeedback opened this issue Apr 22, 2024 · 8 comments

Comments

@rubyFeedback
Copy link

I am currently testing a few things via a new account.

So I built a local .gem file successfully, for a new gem; then I am trying to
push it, via:

gem push *.gem

I then get this message:

Pushing gem to https://rubygems.org...
Access Denied. Please sign up for an account at https://rubygems.org

I am, however had, logged in with that test account at rubygems.org, so the
message "sign up for an account" is confusing. I assume there may be some
other issue, be it cache-related or some data that is conflicting or
missing. (I did, however had, remove ~/.gem and then recompiled ruby
from source, and also cleared all old cookies etc...)

Either way what this is, the message "Access Denied", and then the
"Please sign up for an account" is confusing, because I have a new account
at rubygems.org, so signing up for yet-another account makes no sense in
my situation here, which makes the commandline notification a bit awkward;
it seems whoever wrote this did not consider that such an account may
already exist. Thus I assume there is some other problem to be the
culprit here.

Would it be possible to provide more useful information than merely
the "Access Denied" message? The "Access Denied" does not tell me
much at all. I don't have a good alternative suggestion for a message because
I do not know what the real issue is. Also, I have not been able to
find a commandline option to specify additional data, e. g. email or something.

In the past, rubygems always asked me to provide e. g. my email before I would
push a gem, but I do not seem to be able to specify this via the commandline, or
I have not found how that can be done. Would be nice to have this
available via the commandline too, to avoid ambiguity; and if it already exists or
is added, to perhaps also add this to the "gem help examples", which is, by the
way, rather useful (could need some more examples too).

@simi
Copy link
Member

simi commented Apr 22, 2024

Hello, most likely you need to login again using gem signin (or logout with gem signout to get the login prompt).

@duckinator
Copy link
Member

The only situation I can find where you get this message from the client is when you:

  1. Sign in with the gem command (via one of gem signin, during a gem push, etc).
  2. Revoke the key that was generated in step 1.
  3. Try gem push.

The text is not defined in the gem client, but returned by rubygems.org. The exact string is defined at https://github.com/rubygems/rubygems.org/blob/master/config/locales/en.yml#L30 and returned by https://github.com/rubygems/rubygems.org/blob/master/app/controllers/api/base_controller.rb#L101.

It might make sense to have it mention gem signin, since that's the fix.

@deivid-rodriguez
Copy link
Member

Should we move this to the rubygems.org repo then?

@simi
Copy link
Member

simi commented Apr 29, 2024

@deivid-rodriguez yup, we can probably make error message more informational to suggest next steps. On the other side, on unathorized, maybe gem push can offer to login again and remove old non-working key? 🤔

@deivid-rodriguez
Copy link
Member

Yes, that makes sense to me. I'll leave this opened to track that improvement.

@duckinator
Copy link
Member

@deivid-rodriguez I think this makes sense to move to the rubygems.org repo, although I don't have permissions on the rubygems.org repo myself — would you mind moving it?

@deivid-rodriguez
Copy link
Member

I don't mind moving it but @simi was suggesting that changes in the client could also be useful, like automatically deleting the non working key, and prompting the user again for login directly.

@duckinator
Copy link
Member

Ah, that's a fair point. 👍 I opened rubygems/rubygems.org#4663 for the rubygems.org side of this.

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

No branches or pull requests

4 participants