Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DELETE time tracking fail with 500 error #11313

Closed
2 of 7 tasks
camdarley opened this issue May 6, 2020 · 7 comments · Fixed by #11349
Closed
2 of 7 tasks

DELETE time tracking fail with 500 error #11313

camdarley opened this issue May 6, 2020 · 7 comments · Fixed by #11349
Labels

Comments

@camdarley
Copy link

camdarley commented 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

@zeripath
Copy link
Contributor

zeripath commented May 6, 2020

@6543 have we already fixed this in 1.12?

@6543
Copy link
Member

6543 commented May 7, 2020

I'll have a look at it asap

@6543
Copy link
Member

6543 commented May 7, 2020

While looking at the code I noticed this: #11319

@6543
Copy link
Member

6543 commented May 7, 2020

but didn't looked at the delete jet

@camdarley
Copy link
Author

@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".

@lunny lunny added the type/bug label May 8, 2020
@6543
Copy link
Member

6543 commented May 9, 2020

can confirm - I'm on it

@6543
Copy link
Member

6543 commented 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 added a commit to 6543-forks/gitea that referenced this issue May 9, 2020
guillep2k pushed a commit that referenced this issue May 9, 2020
* Fix nil exeption: #11313

* fix 500

* activate test 😆

* move logic
guillep2k pushed a commit to guillep2k/gitea that referenced this issue May 9, 2020
* Fix nil exeption: go-gitea#11313

* fix 500

* activate test 😆

* move logic
zeripath pushed a commit that referenced this issue May 9, 2020
Backport #11349 

* Fix tracked time issues (#11349)

* Fix nil exeption: #11313

* fix 500

* activate test 😆

* move logic

* Add missing import

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
ydelafollye pushed a commit to ydelafollye/gitea that referenced this issue Jul 31, 2020
* Fix nil exeption: go-gitea#11313

* fix 500

* activate test 😆

* move logic
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants