Skip to content

Listing unadopted repositories via API returns an empty list #16341

Open
@lirazsh

Description

@lirazsh

Description:
I have a precreated bare repos inside ${work_dir}/git/repositories.
Listing unadopted files using the api endpoint (i.e. /api/v1/admin/unadopted) returns an empty list.
Listing unadopted files using the admin UI lists unadopted repositories successfully.
The issue is limited to listing - although unadopted repositories are not listed via the API, importing an unadopted repository (-x POST) does work.

  • Gitea version: 1.14.2 (running on docker)
  • Git version: 2.30.2
  • Platform: Docker version 20.10.7, build f0df350
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Trying using the API call:
2021/07/04 14:25:07 ...s/graceful/server.go:66:func1() [D] Starting server on tcp:0.0.0.0:3000 (PID: 16)
2021/07/04 14:25:33 Started GET /api/v1/admin/unadopted for 10.201.201.124:54394
2021/07/04 14:25:33 Completed GET /api/v1/admin/unadopted 200 OK in 15.038608ms

Trying from the Admin UI:
2021/07/04 14:25:50 Started GET /admin/repos/unadopted?search=true&q= for 10.201.201.124:54441
2021/07/04 14:25:50 ...s/context/context.go:675:1() [D] Session ID: 3222b4f3c9f89109
2021/07/04 14:25:50 ...s/context/context.go:676:1() [D] CSRF Token: zSASz6mLgjfhCVbn47gtO2Oh49s6MTYyNTQwMzY3ODkxNTc1NjU3NQ
2021/07/04 14:25:50 ...s/context/context.go:184:HTML() [D] Template: admin/repo/unadopted
2021/07/04 14:25:50 Completed GET /admin/repos/unadopted?search=true&q= 200 OK in 11.64094ms
2021/07/04 14:25:50 Started GET /avatar/4aa3cd67f7f1652bca043f473f39b96f?size=48 for 10.201.201.124:54441
2021/07/04 14:25:50 ...s/context/context.go:675:1() [D] Session ID: 3222b4f3c9f89109
2021/07/04 14:25:50 ...s/context/context.go:676:1() [D] CSRF Token: zSASz6mLgjfhCVbn47gtO2Oh49s6MTYyNTQwMzY3ODkxNTc1NjU3NQ
2021/07/04 14:25:50 Completed GET /avatar/4aa3cd67f7f1652bca043f473f39b96f?size=48 302 Found in 50.218973ms
2021/07/04 14:25:51 ...c/net/http/server.go:3139:logf() [I] http: TLS handshake error from 10.201.201.124:54443: EOF
2021/07/04 14:25:51 Started GET /user/events for 10.201.201.124:54441
2021/07/04 14:25:51 ...s/context/context.go:675:1() [D] Session ID: 3222b4f3c9f89109
2021/07/04 14:25:51 ...s/context/context.go:676:1() [D] CSRF Token: zSASz6mLgjfhCVbn47gtO2Oh49s6MTYyNTQwMzY3ODkxNTc1NjU3NQ
2021/07/04 14:25:51 Started GET /serviceworker.js for 10.201.201.124:54446
2021/07/04 14:25:51 ...les/public/public.go:165:handle() [I] [Static] Serving /serviceworker.js
2021/07/04 14:25:51 Completed GET /serviceworker.js 304 Not Modified in 399.665µs

Screenshots

GET from API
image

List in Admin UI
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    modifies/apiThis PR adds API routes or modifies themtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions