Deleting nonexistent user email via API causes internal server error #7136

Closed
opened 2025-11-02 07:16:39 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @matusf on GitHub (Apr 9, 2021).

  • Gitea version (or commit ref): Gitea version 1.13.7 built with GNU Make 4.1, go1.15.11 : bindata, sqlite, sqlite_unlock_notify
  • Git version: git version 2.17.
  • Operating system: Ubuntu 18.04
  • Downloaded gitea from downloads page
  • Running as a command-line program
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
2021/04/09 01:45:57 Started DELETE /api/v1/user/emails for 127.0.0.1
2021/04/09 01:45:57 ...api/v1/user/email.go:128:DeleteEmail() [E] DeleteEmailAddresses: Email address does not exist
2021/04/09 01:45:57 Completed DELETE /api/v1/user/emails 500 Internal Server Error in 50.684576ms

Description

Make a DELETE request on /user/emails endpoint with supplied authorization token and invalid email in the body. Then 500 response is returned with following response body:

curl -v -X DELETE -H "Authorization: token $TOKEN" -d '{"emails":["xxx",""]}' 'http://localhost:2999/api/v1/user/emails' -H "Content-Type: application/json"
{"message":"","url":"http://localhost:3000/api/swagger"}
Originally created by @matusf on GitHub (Apr 9, 2021). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): Gitea version 1.13.7 built with GNU Make 4.1, go1.15.11 : bindata, sqlite, sqlite_unlock_notify - Git version: git version 2.17. - Operating system: Ubuntu 18.04 - Downloaded gitea from downloads page - Running as a command-line program - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - Log gist: ``` 2021/04/09 01:45:57 Started DELETE /api/v1/user/emails for 127.0.0.1 2021/04/09 01:45:57 ...api/v1/user/email.go:128:DeleteEmail() [E] DeleteEmailAddresses: Email address does not exist 2021/04/09 01:45:57 Completed DELETE /api/v1/user/emails 500 Internal Server Error in 50.684576ms ``` <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description Make a DELETE request on `/user/emails` endpoint with supplied authorization token and invalid email in the body. Then 500 response is returned with following response body: ``` curl -v -X DELETE -H "Authorization: token $TOKEN" -d '{"emails":["xxx",""]}' 'http://localhost:2999/api/v1/user/emails' -H "Content-Type: application/json" {"message":"","url":"http://localhost:3000/api/swagger"} ```
GiteaMirror added the type/bugmodifies/api labels 2025-11-02 07:16:39 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7136