Internal Server Error on endpoint ​/orgs​/{org}​/teams - List an organization's teams #7478

Closed
opened 2025-11-02 07:26:53 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @anders-larsson on GitHub (Jun 18, 2021).

Description

Using the List an organization's teams endpoint gives Internal Server Error and prints the error in the included Gist.

Screenshots

Originally created by @anders-larsson on GitHub (Jun 18, 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): 1.14.2 - Git version: Not applicable - Operating system: Official Gitea docker container <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes - https://gitea.com/api/v1/orgs/gitea/teams - [ ] No - Log gist: https://gist.github.com/anders-larsson/730d73cdc825061a3b5bfe3904cfdadb <!-- 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 <!-- If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services. --> Using the List an organization's teams endpoint gives Internal Server Error and prints the error in the included Gist. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/bugmodifies/api labels 2025-11-02 07:26:53 -06:00
Author
Owner

@anders-larsson commented on GitHub (Jun 18, 2021):

Just to add. On the private gitea instance token authentication was used when this error was thrown.

EDIT: Sorry. Just tried again it does indeed work. Maybe my token was lost for whatever reason when I got the error.

@anders-larsson commented on GitHub (Jun 18, 2021): Just to add. On the private gitea instance token authentication was used when this error was thrown. EDIT: Sorry. Just tried again it does indeed work. Maybe my token was lost for whatever reason when I got the error.
Author
Owner

@zeripath commented on GitHub (Jun 18, 2021):

OK looking at your gist it appears that the issue was that the ctx.User was nil. Which would fit with your token being incorrect.

I'll pop up a PR to prevent the NPE though.

@zeripath commented on GitHub (Jun 18, 2021): OK looking at your gist it appears that the issue was that the ctx.User was nil. Which would fit with your token being incorrect. I'll pop up a PR to prevent the NPE though.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7478