Internal Server Error 500 when creating Webhook #14110

Closed
opened 2025-11-02 11:03:11 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @gjchalin on GitHub (Feb 6, 2025).

Description

In the Site Administration page, selecting Integrations > Webhooks, and then trying to create a Webhook, Gitea shows the page form for creating a new Webhook, but with a big "500 Internal Server Error" on the top of the page, followed by this message:

An error occurred:

Render failed, failed to render template: admin/hook_new, error: template error: builtin(bindata):repo/settings/webhook/settings:116:55 : executing "repo/settings/webhook/settings" at <.Webhook.HookEvents.Get>: can't evaluate field Get in type webhook.HookEvents

				<input name="status" type="checkbox" {{if .Webhook.HookEvents.Get "status"}}checked{{end}}>
				                                                  ^

For what it says, it tries to render a checkbox and fails to run the {{if .Webhook.HookEvents.Get "status"}} part.

Here are some of the logs when the error ocurrs:

2025/02/06 23:28:48 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user/events for 10.20.30.4:58563, 200 OK in 2105.6ms @ events/events.go:18(events.Events)
2025/02/06 23:28:48 ...eb/routing/logger.go:102:func1() [I] router: completed GET /-/admin for 10.20.30.4:58631, 200 OK in 6.8ms @ admin/admin.go:134(admin.Dashboard)
2025/02/06 23:28:51 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user/events for 10.20.30.4:58631, 200 OK in 2834.1ms @ events/events.go:18(events.Events)
2025/02/06 23:28:51 ...eb/routing/logger.go:102:func1() [I] router: completed GET /-/admin/hooks for 10.20.30.4:58632, 200 OK in 6.4ms @ admin/hooks.go:22(admin.DefaultOrSystemWebhooks)
2025/02/06 23:28:53 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user/events for 10.20.30.4:58632, 200 OK in 1679.6ms @ events/events.go:18(events.Events)
2025/02/06 23:28:54 .../context_response.go:88:HTML() [E] Render failed: failed to render template: admin/hook_new, error: template error: builtin(bindata):repo/settings/webhook/settings:116:55 : executing "repo/settings/webhook/settings" at <.Webhook.HookEvents.Get>: can't evaluate field Get in type webhook.HookEvents


                                    <input name="status" type="checkbox" {{if .Webhook.HookEvents.Get "status"}}checked{{end}}>
                                                                                      ^

2025/02/06 23:28:54 ...eb/routing/logger.go:102:func1() [I] router: completed GET /-/admin/default-hooks/gitea/new for 10.20.30.4:58634, 200 OK in 6.7ms @ setting/webhook.go:122(setting.WebhooksNew)

Gitea Version

1.23.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Image

Git Version

2.47.2

Operating System

Ubuntu 22.04.4 LTS

How are you running Gitea?

It's running on a podman container.

Database

MySQL/MariaDB

Originally created by @gjchalin on GitHub (Feb 6, 2025). ### Description In the Site Administration page, selecting Integrations > Webhooks, and then trying to create a Webhook, Gitea shows the page form for creating a new Webhook, but with a big "500 Internal Server Error" on the top of the page, followed by this message: An error occurred: Render failed, failed to render template: admin/hook_new, error: template error: builtin(bindata):repo/settings/webhook/settings:116:55 : executing "repo/settings/webhook/settings" at <.Webhook.HookEvents.Get>: can't evaluate field Get in type webhook.HookEvents ---------------------------------------------------------------------- <input name="status" type="checkbox" {{if .Webhook.HookEvents.Get "status"}}checked{{end}}> ^ ---------------------------------------------------------------------- For what it says, it tries to render a checkbox and fails to run the {{if .Webhook.HookEvents.Get "status"}} part. Here are some of the logs when the error ocurrs: > 2025/02/06 23:28:48 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user/events for 10.20.30.4:58563, 200 OK in 2105.6ms @ events/events.go:18(events.Events) 2025/02/06 23:28:48 ...eb/routing/logger.go:102:func1() [I] router: completed GET /-/admin for 10.20.30.4:58631, 200 OK in 6.8ms @ admin/admin.go:134(admin.Dashboard) 2025/02/06 23:28:51 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user/events for 10.20.30.4:58631, 200 OK in 2834.1ms @ events/events.go:18(events.Events) 2025/02/06 23:28:51 ...eb/routing/logger.go:102:func1() [I] router: completed GET /-/admin/hooks for 10.20.30.4:58632, 200 OK in 6.4ms @ admin/hooks.go:22(admin.DefaultOrSystemWebhooks) 2025/02/06 23:28:53 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user/events for 10.20.30.4:58632, 200 OK in 1679.6ms @ events/events.go:18(events.Events) 2025/02/06 23:28:54 .../context_response.go:88:HTML() [E] Render failed: failed to render template: admin/hook_new, error: template error: builtin(bindata):repo/settings/webhook/settings:116:55 : executing "repo/settings/webhook/settings" at <.Webhook.HookEvents.Get>: can't evaluate field Get in type webhook.HookEvents ---------------------------------------------------------------------- <input name="status" type="checkbox" {{if .Webhook.HookEvents.Get "status"}}checked{{end}}> ^ ---------------------------------------------------------------------- 2025/02/06 23:28:54 ...eb/routing/logger.go:102:func1() [I] router: completed GET /-/admin/default-hooks/gitea/new for 10.20.30.4:58634, 200 OK in 6.7ms @ setting/webhook.go:122(setting.WebhooksNew) ### Gitea Version 1.23.2 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots ![Image](https://github.com/user-attachments/assets/f2ec63fb-b9cb-4dcf-bb7e-49d978bf1752) ### Git Version 2.47.2 ### Operating System Ubuntu 22.04.4 LTS ### How are you running Gitea? It's running on a podman container. ### Database MySQL/MariaDB
GiteaMirror added the type/bug label 2025-11-02 11:03:11 -06:00
Author
Owner

@lunny commented on GitHub (Feb 7, 2025):

This has been resolved in v1.23.3. Please upgrade.

@lunny commented on GitHub (Feb 7, 2025): This has been resolved in v1.23.3. Please upgrade.
Author
Owner

@gjchalin commented on GitHub (Feb 7, 2025):

Thanks for the info, I'll update my installation.

@gjchalin commented on GitHub (Feb 7, 2025): Thanks for the info, I'll update my installation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14110