Recurrent errors in logs #6570

Closed
opened 2025-11-02 06:59:56 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @vdeville on GitHub (Dec 22, 2020).

Hey,

I have multiples issue on my instance (cause 502). I have a first middleware error and an another error into the SSH server.

  • Gitea version : 1.13

  • Git version: Built-in docker image

  • Operating system:
    Run in docker with image tag gitea/gitea 1.13 2d0be3e110e0

  • Database (use [x]):

    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:

    • Yes (provide example URL)
    • No

Description

For example when i go to /issues or randomly when i navigate to the instance. Sometime when get the user avatar /avatars/d41d8cd98f00b204xxxx8ecf8427e
Logs:

web_1  | [Macaron] PANIC: middleware render hasn't been registered
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/render.go:653 (0xd91398)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/render.go:710 (0xd9137d)
web_1  | /go/src/code.gitea.io/gitea/routers/routes/routes.go:166 (0x21aa215)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0xd87492)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd85e14)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd85bb9)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd8761c)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x219de92)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/gzip/gzip.go:140 (0x219de85)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0xd87492)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd85e14)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd85bb9)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd8761c)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0xd991a5)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/recovery.go:161 (0xd99198)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/logger.go:40 (0xd8b1d7)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd85e14)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd85bb9)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd8761c)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0xd984a9)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/logger.go:52 (0xd98494)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/logger.go:40 (0xd8b1d7)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd85e14)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd85bb9)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd8761c)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/router.go:187 (0xd9a3f0)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/router.go:303 (0xd93b85)
web_1  | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/macaron.go:218 (0xd8c54d)
web_1  | /go/src/code.gitea.io/gitea/vendor/github.com/gorilla/context/context.go:141 (0x1293493)
web_1  | /usr/local/go/src/net/http/server.go:2042 (0x77b583)
web_1  | /usr/local/go/src/net/http/server.go:2843 (0x77eb82)
web_1  | /usr/local/go/src/net/http/server.go:1925 (0x77a38c)
web_1  | /usr/local/go/src/runtime/asm_amd64.s:1374 (0x477dc0)

And, the second error when user connect to the SSH server.

web_1  | Could not load host certificate "/data/ssh/ssh_host_ed25519_cert": No such file or directory
web_1  | Could not load host certificate "/data/ssh/ssh_host_rsa_cert": No such file or directory
web_1  | Could not load host certificate "/data/ssh/ssh_host_ecdsa_cert": No such file or directory
web_1  | Could not load host certificate "/data/ssh/ssh_host_dsa_cert": No such file or directory

Tell me if you need more debug logs. Thanks

Originally created by @vdeville on GitHub (Dec 22, 2020). Hey, I have multiples issue on my instance (cause 502). I have a first middleware error and an another error into the SSH server. - Gitea version : 1.13 - Git version: Built-in docker image - Operating system: Run in docker with image tag `gitea/gitea 1.13 2d0be3e110e0` - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No ## Description For example when i go to `/issues` or randomly when i navigate to the instance. Sometime when get the user avatar `/avatars/d41d8cd98f00b204xxxx8ecf8427e` Logs: ``` web_1 | [Macaron] PANIC: middleware render hasn't been registered web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/render.go:653 (0xd91398) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/render.go:710 (0xd9137d) web_1 | /go/src/code.gitea.io/gitea/routers/routes/routes.go:166 (0x21aa215) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0xd87492) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd85e14) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd85bb9) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd8761c) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x219de92) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/gzip/gzip.go:140 (0x219de85) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0xd87492) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd85e14) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd85bb9) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd8761c) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0xd991a5) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/recovery.go:161 (0xd99198) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/logger.go:40 (0xd8b1d7) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd85e14) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd85bb9) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd8761c) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0xd984a9) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/logger.go:52 (0xd98494) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/logger.go:40 (0xd8b1d7) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0xd85e14) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0xd85bb9) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xd8761c) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/router.go:187 (0xd9a3f0) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/router.go:303 (0xd93b85) web_1 | /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/macaron.go:218 (0xd8c54d) web_1 | /go/src/code.gitea.io/gitea/vendor/github.com/gorilla/context/context.go:141 (0x1293493) web_1 | /usr/local/go/src/net/http/server.go:2042 (0x77b583) web_1 | /usr/local/go/src/net/http/server.go:2843 (0x77eb82) web_1 | /usr/local/go/src/net/http/server.go:1925 (0x77a38c) web_1 | /usr/local/go/src/runtime/asm_amd64.s:1374 (0x477dc0) ``` And, the second error when user connect to the SSH server. ``` web_1 | Could not load host certificate "/data/ssh/ssh_host_ed25519_cert": No such file or directory web_1 | Could not load host certificate "/data/ssh/ssh_host_rsa_cert": No such file or directory web_1 | Could not load host certificate "/data/ssh/ssh_host_ecdsa_cert": No such file or directory web_1 | Could not load host certificate "/data/ssh/ssh_host_dsa_cert": No such file or directory ``` Tell me if you need more debug logs. Thanks
GiteaMirror added the type/bug label 2025-11-02 06:59:56 -06:00
Author
Owner

@lunny commented on GitHub (Jan 26, 2021):

Looks like related with #13684

@lunny commented on GitHub (Jan 26, 2021): Looks like related with #13684
Author
Owner

@bclermont commented on GitHub (Feb 11, 2021):

Looks like related with #13684

@lunny no, it's constantly pouring in the logs (I use helm chart). Not just when a user is actively using the webui. Maybe a k8s probe call.

But why the panic aren't logged properly?

@bclermont commented on GitHub (Feb 11, 2021): > Looks like related with #13684 @lunny no, it's constantly pouring in the logs (I use helm chart). Not just when a user is actively using the webui. Maybe a k8s probe call. But why the panic aren't logged properly?
Author
Owner

@zeripath commented on GitHub (Feb 11, 2021):

Update to 1.13.1

@zeripath commented on GitHub (Feb 11, 2021): Update to 1.13.1
Author
Owner

@bclermont commented on GitHub (Feb 11, 2021):

Update to 1.13.1

that fixed it... but that logs:

Unable to negotiate with 10.42.0.116 port 49242: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1 [preauth]
Could not load host certificate "/data/ssh/ssh_host_ed25519_cert": No such file or directory
Could not load host certificate "/data/ssh/ssh_host_rsa_cert": No such file or directory
Could not load host certificate "/data/ssh/ssh_host_ecdsa_cert": No such file or directory
Could not load host certificate "/data/ssh/ssh_host_dsa_cert": No such file or directory

is still there in a loop

@bclermont commented on GitHub (Feb 11, 2021): > Update to 1.13.1 that fixed it... but that logs: ``` Unable to negotiate with 10.42.0.116 port 49242: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1 [preauth] Could not load host certificate "/data/ssh/ssh_host_ed25519_cert": No such file or directory Could not load host certificate "/data/ssh/ssh_host_rsa_cert": No such file or directory Could not load host certificate "/data/ssh/ssh_host_ecdsa_cert": No such file or directory Could not load host certificate "/data/ssh/ssh_host_dsa_cert": No such file or directory ``` is still there in a loop
Author
Owner

@zeripath commented on GitHub (Feb 11, 2021):

Those can be ignored except for that you say they are in a loop indicating that it is constantly restarting which is a configuration issue that you will have to look at.

If you really don't want to see them edit your sshd_config to fix them (either the template or /etc/sshd_config). They will be caused by the:

ac97ea573c/docker/root/etc/templates/sshd_config (L11)

ac97ea573c/docker/root/etc/templates/sshd_config (L13)

ac97ea573c/docker/root/etc/templates/sshd_config (L15)

ac97ea573c/docker/root/etc/templates/sshd_config (L17)

Which can be removed if you never intend to use certificates.

@zeripath commented on GitHub (Feb 11, 2021): Those can be ignored except for that you say they are in a loop indicating that it is constantly restarting which is a configuration issue that you will have to look at. If you really don't want to see them edit your sshd_config to fix them (either the template or /etc/sshd_config). They will be caused by the: https://github.com/go-gitea/gitea/blob/ac97ea573c1b10d03e72775e8f74b9fe5453bfc8/docker/root/etc/templates/sshd_config#L11 https://github.com/go-gitea/gitea/blob/ac97ea573c1b10d03e72775e8f74b9fe5453bfc8/docker/root/etc/templates/sshd_config#L13 https://github.com/go-gitea/gitea/blob/ac97ea573c1b10d03e72775e8f74b9fe5453bfc8/docker/root/etc/templates/sshd_config#L15 https://github.com/go-gitea/gitea/blob/ac97ea573c1b10d03e72775e8f74b9fe5453bfc8/docker/root/etc/templates/sshd_config#L17 Which can be removed if you never intend to use certificates.
Author
Owner

@mschoettle commented on GitHub (Apr 8, 2021):

Wouldn't the other way around be better? By default it is disabled and if someone wants to use certs they can customize the config. The comment in PR #13143 "Afaik, adding these lines does nothing unless the file(s) are present" is not true since it does cause errors and spams the log.

How can I edit the template to remove those lines? Is it possible such that an upgrade to Gitea will keep these settings?

@mschoettle commented on GitHub (Apr 8, 2021): Wouldn't the other way around be better? By default it is disabled and if someone wants to use certs they can customize the config. The comment in PR #13143 "Afaik, adding these lines does nothing unless the file(s) are present" is not true since it does cause errors and spams the log. How can I edit the template to remove those lines? Is it possible such that an upgrade to Gitea will keep these settings?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6570