Docker/rootless: "ssh-keygen": executable file not found in $PATH #11871

Closed
opened 2025-11-02 09:50:20 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @williamdes on GitHub (Oct 17, 2023).

Description

This is the same request as #23363
Looks like #23363 was not fixed or has some other bug.

I disabled the internal SSH server.

But this time, no fancy error, just an error 500

2023/10/16 12:18:55 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/ssh/authorized_keys for 127.0.0.1:0, 500 Internal Server Error in 1.1ms @ private/key.go:50(private.AuthorizedPublicKeyByContent)

2023/10/16 12:18:55 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/ssh/authorized_keys for 127.0.0.1:0, 500 Internal Server Error in 0.6ms @ private/key.go:50(private.AuthorizedPublicKeyByContent)

I had to run: docker exec -u root -it gitea apk add openssh-client to fix the error

Gitea Version

1.21

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Debian 12

How are you running Gitea?

Docker rootless

Database

MySQL/MariaDB

Originally created by @williamdes on GitHub (Oct 17, 2023). ### Description This is the same request as #23363 Looks like #23363 was not fixed or has some other bug. I disabled the internal SSH server. But this time, no fancy error, just an error 500 ``` 2023/10/16 12:18:55 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/ssh/authorized_keys for 127.0.0.1:0, 500 Internal Server Error in 1.1ms @ private/key.go:50(private.AuthorizedPublicKeyByContent) 2023/10/16 12:18:55 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/ssh/authorized_keys for 127.0.0.1:0, 500 Internal Server Error in 0.6ms @ private/key.go:50(private.AuthorizedPublicKeyByContent) ``` I had to run: `docker exec -u root -it gitea apk add openssh-client` to fix the error ### Gitea Version 1.21 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Debian 12 ### How are you running Gitea? Docker rootless ### Database MySQL/MariaDB
GiteaMirror added the issue/needs-feedback label 2025-11-02 09:50:20 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Dec 29, 2023):

rootless must use builtin SSH server.

@wxiaoguang commented on GitHub (Dec 29, 2023): rootless must use builtin SSH server.
Author
Owner

@williamdes commented on GitHub (Dec 31, 2023):

rootless must use builtin SSH server.

That does not make sense to require a ssh server to parse the keys

@williamdes commented on GitHub (Dec 31, 2023): > rootless must use builtin SSH server. That does not make sense to require a ssh server to parse the keys
Author
Owner

@wxiaoguang commented on GitHub (Dec 31, 2023):

Yup, rootless image doesn't use "a ssh server to parse the keys".

But you said "I disabled the internal SSH server."


There is no enough information (eg: you app.ini, etc), so I could only guess:

If there is no SSH_KEYGEN_PATH in your app.ini, the new code should have been using the bulitin parser, but not ssh-keygen.

image

@wxiaoguang commented on GitHub (Dec 31, 2023): Yup, rootless image doesn't use "a ssh server to parse the keys". But you said "I disabled the internal SSH server." ---- There is no enough information (eg: you `app.ini`, etc), so I could only guess: If there is no `SSH_KEYGEN_PATH` in your app.ini, the new code should have been using the bulitin parser, but not `ssh-keygen`. ![image](https://github.com/go-gitea/gitea/assets/2114189/558a174c-57d2-4979-a382-0c50ffe2c508)
Author
Owner

@wxiaoguang commented on GitHub (Dec 31, 2023):

And one more thing, your log

2023/10/16 12:18:55 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/ssh/authorized_keys for 127.0.0.1:0, 500 Internal Server Error in 1.1ms @ private/key.go:50(private.AuthorizedPublicKeyByContent)

doesn't seem related to the "ssh-keygen" problem. I have read the code again, private.AuthorizedPublicKeyByContent only does some database queries, no "ssh-keygen" call.


So, if there is still a problem, please provide more clues, and provide a reproducible example with detailed steps.

@wxiaoguang commented on GitHub (Dec 31, 2023): And one more thing, your log ``` 2023/10/16 12:18:55 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/ssh/authorized_keys for 127.0.0.1:0, 500 Internal Server Error in 1.1ms @ private/key.go:50(private.AuthorizedPublicKeyByContent) ``` doesn't seem related to the "ssh-keygen" problem. I have read the code again, `private.AuthorizedPublicKeyByContent` only does some database queries, no "ssh-keygen" call. ---- So, if there is still a problem, please provide more clues, and provide a reproducible example with detailed steps.
Author
Owner

@williamdes commented on GitHub (Dec 31, 2023):

Can you re open, I will have one more look to reproduce this bug

@williamdes commented on GitHub (Dec 31, 2023): Can you re open, I will have one more look to reproduce this bug
Author
Owner

@wxiaoguang commented on GitHub (Jan 21, 2024):

Inactive for more than 2 weeks, feel free to reopen "if there is still a problem, please provide more clues, and provide a reproducible example with detailed steps"

@wxiaoguang commented on GitHub (Jan 21, 2024): Inactive for more than 2 weeks, feel free to reopen "if there is still a problem, please provide more clues, and provide a reproducible example with detailed steps"
Author
Owner

@github-actions[bot] commented on GitHub (Feb 29, 2024):

Automatically locked because of our CONTRIBUTING guidelines

@github-actions[bot] commented on GitHub (Feb 29, 2024): Automatically locked because of our [CONTRIBUTING guidelines](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#issue-locking)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11871