Sentry - runtime.boundsError: runtime error: index out of range [0] with length 0

Open Beginner friendly
#411 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go
Domain
api, backend

Research direction

Start by reproducing the request to /section/000000000000000000000000/course, then inspect api/controllers/section.go around sectionCourse at line 203 and SectionCourseById at line 168. Trace why the request reaches an empty value and verify that it no longer produces the reported runtime bounds error.

Written by the indexing model from the issue text.

Description

bug report good first issue L1

Sentry Issue: API-3J

runtime.boundsError: runtime error: index out of range [0] with length 0
  File "github.com/UTDNebula/nebula-api/api/controllers/section.go", line 203, in sectionCourse
  File "github.com/UTDNebula/nebula-api/api/controllers/section.go", line 168, in SectionCourseById
  File "github.com/gin-gonic/gin@v1.10.1/context.go", line 185, in (*Context).Next
  File "github.com/gin-gonic/gin@v1.10.1/context.go", line 185, in (*Context).Next
  File "github.com/UTDNebula/nebula-api/api/server.go", line 118, in LogRequest
...
(7 additional frame(s) were not displayed)

This is the HTTP Request that caused this issue

curl \
 -H "Connection: close" \
 -H "Host: 127.0.0.1:8080" \
 "http://127.0.0.1:8080/section/000000000000000000000000/course"
Dominant language
Go
Stars
39
Forks
94
Avg merge
10h 43m
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from UTDNebula/nebula-api

All issues in UTDNebula/nebula-api

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.