DELETE time tracking fail with 500 error #5354

Closed
opened 2025-11-02 06:22:25 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @camdarley on GitHub (May 6, 2020).

Description

Hi,
I seems that a DELETE request to https://try.gitea.io/api/v1/repos/camdarley/api-test/issues/1/times/769 leads to a 500 error with this trace:

runtime error: invalid memory address or nil pointer dereference /usr/local/go/src/runtime/panic.go:199 (0x44c4db) /usr/local/go/src/runtime/signal_unix.go:394 (0x44c318) /go/src/code.gitea.io/gitea/models/issue_tracked_time.go:282 (0xee64b0) /go/src/code.gitea.io/gitea/routers/api/v1/repo/issue_tracked_time.go:302 (0x1725f60) ...

GET https://try.gitea.io/api/v1/repos/camdarley/api-test/issues/1/times list a time entry with ID 769, but when I send a DELETE to https://try.gitea.io/api/v1/repos/camdarley/api-test/issues/1/times/769 it fails with above error.

I tested first on my own Gitea instance, which is 1.11.4 with same issue.

Screenshots

Originally created by @camdarley on GitHub (May 6, 2020). <!-- 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. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.11.4 - Git version: 2.17.1 - Operating system: Ubuntu 18.04 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) https://try.gitea.io/api/v1/repos/camdarley/api-test/issues/1/times/769 - [ ] No - [ ] Not relevant - Log gist: ## Description Hi, I seems that a DELETE request to https://try.gitea.io/api/v1/repos/camdarley/api-test/issues/1/times/769 leads to a 500 error with this trace: `runtime error: invalid memory address or nil pointer dereference /usr/local/go/src/runtime/panic.go:199 (0x44c4db) /usr/local/go/src/runtime/signal_unix.go:394 (0x44c318) /go/src/code.gitea.io/gitea/models/issue_tracked_time.go:282 (0xee64b0) /go/src/code.gitea.io/gitea/routers/api/v1/repo/issue_tracked_time.go:302 (0x1725f60) ...` GET https://try.gitea.io/api/v1/repos/camdarley/api-test/issues/1/times list a time entry with ID 769, but when I send a DELETE to https://try.gitea.io/api/v1/repos/camdarley/api-test/issues/1/times/769 it fails with above error. I tested first on my own Gitea instance, which is 1.11.4 with same issue. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/bug label 2025-11-02 06:22:25 -06:00
Author
Owner

@zeripath commented on GitHub (May 6, 2020):

@6543 have we already fixed this in 1.12?

@zeripath commented on GitHub (May 6, 2020): @6543 have we already fixed this in 1.12?
Author
Owner

@6543 commented on GitHub (May 7, 2020):

I'll have a look at it asap

@6543 commented on GitHub (May 7, 2020): I'll have a look at it asap
Author
Owner

@6543 commented on GitHub (May 7, 2020):

While looking at the code I noticed this: #11319

@6543 commented on GitHub (May 7, 2020): While looking at the code I noticed this: #11319
Author
Owner

@6543 commented on GitHub (May 7, 2020):

but didn't looked at the delete jet

@6543 commented on GitHub (May 7, 2020): but didn't looked at the delete jet
Author
Owner

@camdarley commented on GitHub (May 8, 2020):

@6543 I noticed #11319 too, and not found happen often when one mistakenly use issue ID and not index.
But I can confirm this issue is not a related to a "Not Found".

@camdarley commented on GitHub (May 8, 2020): @6543 I noticed #11319 too, and not found happen often when one mistakenly use issue ID and not index. But I can confirm this issue is not a related to a "Not Found".
Author
Owner

@6543 commented on GitHub (May 9, 2020):

can confirm - I'm on it

@6543 commented on GitHub (May 9, 2020): can confirm - I'm on it
Author
Owner

@6543 commented on GitHub (May 9, 2020):

ok this is a simple bug: DeleteTime like to create a CommentTypeDeleteTimeManual but Repo of the trackedtime related issue is not loaded ... pull income

@6543 commented on GitHub (May 9, 2020): ok this is a simple bug: DeleteTime like to create a CommentTypeDeleteTimeManual but Repo of the trackedtime related issue is not loaded ... pull income
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5354