SSH keeps restarting / receiving signal 15 (and DISABLE_SSH does not work) #5893

Closed
opened 2025-11-02 06:39:36 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @Piscator74 on GitHub (Aug 24, 2020).

I've just setup the latest gitea version (and version 1.12.3) with a docker image following the instructions at:
https://docs.gitea.io/en-us/install-with-docker/. All the mapped data folders / mysql folders are created from scratch (so no prior data)

I have used the following docker compose:

version: "2"

networks:
  gitea:
    external: false

services:
  server:
    image: gitea/gitea:1.12.3
    environment:
      - USER_UID=0
      - USER_GID=0
      - DB_TYPE=mysql
      - DB_HOST=db:3306
      - DB_NAME=gitea
      - DB_USER=gitea
      - DB_PASSWD=XXXXXXXXXX
      - DOMAIN=mydomain
      - ROOT_URL=http://mydomain:3000/
    restart: always
    networks:
      - gitea
    volumes:
      - /share/docker/gitea/data:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
       - "3000:3000"
       - "20122:22"
    depends_on:
      - db

  db:
    image: mysql:5.7
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=XXXXXXXXXX
      - MYSQL_USER=gitea
      - MYSQL_PASSWORD=XXXXXXXXXX
      - MYSQL_DATABASE=gitea
    networks:
      - gitea
    volumes:
      - /share/docker/gitea/mysql:/var/lib/mysql

The log shows the following (ssh keeps restarting, sometimes signal 15)

server_1  | Received signal 15; terminating.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Received signal 15; terminating.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Received signal 15; terminating.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Received signal 15; terminating.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Received signal 15; terminating.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.
server_1  | Received signal 15; terminating.
server_1  | Server listening on :: port 22.
server_1  | Server listening on 0.0.0.0 port 22.

I have tried plenty of things, but the following does not make any difference.

  • https://github.com/go-gitea/gitea/issues/10422. Deleted /data/queues, no difference.
  • I started out with an account that had limited permissions (different UID / GID), so I also did retry with root UID, no difference.
  • I tried disabling the SSH server with DISABLE_SSH=true, no difference.
  • I tried different versions (latest and 1.12.3)

Any suggestions how I can debug where this problem is coming from or how I can fix it?

Thanks

Originally created by @Piscator74 on GitHub (Aug 24, 2020). I've just setup the latest gitea version (and version 1.12.3) with a docker image following the instructions at: https://docs.gitea.io/en-us/install-with-docker/. All the mapped data folders / mysql folders are created from scratch (so no prior data) I have used the following docker compose: ``` version: "2" networks: gitea: external: false services: server: image: gitea/gitea:1.12.3 environment: - USER_UID=0 - USER_GID=0 - DB_TYPE=mysql - DB_HOST=db:3306 - DB_NAME=gitea - DB_USER=gitea - DB_PASSWD=XXXXXXXXXX - DOMAIN=mydomain - ROOT_URL=http://mydomain:3000/ restart: always networks: - gitea volumes: - /share/docker/gitea/data:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "3000:3000" - "20122:22" depends_on: - db db: image: mysql:5.7 restart: always environment: - MYSQL_ROOT_PASSWORD=XXXXXXXXXX - MYSQL_USER=gitea - MYSQL_PASSWORD=XXXXXXXXXX - MYSQL_DATABASE=gitea networks: - gitea volumes: - /share/docker/gitea/mysql:/var/lib/mysql ``` The log shows the following (ssh keeps restarting, sometimes signal 15) ``` server_1 | Received signal 15; terminating. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Received signal 15; terminating. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Received signal 15; terminating. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Received signal 15; terminating. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Received signal 15; terminating. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. server_1 | Received signal 15; terminating. server_1 | Server listening on :: port 22. server_1 | Server listening on 0.0.0.0 port 22. ``` I have tried plenty of things, but the following does not make any difference. - https://github.com/go-gitea/gitea/issues/10422. Deleted /data/queues, no difference. - I started out with an account that had limited permissions (different UID / GID), so I also did retry with root UID, no difference. - I tried disabling the SSH server with DISABLE_SSH=true, no difference. - I tried different versions (latest and 1.12.3) Any suggestions how I can debug where this problem is coming from or how I can fix it? Thanks
Author
Owner

@zeripath commented on GitHub (Aug 24, 2020):

What does your app.ini look like?

The default docker runs opensshd and should not have START_SSH_SERVER set.

@zeripath commented on GitHub (Aug 24, 2020): What does your app.ini look like? The default docker runs opensshd and should not have START_SSH_SERVER set.
Author
Owner

@Piscator74 commented on GitHub (Aug 24, 2020):

I did not make any changes to app.ini. It is generated from the docker yml file.
Setting START_SSH_SERVER to false (which is the default) makes no difference.

APP_NAME = Gitea: Git with a cup of tea
RUN_MODE = dev

[repository]
ROOT = /data/git/repositories

[repository.local]
LOCAL_COPY_PATH = /data/gitea/tmp/local-repo

[repository.upload]
TEMP_PATH = /data/gitea/uploads

[server]
APP_DATA_PATH    = /data/gitea
DOMAIN           = mydomain
SSH_DOMAIN       = localhost
HTTP_PORT        = 3000
ROOT_URL         = http://mydomain:3000/
DISABLE_SSH      = true
SSH_PORT         = 22
SSH_LISTEN_PORT  = 22
LFS_START_SERVER = false
LFS_CONTENT_PATH = /data/git/lfs

[database]
PATH    = /data/gitea/gitea.db
DB_TYPE = mysql
HOST    = db:3306
NAME    = gitea
USER    = gitea
PASSWD  = jDHq8uMU2EE5sLP8sZW1

[indexer]
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve

[session]
PROVIDER_CONFIG = /data/gitea/sessions

[picture]
AVATAR_UPLOAD_PATH            = /data/gitea/avatars
REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars

[attachment]
PATH = /data/gitea/attachments

[log]
ROOT_PATH = /data/gitea/log

[security]
INSTALL_LOCK   = false
SECRET_KEY     = 
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1OTgzMDU4OTJ9.bBjvyLcMlEuwrMWwlsY2s1Bf57yRsBVwPzXbtoz0aAU

[service]
DISABLE_REGISTRATION = false
REQUIRE_SIGNIN_VIEW  = false

[oauth2]
JWT_SECRET = WAOLClE59XVbgY0jqD4b0tYnQVn5V-tOMYbj409xkQQ
@Piscator74 commented on GitHub (Aug 24, 2020): I did not make any changes to app.ini. It is generated from the docker yml file. Setting START_SSH_SERVER to false (which is the default) makes no difference. ``` APP_NAME = Gitea: Git with a cup of tea RUN_MODE = dev [repository] ROOT = /data/git/repositories [repository.local] LOCAL_COPY_PATH = /data/gitea/tmp/local-repo [repository.upload] TEMP_PATH = /data/gitea/uploads [server] APP_DATA_PATH = /data/gitea DOMAIN = mydomain SSH_DOMAIN = localhost HTTP_PORT = 3000 ROOT_URL = http://mydomain:3000/ DISABLE_SSH = true SSH_PORT = 22 SSH_LISTEN_PORT = 22 LFS_START_SERVER = false LFS_CONTENT_PATH = /data/git/lfs [database] PATH = /data/gitea/gitea.db DB_TYPE = mysql HOST = db:3306 NAME = gitea USER = gitea PASSWD = jDHq8uMU2EE5sLP8sZW1 [indexer] ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve [session] PROVIDER_CONFIG = /data/gitea/sessions [picture] AVATAR_UPLOAD_PATH = /data/gitea/avatars REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars [attachment] PATH = /data/gitea/attachments [log] ROOT_PATH = /data/gitea/log [security] INSTALL_LOCK = false SECRET_KEY = INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1OTgzMDU4OTJ9.bBjvyLcMlEuwrMWwlsY2s1Bf57yRsBVwPzXbtoz0aAU [service] DISABLE_REGISTRATION = false REQUIRE_SIGNIN_VIEW = false [oauth2] JWT_SECRET = WAOLClE59XVbgY0jqD4b0tYnQVn5V-tOMYbj409xkQQ ```
Author
Owner

@zeripath commented on GitHub (Aug 24, 2020):

Ok so the issue is that the opensshd server cannot open port 22 on the docker.

Presumably there is something else listening on that port or it is being mapped to it? Or you have some other setting preventing it from working

Try setting the SSH_LISTEN_PORT environment variable to something above 1024 (perhaps even 20122) and see if then things can start.

@zeripath commented on GitHub (Aug 24, 2020): Ok so the issue is that the opensshd server cannot open port 22 on the docker. Presumably there is something else listening on that port or it is being mapped to it? Or you have some other setting preventing it from working Try setting the SSH_LISTEN_PORT environment variable to something above 1024 (perhaps even 20122) and see if then things can start.
Author
Owner

@Piscator74 commented on GitHub (Aug 24, 2020):

That is one of the things I already tried, but did not mention. That makes unfortunately no difference (except that is is being killed on port 20122)

    environment:
      - SSH_PORT=20122
      - SSH_LISTEN_PORT=20122
    ports:
       - "3000:3000"
       - "20122:20122"

Is 'DISABLE_SSH=true' not supposed to prevent the SSH server from starting?

@Piscator74 commented on GitHub (Aug 24, 2020): That is one of the things I already tried, but did not mention. That makes unfortunately no difference (except that is is being killed on port 20122) ``` environment: - SSH_PORT=20122 - SSH_LISTEN_PORT=20122 ports: - "3000:3000" - "20122:20122" ``` Is 'DISABLE_SSH=true' not supposed to prevent the SSH server from starting?
Author
Owner

@sardaukar commented on GitHub (May 13, 2021):

Having the same issue now after an upgrade - is there a fix for this?

@sardaukar commented on GitHub (May 13, 2021): Having the same issue now after an upgrade - is there a fix for this?
Author
Owner

@zeripath commented on GitHub (May 13, 2021):

@sardaukar We need logs.

@zeripath commented on GitHub (May 13, 2021): @sardaukar We need logs.
Author
Owner

@sardaukar commented on GitHub (May 13, 2021):

Fixed it by replacing latest with 1.14.2 in the Docker tag for the gitea image in my docker-compose file

@sardaukar commented on GitHub (May 13, 2021): Fixed it by replacing `latest` with `1.14.2` in the Docker tag for the gitea image in my docker-compose file
Author
Owner

@fredericrous commented on GitHub (May 13, 2021):

the signal 15 message is really not helpful, if it said go see the logs, it would be more interesting. I got the same signal 15 error and understood that I did a config mistake only when I read the log file under gitea/log/gitea.log

@fredericrous commented on GitHub (May 13, 2021): the `signal 15` message is really not helpful, if it said go see the logs, it would be more interesting. I got the same `signal 15` error and understood that I did a config mistake only when I read the log file under `gitea/log/gitea.log`
Author
Owner

@sguter90 commented on GitHub (May 26, 2021):

For me this was related to https://github.com/go-gitea/gitea/issues/13588
The actual error in the gitea log was:

2021/05/26 14:32:19 ...s/migrations/v159.go:33:updateReactionConstraint() [I] [SQL] CREATE UNIQUE INDEX `UQE_tmp_recreate__reaction_s` ON `tmp_recreate__reaction` (`type`,`issue_id`,`comment_id`,`user_id`,`original_author_id`,`original_author`) [] - 152.581µs
2021/05/26 14:32:19 ...ations/migrations.go:447:recreateTable() [E] Unable to create uniques for table tmp_recreate__reaction. Error: Error 1071: Specified key was too long; max key length is 767 bytes
2021/05/26 14:32:19 ...ations/migrations.go:397:Migrate() [I] [SQL] ROLLBACK [] - 75.388µs
2

I've fixed this by upgrading from mysql 5.6 to mysql 5.7 and finally to version 8.0.
The steps for my docker-compose setup were:

  1. mysqldump: docker-compose exec db mysqldump -u myuser -pmypassword mydb > gitea.sql
  2. switch image to 5.7 & docker-compose up -d
  3. upgrade: docker-compose exec mycontainername mysql_upgrade -uroot -p
  4. switch image to 8.0
  5. change command for upgrade as suggested here: https://github.com/docker-library/mysql/issues/130#issuecomment-519875921
  6. docker-compose up -d
  7. remove command definition
  8. docker-compose up -d

After that the gitea container was able to process the db migration and the webserver sucessfully started.
I now use the following repo for my gitea setup: https://github.com/sguter90/docker-compose-gitea

@sguter90 commented on GitHub (May 26, 2021): For me this was related to https://github.com/go-gitea/gitea/issues/13588 The actual error in the gitea log was: ``` 2021/05/26 14:32:19 ...s/migrations/v159.go:33:updateReactionConstraint() [I] [SQL] CREATE UNIQUE INDEX `UQE_tmp_recreate__reaction_s` ON `tmp_recreate__reaction` (`type`,`issue_id`,`comment_id`,`user_id`,`original_author_id`,`original_author`) [] - 152.581µs 2021/05/26 14:32:19 ...ations/migrations.go:447:recreateTable() [E] Unable to create uniques for table tmp_recreate__reaction. Error: Error 1071: Specified key was too long; max key length is 767 bytes 2021/05/26 14:32:19 ...ations/migrations.go:397:Migrate() [I] [SQL] ROLLBACK [] - 75.388µs 2 ``` I've fixed this by upgrading from mysql 5.6 to mysql 5.7 and finally to version 8.0. The steps for my docker-compose setup were: 1. mysqldump: ``docker-compose exec db mysqldump -u myuser -pmypassword mydb > gitea.sql`` 2. switch image to 5.7 & ``docker-compose up -d`` 3. upgrade: ``docker-compose exec mycontainername mysql_upgrade -uroot -p`` 4. switch image to 8.0 5. change command for upgrade as suggested here: https://github.com/docker-library/mysql/issues/130#issuecomment-519875921 6. ``docker-compose up -d`` 7. remove command definition 8. ``docker-compose up -d`` After that the gitea container was able to process the db migration and the webserver sucessfully started. I now use the following repo for my gitea setup: https://github.com/sguter90/docker-compose-gitea
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5893