gogs: Docker: html/template: "home" is undefined

  • Gogs version (or commit ref): 0.11.34.1122 (image downloaded from Docker Hub)
  • Git version:
  • Operating system: CoreOS Stable 1576.5.0
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gogs.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist (usually found in log/gogs.log):

Description

First run of the container image (stable, unmodified from Docker Hub) over an existing installation of Gogs (/data volume already containing more than 16000 files) makes some URLs unusable.

Error shown in browser is: html/template: "home" is undefined. When logged in, the dashboard works but some other URLs with templates like org/create or admin/dashboard fail with the same error.

Opening a shell into the running container and killing the gogs PID makes Gogs to restart fully functional. But restarting the container from scratch reproduces the problem.

I’ve noticed that removing the line chown -R git:git /data /app/gogs ~git/ from /app/gogs/docker/s6/gogs/setup makes the container fully functional in all cases. The Dockerfile used to create the functional container is:

FROM gogs/gogs:0.11.34 RUN sed -i ‘s/^chown/# chown/g’ /app/gogs/docker/s6/gogs/setup

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 14
  • Comments: 25 (10 by maintainers)

Commits related to this issue

Most upvoted comments

My experience is with CoreOS hosts.

Yep, @Unknwon - my bad. I just found that patch and realised I was using ‘IfNotPresent’ (i.e. not the latest image) on my setup. Sorry about that.

PR submitted to remove the rogue ‘chown’ command. For the impatient, you can pull the rossigee/gogscontainer in the meantime.

Still an issue. Can we log/debug this somehow?

Have the same issue. Also, the first container log lines are:

05/04/2018 16:58:01usermod: no changes
05/04/2018 16:58:01init:socat  | Linked container DB will be binded to localhost on port 3306
05/04/2018 16:58:01init:socat  | Can't bind linked container GOGS_MYSQL_1 to localhost, port 3306 already in use