#5276 Cannot add ssh key
Opened 3 years ago by geoargyr. Modified 11 months ago

I am following this documentation:
https://docs.pagure.org/pagure/usage/first_steps.html?highlight=ssh%20key

I am pasting my public ssh key and the moment I click on "add" it returns me this message:
"
Fatal Error (500)
A fatal error has occurred, we're sorry :(
"
Is it a known issue?
Is it something temporary?

As a result I am not authorized to do any changes in my repositories.


What type of public SSH key is it? I've got a couple of RSA keys and it works fine...

It is an RSA key. It works in Gitlab.
Those RSA keys you are referring to, did you add them today?

No, they've been there for a while...

Metadata Update from @ngompa:
- Issue tagged with: pagure.io

3 years ago

@pingou, @zlopez: can either of you see if there's something funky going on in the server?

@geoargyr Note that you can, as an alternative, create an API key that lets you push into your repositories with HTTPS.

I'll try that too. Thanks.

Looks like it's failing in the code:

  File "/usr/lib/python3.6/site-packages/pagure/lib/query.py", line 230, in is_valid_ssh_key
    stream.write(key)
UnicodeEncodeError: 'ascii' codec can't encode character '\u201c' in position 553: ordinal not in range(128)

@geoargyr Note that you can, as an alternative, create an API key that lets you push into your repositories with HTTPS.

I created an API key to make git ask me for my credentials, but I just get an "error: 403".
Maybe I am doing something wrong though, or I am following wrong instructions on how to use my API key. CAn you point me to documentation on how to use the API key that I created?

Did you create the key with HTTPS-commit permission?

Also, you need to push using the HTTPS URL rather than the SSH one.

Yes, I created the key with HTTPS-commit and "Open a new pull-request" permissions.
As I couldn't be able to push, I revoked it and created another one with all the permissions enabled.
My problem with the API key is that GIT never prompts me for typing a password. So, when I push I just get "The requested URL returned error: 403", I never have the opportunity though to type my password, which in this case would be the API key.
I also tried to put it as a global with this command: git config --global user.password <API key>
Again, when I push I get the error.
Either I am doing something very wrong with the API key and that's why I asked for extra documentation or something wrong is happening.

As for the HTTPS URL, I am 100% I am using it. As i was unable to add my ssh key and I have no SSH saved in my account, I get no other urls except for the HTTPS one!

Hello!
Any news about this issue?

As I was trying every day to add my ssh key in my account here: https://pagure.io/settings#nav-ssh-tab I had my "aha moment" and decided to delete the email that is placed in the end of my public ssh key.
This time my ssh key was accepted by the system.

In conclusion, your system doesn't accept ssh keys that are issued with an email, or anything else after the end of the ssh key. On the contrary, I added ssh keys in other systems like github and gitlab where such ssh keys were perfectly fine.

Thanks for all your help,
Giorgos

Metadata Update from @geoargyr:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

3 years ago

Metadata Update from @pingou:
- Issue status updated to: Open (was: Closed)

3 years ago

I've re-opened this because while it's nice to know the root cause and I'm glad you've managed to get it working, it still sounds like a bug we should look into :)

Metadata Update from @wombelix:
- Issue set to the milestone: 6.x
- Issue tagged with: bug

11 months ago

Log in to comment on this ticket.

Metadata