Allow more tuning for SSHD on Docker distribution #7400

Closed
opened 2025-11-02 07:24:50 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @louzadod on GitHub (May 28, 2021).

  • Gitea version (or commit ref): 1.14.2
  • Git version: any git client using SSH as protocol
  • Operating system: any
  • Database (use [x]): any
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

git fetch --tags --force --progress -- origin +refs/heads/:refs/remotes/origin/ # timeout=10
hudson.plugins.git.GitException: Command "git fetch --tags --force --progress -- origin +refs/heads/:refs/remotes/origin/" returned status code 128:
stdout:
stderr: ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2430)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2044)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:81)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:569)
at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:370)
at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:330)
at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:396)
at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:98)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:309)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)

Finished: FAILURE

Description

SSHD server inside Gitea container does not allow more concurrent access. Our CD/CD infrastructure is based on SSH. So I had to put sshd_config template file on an external volume and customize it with:

MaxStartups ${SSHD_MAX_STARTUPS}
MaxSessions ${SSHD_MAX_SESSIONS}

The variables are environment variables passed by docker-compose environment.
After increasing the values, my environment became stable again.

Originally created by @louzadod on GitHub (May 28, 2021). - Gitea version (or commit ref): 1.14.2 - Git version: any git client using SSH as protocol - Operating system: any - Database (use `[x]`): any - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - Log gist: > git fetch --tags --force --progress -- origin +refs/heads/*:refs/remotes/origin/* # timeout=10 hudson.plugins.git.GitException: Command "git fetch --tags --force --progress -- origin +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: ssh_exchange_identification: Connection closed by remote host fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2430) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2044) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:81) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:569) at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:370) at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:330) at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:396) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:98) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:309) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE ## Description SSHD server inside Gitea container does not allow more concurrent access. Our CD/CD infrastructure is based on SSH. So I had to put sshd_config template file on an external volume and customize it with: MaxStartups ${SSHD_MAX_STARTUPS} MaxSessions ${SSHD_MAX_SESSIONS} The variables are environment variables passed by docker-compose environment. After increasing the values, my environment became stable again.
GiteaMirror added the type/enhancement label 2025-11-02 07:24:50 -06:00
Author
Owner

@techknowlogick commented on GitHub (Jun 1, 2021):

closing now that linked PR is merged.

@techknowlogick commented on GitHub (Jun 1, 2021): closing now that linked PR is merged.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7400