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

500 error when accessing /api/v1/orgs/PRIVATE_ORG while logged out #11286

Closed
2 of 7 tasks
sadaszewski opened this issue May 4, 2020 · 0 comments · Fixed by #11288
Closed
2 of 7 tasks

500 error when accessing /api/v1/orgs/PRIVATE_ORG while logged out #11286

sadaszewski opened this issue May 4, 2020 · 0 comments · Fixed by #11288
Labels
modifies/api This PR adds API routes or modifies them type/bug

Comments

@sadaszewski
Copy link

  • Gitea version (or commit ref): 1.11.4
  • Git version:
  • Operating system: FreeBSD
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I get the following error when accessing /api/v1/orgs/ORG_NAME directly from the browser address bar while logged out. The organization's visibility needs to be private in order to trigger this behavior.

2020/05/02 13:06:06 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `email_notifications_preference`, `passwd`, `passwd_hash_algo`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `repo_admin_change_team_access`, `diff_view_style`, `theme` FROM `user` WHERE `lower_name`=? AND `type`=? LIMIT 1 []interface {}{"admin_team", 1} - took: 149.211µs
2020/05/02 13:06:06 ...les/context/panic.go:35:1() [E] PANIC:: interface conversion: interface {} is nil, not string
        /usr/local/go/src/runtime/iface.go:255 (0x412895)
        /ports-head/www/gitea/work/gitea-1.11.4/modules/context/api.go:218 (0xf83f01)
        /ports-head/www/gitea/work/gitea-1.11.4/routers/api/v1/org/org.go:145 (0x1532a5a)
        /usr/local/go/src/reflect/value.go:460 (0x4978c5)
        /usr/local/go/src/reflect/value.go:321 (0x497083)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/inject/inject.go:177 (0x9ba989)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/inject/inject.go:137 (0x9ba339)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/context.go:121 (0x9eb508)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/context.go:112 (0xf8d9c1)
        /ports-head/www/gitea/work/gitea-1.11.4/modules/context/panic.go:39 (0xf8d9ad)
        /usr/local/go/src/reflect/value.go:460 (0x4978c5)
        /usr/local/go/src/reflect/value.go:321 (0x497083)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/inject/inject.go:177 (0x9ba989)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/inject/inject.go:137 (0x9ba339)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/context.go:121 (0x9eb508)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/context.go:112 (0xab9a55)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/session/session.go:192 (0xab9a40)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/context.go:79 (0x9eb3b0)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/inject/inject.go:157 (0x9ba699)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/inject/inject.go:135 (0x9ba428)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/context.go:121 (0x9eb508)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/context.go:112 (0x9fcae9)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/recovery.go:161 (0x9fcad7)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/logger.go:40 (0x9ef083)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/inject/inject.go:157 (0x9ba699)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/inject/inject.go:135 (0x9ba428)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/context.go:121 (0x9eb508)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/context.go:112 (0x9fbe20)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/logger.go:52 (0x9fbe0b)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/logger.go:40 (0x9ef083)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/inject/inject.go:157 (0x9ba699)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/inject/inject.go:135 (0x9ba428)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/context.go:121 (0x9eb508)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/router.go:187 (0x9fdd06)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/router.go:303 (0x9f76e5)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/gitea.com/macaron/macaron/macaron.go:218 (0x9f041a)
        /ports-head/www/gitea/work/gitea-1.11.4/vendor/github.com/gorilla/context/context.go:141 (0xd3e39d)
        /usr/local/go/src/net/http/server.go:2007 (0x75a763)
        /usr/local/go/src/net/http/server.go:2802 (0x75dbb3)
        /usr/local/go/src/net/http/server.go:1890 (0x759554)
        /usr/local/go/src/runtime/asm_amd64.s:1357 (0x4674b0)
@guillep2k guillep2k added modifies/api This PR adds API routes or modifies them type/bug labels May 4, 2020
@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
modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants