No push with integrated SSH server #2622

Closed
opened 2025-11-02 04:42:28 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @benzkji on GitHub (Dec 5, 2018).

  • Gitea version (or commit ref): 1.6
  • Git version: 2.11.0
  • Operating system: Ubuntu
  • 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:

Description

Push to repos does not work, using the built in SSH server.
https://gist.github.com/benzkji/74668d1ed5f25596861ce944749047ea

I'am running gitea behind a reverse proxy, but SSH is exposed directly (61005). The server is running, but produces the stack trace when trying to push.

LOCAL_ROOT_URL   = http://localhost:62070/
DOMAIN           = localhost
HTTP_PORT        = 62070
ROOT_URL         = https://realdeal.com/
DISABLE_SSH      = false 
START_SSH_SERVER = true
SSH_DOMAIN       = realdeal.com
SSH_PORT         = 61005
SSH_LISTEN_PORT  = 61005

maybe related: #3226 / #1685 (same error)
though, my LOCAL_ROOT_URL is set (hopefull correctly), I can wget http://localhost:62070/

Originally created by @benzkji on GitHub (Dec 5, 2018). - Gitea version (or commit ref): 1.6 - Git version: 2.11.0 - Operating system: Ubuntu - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description Push to repos does not work, using the built in SSH server. https://gist.github.com/benzkji/74668d1ed5f25596861ce944749047ea I'am running gitea behind a reverse proxy, but SSH is exposed directly (61005). The server is running, but produces the stack trace when trying to push. ``` LOCAL_ROOT_URL = http://localhost:62070/ DOMAIN = localhost HTTP_PORT = 62070 ROOT_URL = https://realdeal.com/ DISABLE_SSH = false START_SSH_SERVER = true SSH_DOMAIN = realdeal.com SSH_PORT = 61005 SSH_LISTEN_PORT = 61005 ``` maybe related: #3226 / #1685 (same error) though, my `LOCAL_ROOT_URL` is set (hopefull correctly), I can `wget http://localhost:62070/`
Author
Owner

@benzkji commented on GitHub (Dec 5, 2018):

Ahh. runninggitea web directly works. When using my service, it doesnt.

[Unit]
Description=Gitea (Git with a cup of tea)

[Service]
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
RestartSec=2s
Type=simple
WorkingDirectory=/path/to/gitea-live
ExecStart=/path/to/gitea-live/gitea web
Restart=always
# Environment=USER=myuser HOME=/home/myuser GITEA_WORK_DIR=/path/to/gitea-live
# If you want to bind Gitea to a port below 1024 uncomment
# the two values below
###
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
#AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=default.target

Not that systemd savvy. /path/to/gitea-live is where manally running gitea web works. What could make the difference? Tried with LimitMEMLOCK and LimitNOFILE, also with Environment...

EDIT: Thought it could be the working directory, but this seems not the case. Also, when watching with ps fux, the only difference is the systemd process having the gitea process as child...arrff. Almost there :|

@benzkji commented on GitHub (Dec 5, 2018): Ahh. running`gitea web` directly works. When using my service, it doesnt. ``` [Unit] Description=Gitea (Git with a cup of tea) [Service] # Modify these two values and uncomment them if you have # repos with lots of files and get an HTTP error 500 because # of that ### #LimitMEMLOCK=infinity #LimitNOFILE=65535 RestartSec=2s Type=simple WorkingDirectory=/path/to/gitea-live ExecStart=/path/to/gitea-live/gitea web Restart=always # Environment=USER=myuser HOME=/home/myuser GITEA_WORK_DIR=/path/to/gitea-live # If you want to bind Gitea to a port below 1024 uncomment # the two values below ### #CapabilityBoundingSet=CAP_NET_BIND_SERVICE #AmbientCapabilities=CAP_NET_BIND_SERVICE [Install] WantedBy=default.target ``` Not that systemd savvy. /path/to/gitea-live is where manally running `gitea web` works. What could make the difference? Tried with `LimitMEMLOCK` and `LimitNOFILE`, also with `Environment`... EDIT: Thought it could be the working directory, but this seems not the case. Also, when watching with `ps fux`, the only difference is the systemd process having the gitea process as child...arrff. Almost there :|
Author
Owner

@lunny commented on GitHub (Dec 8, 2018):

Maybe add depends on mysql or postgres?

@lunny commented on GitHub (Dec 8, 2018): Maybe add depends on mysql or postgres?
Author
Owner

@benzkji commented on GitHub (Dec 8, 2018):

@lunny why? It now works, finally. I added

HTTP_ADDR = 127.0.0.1

but not sure if that was it. I also changed some systemd settings (removed type=simple, added after=network.target).

systemd is still sometimes is a mysterium, for me at least.

@benzkji commented on GitHub (Dec 8, 2018): @lunny why? It now works, finally. I added HTTP_ADDR = 127.0.0.1 but not sure if that was it. I also changed some systemd settings (removed type=simple, added after=network.target). systemd is still sometimes is a mysterium, for me at least.
Author
Owner

@lunny commented on GitHub (Dec 9, 2018):

right you should add two after, one is for network, another is for your database.

@lunny commented on GitHub (Dec 9, 2018): right you should add two after, one is for network, another is for your database.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2622