Gitea: wiki related HTTP 500 Error

Created on 4 Apr 2020  路  9Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): 1.11.4 arm-6 prebuilt
  • Git version: git version 2.25.0
  • Operating system: Debian 10
  • Database (use [x]):

    • [ ] PostgreSQL

    • [x] MySQL

    • [ ] MSSQL

    • [ ] SQLite

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

    • [ ] Yes (provide example URL)

    • [x] No

    • [ ] Not relevant

  • Log gist:
Apr 04 17:51:57 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:51:57: Started GET /repo/create for 192.168.0.20
Apr 04 17:51:57 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:51:57: Completed GET /repo/create 200 OK in 94.066498ms
Apr 04 17:51:57 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:51:57: Started GET /user/avatar/coelner/-1 for 192.168.0.20
Apr 04 17:51:57 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:51:57: Completed GET /user/avatar/coelner/-1 302 Found in 50.249157ms
Apr 04 17:51:58 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:51:58: Started GET /serviceworker.js for 192.168.0.20
Apr 04 17:51:58 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:51:58: Completed GET /serviceworker.js 200 OK in 49.598783ms
Apr 04 17:52:09 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:09: Started POST /repo/create for 192.168.0.20
Apr 04 17:52:09 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:09: Completed POST /repo/create 302 Found in 419.274206ms
Apr 04 17:52:09 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:09: Started GET /coelner/test-500_wiki for 192.168.0.20
Apr 04 17:52:09 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:09: Completed GET /coelner/test-500_wiki 200 OK in 49.351034ms
Apr 04 17:52:10 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:10: Started GET /user/avatar/coelner/-1 for 192.168.0.20
Apr 04 17:52:10 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:10: Completed GET /user/avatar/coelner/-1 302 Found in 18.003619ms
Apr 04 17:52:10 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:10: Started GET /vendor/plugins/fomantic/themes/default/assets/fonts/outline-icons.woff2 for 192.168.0.20
Apr 04 17:52:10 odroidhc1 gitea[15881]: [Macaron] [Static] Serving /vendor/plugins/fomantic/themes/default/assets/fonts/outline-icons.woff2
Apr 04 17:52:10 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:10: Completed GET /vendor/plugins/fomantic/themes/default/assets/fonts/outline-icons.woff2 200 OK in 1.464496ms
Apr 04 17:52:10 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:10: Started GET /serviceworker.js for 192.168.0.20
Apr 04 17:52:10 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:10: Completed GET /serviceworker.js 200 OK in 44.498589ms
Apr 04 17:52:12 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:12: Started GET /coelner/test-500_wiki/wiki for 192.168.0.20
Apr 04 17:52:12 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:12: Completed GET /coelner/test-500_wiki/wiki 200 OK in 99.405191ms
Apr 04 17:52:12 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:12: Started GET /user/avatar/coelner/-1 for 192.168.0.20
Apr 04 17:52:12 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:12: Completed GET /user/avatar/coelner/-1 302 Found in 17.473203ms
Apr 04 17:52:13 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:13: Started GET /serviceworker.js for 192.168.0.20
Apr 04 17:52:13 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:13: Completed GET /serviceworker.js 200 OK in 39.132645ms
Apr 04 17:52:14 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:14: Started GET /coelner/test-500_wiki/wiki/_new for 192.168.0.20
Apr 04 17:52:14 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:14: Completed GET /coelner/test-500_wiki/wiki/_new 200 OK in 120.046511ms
Apr 04 17:52:14 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:14: Started GET /user/avatar/coelner/-1 for 192.168.0.20
Apr 04 17:52:15 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:15: Completed GET /user/avatar/coelner/-1 302 Found in 69.091481ms
Apr 04 17:52:15 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:15: Started GET /vendor/assets/font-awesome/fonts/fontawesome-webfont.woff2?v=4.6.3 for 192.168.0.20
Apr 04 17:52:15 odroidhc1 gitea[15881]: [Macaron] [Static] Serving /vendor/assets/font-awesome/fonts/fontawesome-webfont.woff2
Apr 04 17:52:15 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:15: Completed GET /vendor/assets/font-awesome/fonts/fontawesome-webfont.woff2?v=4.6.3 200 OK in 11.83476ms
Apr 04 17:52:15 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:15: Started GET /serviceworker.js for 192.168.0.20
Apr 04 17:52:15 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:15: Completed GET /serviceworker.js 200 OK in 54.816603ms
Apr 04 17:52:20 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:20: Started POST /coelner/test-500_wiki/wiki/_new for 192.168.0.20
Apr 04 17:52:21 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:21: Completed POST /coelner/test-500_wiki/wiki/_new 500 Internal Server Error in 1.378880919s
Apr 04 17:52:22 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:22: Started GET /user/avatar/coelner/-1 for 192.168.0.20
Apr 04 17:52:22 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:22: Started GET /img/500.png for 192.168.0.20
Apr 04 17:52:22 odroidhc1 gitea[15881]: [Macaron] [Static] Serving /img/500.png
Apr 04 17:52:22 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:22: Completed GET /img/500.png 200 OK in 6.048984ms
Apr 04 17:52:22 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:22: Completed GET /user/avatar/coelner/-1 302 Found in 28.743881ms
Apr 04 17:52:22 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:22: Started GET /serviceworker.js for 192.168.0.20
Apr 04 17:52:22 odroidhc1 gitea[15881]: [Macaron] 2020-04-04 17:52:22: Completed GET /serviceworker.js 200 OK in 15.848582ms

Description

Anything I do related to the wiki, creating a wiki, editing a page, creating a page, e.g. returns a HTTP 500 error. This error occurs also with the previous version 1.11.3.
This ticket is related: https://github.com/go-gitea/gitea/issues/5697

Most helpful comment

I think it is not that simple. Because of the changed Environment Path variable in the service file the profile settings was ignored.

All 9 comments

Anything I do related to the wiki ...
POST /coelner/test-500_wiki/wiki/_new 500

Any changes you do on the wiki use the _new url to POST the changes ...

@coelner your log does not contain real error message.

It would be nice if you can profide us a more verbous error log.
to do so, change your gitea instance into development mode,
by changing RUN_MODE to dev in your config and restart gitea.

after this try to produce the error again. now the 500 error page should show a trace log.

I think the problem is not the RUN_MODE, but that that's not in fact Gitea's log. It's the service log which captures Gitea's stdout/stderr (i.e. console output).

@coelner Please look for the log pointed at to by your app.ini in the FILE_NAME value of your [log] section.

Sorry, I forget about the gitea.log

2020/04/04 17:52:20 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT `id`, `uid`, `repo_id` FROM `star` WHERE `uid`=? AND `repo_id`=? LIMIT 1 []interface {}{1, 10} - took: 1.975911ms
2020/04/04 17:52:21 ...ervices/wiki/wiki.go:213:updateWikiPage() [E] exit status 1 - remote: /usr/bin/env: 'bash': No such file or directory        
        To /mnt/repo/coelner/test-500_wiki.wiki.git
         ! [remote rejected] a3d8cd9fc754bc37835f913b380c63f2591c1861 -> master (pre-receive hook declined)
        error: failed to push some refs to '/mnt/repo/coelner/test-500_wiki.wiki.git'

2020/04/04 17:52:21 routers/repo/wiki.go:581:NewWikiPost() [E] AddWikiPage: Push: exit status 1 - remote: /usr/bin/env: 'bash': No such file or directory        
        To /mnt/repo/coelner/test-500_wiki.wiki.git
         ! [remote rejected] a3d8cd9fc754bc37835f913b380c63f2591c1861 -> master (pre-receive hook declined)
        error: failed to push some refs to '/mnt/repo/coelner/test-500_wiki.wiki.git'

2020/04/04 17:52:22 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `email_notifications_preference`, `passwd`, `passwd_hash_algo`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `repo_admin_change_team_access`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1} - took: 3.781907ms

And to the check the exit 1 error:

[07:08|root@odroidhc1 gitea]# sudo -u git /usr/bin/env bash
git@odroidhc1:/var/log/gitea$ id
uid=1002(git) gid=1002(git) Gruppen=1002(git)
git@odroidhc1:/var/log/gitea$ echo $0
bash
git@odroidhc1:/var/log/gitea$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

@coelner witch git version?

2.25.0

Fix found:
the systemd service file was wrong configured, the fixed one:
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea PATH=/usr/local/bin:/usr/bin:/bin
Or use the line as stated here:
https://github.com/go-gitea/gitea/blob/44ec9b933afe7a7c84e18ff525f377240d8dd4f0/contrib/systemd/gitea.service#L59

@coelner so gitea was not able to find bash ...

I think it is not that simple. Because of the changed Environment Path variable in the service file the profile settings was ignored.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fastidious picture Fastidious  路  3Comments

flozz picture flozz  路  3Comments

tuxfanou picture tuxfanou  路  3Comments

adpande picture adpande  路  3Comments

haytona picture haytona  路  3Comments