Gitea: Gitea does not work after docker restart

Created on 12 Jul 2019  路  14Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): 1.7
  • Git version: 2.18.1
  • Operating system:
    host: Linux u-svr 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    docker: Linux 9766fbc2b907 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 Linux
  • Database (use [x]):

    • [ ] PostgreSQL

    • [ ] MySQL

    • [ ] MSSQL

    • [x] SQLite

  • Can you reproduce the bug at https://try.gitea.io:

    • [ ] Yes (provide example URL)

    • [ ] No

    • [x] Not relevant

  • Log gist:
docker logs gitea:   
s6-supervise openssh: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: No such file or directory
s6-supervise syslogd: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: No such file or directory
s6-supervise gitea: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: No such file or directory
s6-supervise (child): fatal: unable to exec run: No such file or directory
s6-supervise openssh: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise syslogd: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: No such file or directory
s6-supervise (child): fatal: unable to exec run: No such file or directory
s6-supervise gitea: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: No such file or directory
s6-supervise syslogd: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise openssh: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: No such file or directory
s6-supervise (child): fatal: unable to exec run: No such file or directory
s6-supervise gitea: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: No such file or directory
s6-supervise syslogd: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise openssh: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: No such file or directory

Description

Everytime after my computer reboot, the docker can restart, but the website is not visitable. I try to input docker top gitea, the output is this:

UID                 PID                 PPID                C                   STIME               TTY                 TIME                CMD
root                3607                3589                0                   09:36               ?                   00:00:00            /bin/s6-svscan /etc/s6
root                3646                3607                0                   09:36               ?                   00:00:00            s6-supervise openssh
root                3647                3607                0                   09:36               ?                   00:00:00            s6-supervise syslogd
root                3648                3607                0                   09:36               ?                   00:00:00            s6-supervise gitea

So the Gitea process is not running.

The container was created by this comman:

docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:1.7
docker update --restart=alwary gitea

I don't know what caused this problem, any help is appreciated.

kinquestion

All 14 comments

I'd suggest attaching to container using sh/bash and manually starting gitea command, maybe you can see the error there.

I have the same error.
Just find a tutorial, complete all steps, get gitea runnig. Then stop doker and later cound't get gitea online. Please, help.

Same issue here

Created Docker container with:

sudo docker run -d \
    --name="gitea" \
    --restart=always \
    --link postgres:postgres \
    -v /data/disk1/gitea:/data \
    -p 3333:3000 \
    -p 2222:22 \
    gitea/gitea:1.9.0

Accessed the Gitea WebUI http://myhost:3333/ configured Postgres connection info etc and all works fine.

Logs during setup
gitea-setup.log
docker-stdout-setup.log

Then restarted the Gitea container and then not possible to access http://myhost:3333/

Logs after restart:
gitea-after-restart.log
docker-stdout-after-restart.log

Configuration file:
app.ini.txt

I'd suggest attaching to container using sh/bash and manually starting gitea command, maybe you can see the error there.

I attached to the container and started gitea manually, gitea worked fine. I didn't see any error there.

It is started and if I try to kill the process it starts again

bash-5.0$ ps -A
PID   USER     TIME  COMMAND
    1 root      0:00 /bin/s6-svscan /etc/s6
   12 root      0:00 s6-supervise gitea
   13 root      0:00 s6-supervise openssh
   14 root      0:00 /usr/sbin/sshd -D -e
   54 root      0:00 bash
   61 root      0:00 bash
  144 root      0:00 bash
  164 git       0:00 bash
  262 git       0:00 /app/gitea/gitea web
  298 git       0:00 ps -A
bash-5.0$ kill -9 262
bash-5.0$ ps -A
PID   USER     TIME  COMMAND
    1 root      0:00 /bin/s6-svscan /etc/s6
   12 root      0:00 s6-supervise gitea
   13 root      0:00 s6-supervise openssh
   14 root      0:00 /usr/sbin/sshd -D -e
   54 root      0:00 bash
   61 root      0:00 bash
  144 root      0:00 bash
  164 git       0:00 bash
  300 git       0:00 /app/gitea/gitea web
  335 git       0:00 ps -A

Found the issue for me at least.
During the setup I filled in HTTP port as the one exposed by Docker but Gitea uses that internally the the correct config is in my case:

# Internal Gitea Web port
HTTP_PORT        = 3000
# Exposed URL/Port
ROOT_URL         = http://thor:3333/

PS: Got the info from Gogs issue https://github.com/gogs/gogs/issues/1656 DS.

I'd suggest attaching to container using sh/bash and manually starting gitea command, maybe you can see the error there.

I attached to the container and started gitea manually, gitea worked fine. I didn't see any error there.
Please, add more details.. I don't understand what is "I attached to the container"..

I'd suggest attaching to container using sh/bash and manually starting gitea command, maybe you can see the error there.

I attached to the container and started gitea manually, gitea worked fine. I didn't see any error there.
Please, add more details.. I don't understand what is "I attached to the container"..

Run command like docker run -it gitea:gitea --entrypoint /bin/bash to start container without starting gitea and log into the console. Then navigate to gitea executable path and try to execute it. Then check your results.

Another easy alternative is to run a Portainer container which can administrer containers and provides a web based shell to containers
https://hub.docker.com/r/portainer/portainer/

just endited entrypoint:

/usr/sbin/sshd -D -e &
su git -c gitea web

works fine for me, but probably not the best way :sweat:

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

Same problem here.

Followed tutorial on Gitea. When my container shutdown and was restarted, Gitea was not starting up. Upon closer inspection I noticed an error message as others have seen.

Gitea version 1.11.0+dev-218-g4b3fc7493
Docker version 19.03.4, build 9013bf583a
Linux 3.10.0-514.el7.x86_64

Docker compose

version: "2"

networks:
  gitea:
    external: false

services:
  server:
    image: gitea/gitea:latest
    environment:
      - USER_UID=1000
      - USER_GID=1000
    restart: always
    networks:
      - gitea
    volumes:
      - ./gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"
      - "222:22"

Error

server_1  | s6-supervise (child): fatal: unable to exec run: No such file or directory
server_1  | s6-supervise openssh: warning: unable to spawn ./run - waiting 10 seconds
server_1  | s6-supervise (child): fatal: unable to exec run: No such file or directory
server_1  | s6-supervise gitea: warning: unable to spawn ./run - waiting 10 seconds
server_1  | s6-supervise (child): fatal: unable to exec run: No such file or directory
server_1  | s6-supervise openssh: warning: unable to spawn ./run - waiting 10 seconds
server_1  | s6-supervise (child): fatal: unable to exec run: No such file or directory

Edit

I noticed my machine is RED HAT and my Docker was pulled from the CentOS repository.

I encountered this problem and figured it out.

The port of Gitea I used is 8081:3000,
there is a Initial Configuration setting when first login

image

If set Gitea HTTP Listen Port to 8081, it will not be able to connect to http://gitea-server:8081 after docker restarts.

The solution is to set Gitea HTTP Listen Port as the internal port of the container, usually it would be 3000.

Closing as configuration issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonasfranz picture jonasfranz  路  3Comments

thehowl picture thehowl  路  3Comments

adpande picture adpande  路  3Comments

kifirkin picture kifirkin  路  3Comments

haytona picture haytona  路  3Comments