Skip to content

Get 500 when add ssh key #6715

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

Closed
2 of 7 tasks
mengyyy opened this issue Apr 23, 2019 · 7 comments
Closed
2 of 7 tasks

Get 500 when add ssh key #6715

mengyyy opened this issue Apr 23, 2019 · 7 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@mengyyy
Copy link

mengyyy commented Apr 23, 2019

  • Gitea version (or commit ref): 1.7.0 and 1.8.0
  • Git version: 2.17.1
  • Operating system: ubuntu 18.04.2 x64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
1.7.0
2019/04/23 10:46:07 [I] [SQL] BEGIN TRANSACTION
2019/04/23 10:46:07 [I] [SQL] INSERT INTO `public_key` (`owner_id`,`name`,`fingerprint`,`content`,`mode`,`type`,`login_source_id`,`created_unix`,`updated_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{1, "foo", "SHA256:...", "ssh-rsa AA...", 2, 1, 0, 1555987567, 1555987567}
2019/04/23 10:46:07 [I] [SQL] ROLL BACK
[Macaron] 2019-04-23 10:46:07: Completed POST /user/settings/keys 404 Not Found in 15.947892ms


1.8.0
2019/04/23 10:55:07 [I] [SQL] INSERT INTO `public_key` (`owner_id`,`name`,`fingerprint`,`content`,`mode`,`type`,`login_source_id`,`created_unix`,`updated_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{1, "foo", "SHA256:...", "ssh-rsa AA.....", 2, 1, 0, 1555988107, 1555988107}
2019/04/23 10:55:07 [I] [SQL] ROLL BACK
[Macaron] 2019-04-23 10:55:07: Completed POST /user/settings/keys 500 Internal Server Error in 246.62229ms

Description

I run gitea as root but when I try to add ssh keys i get 500 error.

Screenshots

image

@typeless
Copy link
Contributor

From the timestamps of your log, it looks quite easy to reproduce.
But it seems that most people don't encounter this issue.

Where do you get the Gitea binrary? Do you build it from source or some package distributors?

@mengyyy
Copy link
Author

mengyyy commented Apr 23, 2019

From the timestamps of your log, it looks quite easy to reproduce.
But it seems that most people don't encounter this issue.

Where do you get the Gitea binrary? Do you build it from source or some package distributors?

Yes I get the Gitea binrary.
1.7.0 from dl.gitea.io
1.8.0 from github

I do not build it from source.

@lunny
Copy link
Member

lunny commented Apr 25, 2019

When create SSH key, gitea will save it on your /root/.ssh, maybe you can check the permission of that folder.

@lunny lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Apr 25, 2019
@lafriks
Copy link
Member

lafriks commented Apr 25, 2019

or /home/git/.ssh/...

@mengyyy
Copy link
Author

mengyyy commented Apr 25, 2019

Oh…………
before i install gitea I ran
chmod 400 ~/.ssh/authorized_keys && chattr +i ~/.ssh/authorized_keys && chattr +i ~/.ssh

@mengyyy mengyyy closed this as completed Apr 25, 2019
@jyling
Copy link

jyling commented Jul 4, 2019

on what path will it be on the windows ?

@zeripath
Copy link
Contributor

zeripath commented Jul 4, 2019

If you don't want to write authorized_keys files you can turn them off and switch to use a authorized keys command in the SSH server configuration. See https://docs.gitea.io/en-us/command-line/#keys

@j-be j-be mentioned this issue Dec 22, 2019
8 tasks
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

6 participants