Site administration returns 500 error #8678

Closed
opened 2025-11-02 08:14:17 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @shaunrd0 on GitHub (Mar 10, 2022).

Gitea Version

1.16.1

Git Version

2.30.2

Operating System

Ubuntu 20.04

How are you running Gitea?

Docker container with the following docker-compose.yml

version: "3"

networks:
  gitea:
    external: false

services:
  server:
    image: gitea/gitea:latest
    container_name: gitea
    environment:
      - USER_UID=<REMOVED_FOR_SECURITY>
      - USER_GID=<REMOVED_FOR_SECURITY>
      - GITEA__database__DB_TYPE=mysql
      - GITEA__database__HOST=db:<REMOVED_FOR_SECURITY>
      - GITEA__database__NAME=gitea
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD=<REMOVED_FOR_SECURITY>
    restart: always
    networks:
      - gitea
    volumes:
      - ./gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "<REMOVED_FOR_SECURITY>"
      - "<REMOVED_FOR_SECURITY>"
    depends_on:
      - db

  db:
    image: mysql:8
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=<REMOVED_FOR_SECURITY>
      - MYSQL_USER=gitea
      - MYSQL_PASSWORD=<REMOVED_FOR_SECURITY>
      - MYSQL_DATABASE=gitea
    networks:
      - gitea
    volumes:
      - ./mysql:/var/lib/mysql

Database

MySQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

Here's what seems relevant to me in my logs. This output is produced when I try to visit Site Administration while logged in as the admin user for my Gitea

2022/03/10 16:42:13 ...ers/common/logger.go:21:1() [I] Started GET /admin for 71.79.179.188:0
2022/03/10 16:42:13 ...s/context/context.go:196:HTML() [D] Template: admin/dashboard
2022/03/10 16:42:13 ...s/context/context.go:206:HTML() [E] Render failed: template: admin/dashboard:8:90: executing "admin/dashboard" at <Str2html>: invalid value; expected string
2022/03/10 16:42:13 ...s/context/context.go:196:HTML() [D] Template: status/500
2022/03/10 16:42:13 ...ers/common/logger.go:30:1() [I] Completed GET /admin 500 Internal Server Error in 75.066569ms
2022/03/10 16:42:14 ...ers/common/logger.go:21:1() [I] Started GET /assets/js/index.js?v=50ce8d80d61ca74c6c21ebd2027218b5 for 71.79.179.188:0
2022/03/10 16:42:14 ...ers/common/logger.go:30:1() [I] Completed GET /assets/js/index.js?v=50ce8d80d61ca74c6c21ebd2027218b5 304 Not Modified in 147.283µs
2022/03/10 16:42:14 ...ers/common/logger.go:21:1() [I] Started GET /assets/img/logo.svg for 71.79.179.188:0
2022/03/10 16:42:14 ...ers/common/logger.go:30:1() [I] Completed GET /assets/img/logo.svg 304 Not Modified in 174.814µs
2022/03/10 16:42:14 ...ers/common/logger.go:21:1() [I] Started GET /avatar/6cb6e6d5e476e3102421aedc68986084?size=72 for 71.79.179.188:0
2022/03/10 16:42:14 ...ers/common/logger.go:30:1() [I] Completed GET /avatar/6cb6e6d5e476e3102421aedc68986084?size=72 302 Found in 2.973039ms
2022/03/10 16:42:14 ...ers/common/logger.go:21:1() [I] Started GET /assets/img/500.png for 71.79.179.188:0
2022/03/10 16:42:14 ...ers/common/logger.go:30:1() [I] Completed GET /assets/img/500.png 304 Not Modified in 227.166µs
2022/03/10 16:42:14 ...ers/common/logger.go:21:1() [I] Started GET /user/events for 71.79.179.188:0
2022/03/10 16:42:15 ...ers/common/logger.go:21:1() [I] Started GET /assets/serviceworker.js for 71.79.179.188:0
2022/03/10 16:42:15 ...ers/common/logger.go:30:1() [I] Completed GET /assets/serviceworker.js 304 Not Modified in 203.095µs
2022/03/10 16:42:20 ...ers/common/logger.go:21:1() [I] Started POST / for 197.252.217.230:0
2022/03/10 16:42:20 ...ers/common/logger.go:30:1() [I] Completed POST / 405 Method Not Allowed in 353.879µs
2022/03/10 16:42:30 ...ers/common/logger.go:21:1() [I] Started POST / for 5.121.77.88:0
2022/03/10 16:42:30 ...ers/common/logger.go:30:1() [I] Completed POST / 405 Method Not Allowed in 288.708µs

Here's the 500 page that I see when trying to visit Site Administration -
image

I was able to fix this temporarily by placing my own template in the /data/gitea/templates/admin/dashboard.tmpl, but I didn't modify the template, all I did was navigate to the /data/gitea/templates/admin/ directory then I ran wget https://raw.githubusercontent.com/go-gitea/gitea/main/templates/admin/dashboard.tmpl, followed by docker-compose down && docker-compose up -d. After doing this, I can see the Site Administration page but there is still an error displayed.

image

NBD since I can still use the Site Administration page with this work around, just wanted to report this. Let me know if I can provide further information, I'd be happy to help.

Screenshots

No response

Originally created by @shaunrd0 on GitHub (Mar 10, 2022). ### Gitea Version 1.16.1 ### Git Version 2.30.2 ### Operating System Ubuntu 20.04 ### How are you running Gitea? Docker container with the following `docker-compose.yml` ```yml version: "3" networks: gitea: external: false services: server: image: gitea/gitea:latest container_name: gitea environment: - USER_UID=<REMOVED_FOR_SECURITY> - USER_GID=<REMOVED_FOR_SECURITY> - GITEA__database__DB_TYPE=mysql - GITEA__database__HOST=db:<REMOVED_FOR_SECURITY> - GITEA__database__NAME=gitea - GITEA__database__USER=gitea - GITEA__database__PASSWD=<REMOVED_FOR_SECURITY> restart: always networks: - gitea volumes: - ./gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "<REMOVED_FOR_SECURITY>" - "<REMOVED_FOR_SECURITY>" depends_on: - db db: image: mysql:8 restart: always environment: - MYSQL_ROOT_PASSWORD=<REMOVED_FOR_SECURITY> - MYSQL_USER=gitea - MYSQL_PASSWORD=<REMOVED_FOR_SECURITY> - MYSQL_DATABASE=gitea networks: - gitea volumes: - ./mysql:/var/lib/mysql ``` ### Database MySQL ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Description Here's what seems relevant to me in my logs. This output is produced when I try to visit Site Administration while logged in as the admin user for my Gitea ``` 2022/03/10 16:42:13 ...ers/common/logger.go:21:1() [I] Started GET /admin for 71.79.179.188:0 2022/03/10 16:42:13 ...s/context/context.go:196:HTML() [D] Template: admin/dashboard 2022/03/10 16:42:13 ...s/context/context.go:206:HTML() [E] Render failed: template: admin/dashboard:8:90: executing "admin/dashboard" at <Str2html>: invalid value; expected string 2022/03/10 16:42:13 ...s/context/context.go:196:HTML() [D] Template: status/500 2022/03/10 16:42:13 ...ers/common/logger.go:30:1() [I] Completed GET /admin 500 Internal Server Error in 75.066569ms 2022/03/10 16:42:14 ...ers/common/logger.go:21:1() [I] Started GET /assets/js/index.js?v=50ce8d80d61ca74c6c21ebd2027218b5 for 71.79.179.188:0 2022/03/10 16:42:14 ...ers/common/logger.go:30:1() [I] Completed GET /assets/js/index.js?v=50ce8d80d61ca74c6c21ebd2027218b5 304 Not Modified in 147.283µs 2022/03/10 16:42:14 ...ers/common/logger.go:21:1() [I] Started GET /assets/img/logo.svg for 71.79.179.188:0 2022/03/10 16:42:14 ...ers/common/logger.go:30:1() [I] Completed GET /assets/img/logo.svg 304 Not Modified in 174.814µs 2022/03/10 16:42:14 ...ers/common/logger.go:21:1() [I] Started GET /avatar/6cb6e6d5e476e3102421aedc68986084?size=72 for 71.79.179.188:0 2022/03/10 16:42:14 ...ers/common/logger.go:30:1() [I] Completed GET /avatar/6cb6e6d5e476e3102421aedc68986084?size=72 302 Found in 2.973039ms 2022/03/10 16:42:14 ...ers/common/logger.go:21:1() [I] Started GET /assets/img/500.png for 71.79.179.188:0 2022/03/10 16:42:14 ...ers/common/logger.go:30:1() [I] Completed GET /assets/img/500.png 304 Not Modified in 227.166µs 2022/03/10 16:42:14 ...ers/common/logger.go:21:1() [I] Started GET /user/events for 71.79.179.188:0 2022/03/10 16:42:15 ...ers/common/logger.go:21:1() [I] Started GET /assets/serviceworker.js for 71.79.179.188:0 2022/03/10 16:42:15 ...ers/common/logger.go:30:1() [I] Completed GET /assets/serviceworker.js 304 Not Modified in 203.095µs 2022/03/10 16:42:20 ...ers/common/logger.go:21:1() [I] Started POST / for 197.252.217.230:0 2022/03/10 16:42:20 ...ers/common/logger.go:30:1() [I] Completed POST / 405 Method Not Allowed in 353.879µs 2022/03/10 16:42:30 ...ers/common/logger.go:21:1() [I] Started POST / for 5.121.77.88:0 2022/03/10 16:42:30 ...ers/common/logger.go:30:1() [I] Completed POST / 405 Method Not Allowed in 288.708µs ``` Here's the 500 page that I see when trying to visit Site Administration - ![image](https://user-images.githubusercontent.com/13367889/157716860-67d50f55-e606-4fa4-ae73-386169f9a8a5.png) I was able to fix this temporarily by placing my own template in the `/data/gitea/templates/admin/dashboard.tmpl`, but I didn't modify the template, all I did was navigate to the `/data/gitea/templates/admin/` directory then I ran `wget https://raw.githubusercontent.com/go-gitea/gitea/main/templates/admin/dashboard.tmpl`, followed by `docker-compose down && docker-compose up -d`. After doing this, I can see the Site Administration page but there is still an error displayed. ![image](https://user-images.githubusercontent.com/13367889/157717157-bc08a7ba-2460-4352-bf3b-a5818acaa686.png) NBD since I can still use the Site Administration page with this work around, just wanted to report this. Let me know if I can provide further information, I'd be happy to help. ### Screenshots _No response_
Author
Owner

@shaunrd0 commented on GitHub (Mar 10, 2022):

Sorry, this was actually on my end. I just realized after posting this that the version in the error seen in the second screenshot matched my Gitea version, and it seems I was just missing an update. Fixed it by pulling the updated docker images.

docker-compose down && docker image prune -af && docker-compose up -d

I then tested without a custom dashboard.tmpl. Everything is working fine.

@shaunrd0 commented on GitHub (Mar 10, 2022): Sorry, this was actually on my end. I just realized after posting this that the version in the error seen in the second screenshot matched my Gitea version, and it seems I was just missing an update. Fixed it by pulling the updated docker images. ```bash docker-compose down && docker image prune -af && docker-compose up -d ``` I then tested *without* a custom `dashboard.tmpl`. Everything is working fine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8678