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

Adding Repository Fails #4782

Closed
3 tasks done
nyaaaaaaatalie opened this issue Jan 27, 2025 · 7 comments
Closed
3 tasks done

Adding Repository Fails #4782

nyaaaaaaatalie opened this issue Jan 27, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@nyaaaaaaatalie
Copy link

Component

server

Describe the bug

I am using the Docker container for Woodpecker connected to Forgejo. The Forgejo server uses an external OIDC IDP for authentication. When I add a repo, sometimes I will get the message "An unknown error has occured". In the Docker logs, I see the attached log messages and traceback. Interestingly. it seems that I can add projects that are under my user namespace; but not ones that are under an organization (despite me owning the org in Forgejo).

Steps to reproduce

  1. Start container with compose config:
  ci-srv:
    image: woodpeckerci/woodpecker-server:latest
    volumes:
      - ./data/ci-srv-data:/var/lib/woodpecker/
    environment:
      - WOODPECKER_OPEN=true
      - WOODPECKER_HOST=[redacted]
      - WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET}
      - WOODPECKER_FORGEJO=true
      - WOODPECKER_FORGEJO_URL=[redacted]
      - WOODPECKER_FORGEJO_CLIENT=${WOODPECKER_FORGEJO_CLIENT}
      - WOODPECKER_FORGEJO_SECRET=${WOODPECKER_FORGEJO_SECRET}
    networks:
      - http_proxy
      - git
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=traefik_http_proxy"
      - "traefik.http.routers.ci.rule=Host(`[redacted]`)"
      - "traefik.http.routers.ci.entrypoints=websecure"
      - "traefik.http.routers.ci.tls=true"
      - "traefik.http.routers.ci.tls.certresolver=letsencrypt"
      - "traefik.http.services.ci.loadbalancer.server.port=8000"

  1. Browse to Forgejo
  2. Log in via Forgejo (and thus via my IDP)
  3. Click Add Repository
  4. Click Enable on any repository that is not under my user namespace.

Expected behavior

When I click "Enable" on a repository I expect it to enable with success.

System Info

{"source":"https://github.com/woodpecker-ci/woodpecker","version":"2.8.3"}

Additional context

2025/01/26 22:54:56 [Recovery] 2025/01/26 - 22:54:56 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:261 (0x458ff7)
/usr/local/go/src/runtime/signal_unix.go:881 (0x458fc5)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/api/repo.go:149 (0xddd5dd)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xaeeb4a)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/session/user.go:118 (0xe44f86)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xe3d3e2)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/token/token.go:40 (0xe3d3d0)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xaeeb4a)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/session/user.go:73 (0xe4796e)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xaeeb4a)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/store.go:28 (0x1093dee)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xaeeb4a)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/logger.go:37 (0x1093ea5)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xe3d1b7)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/header/header.go:38 (0xe3d0e4)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xe3d038)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/header/header.go:30 (0xe3d026)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xe441e7)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/router.go:44 (0xe441d5)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xafbfd9)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/recovery.go:102 (0xafbfc7)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xafad71)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/gin.go:633 (0xafa7e0)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/gin.go:589 (0xafa311)
/usr/local/go/src/net/http/server.go:3142 (0x89d6ad)
/usr/local/go/src/net/http/server.go:2044 (0x898987)
/usr/local/go/src/runtime/asm_amd64.s:1695 (0x47b540)

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Checked that the bug isn't fixed in the next version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
@nyaaaaaaatalie nyaaaaaaatalie added the bug Something isn't working label Jan 27, 2025
@qwerty287
Copy link
Contributor

Can you check the logs for the lines before the stacktrace?

@rodschmic
Copy link

Hello, I'm facing the same issue like above but with Gitea.

Concerning your question @qwerty287 there is not much more before the error.
I enabled debugging:

woodpecker-server-1  | 2025/01/30 13:28:43 [Recovery] 2025/01/30 - 13:28:43 panic recovered:
woodpecker-server-1  | POST /api/repos?forge_remote_id=132 HTTP/1.1
[...bunch of headers]
woodpecker-server-1  |
woodpecker-server-1  | runtime error: invalid memory address or nil pointer dereference
woodpecker-server-1  | /usr/local/go/src/runtime/panic.go:261 (0x458ff7)
woodpecker-server-1  | /usr/local/go/src/runtime/signal_unix.go:881 (0x458fc5)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/server/api/repo.go:149 (0xddd5dd)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xaeeb4a)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/session/user.go:118 (0xe44f86)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xe3d3e2)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/token/token.go:40 (0xe3d3d0)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xaeeb4a)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/session/user.go:73 (0xe4796e)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xaeeb4a)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/store.go:28 (0x1093dee)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xaeeb4a)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/logger.go:37 (0x1093ea5)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xe3d1b7)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/header/header.go:38 (0xe3d0e4)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xe3d038)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/header/header.go:30 (0xe3d026)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xe441e7)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/router.go:44 (0xe441d5)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xafbfd9)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/recovery.go:102 (0xafbfc7)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:185 (0xafad71)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/gin.go:633 (0xafa7e0)
woodpecker-server-1  | /woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/gin.go:589 (0xafa311)
woodpecker-server-1  | /usr/local/go/src/net/http/server.go:3142 (0x89d6ad)
woodpecker-server-1  | /usr/local/go/src/net/http/server.go:2044 (0x898987)
woodpecker-server-1  | /usr/local/go/src/runtime/asm_amd64.s:1695 (0x47b540)

@rodschmic
Copy link

Using the v3-tag for the images solves this issue.

Why am getting the deprecated v2.8.3 with the latest tag anyway?

@qwerty287
Copy link
Contributor

qwerty287 commented Jan 30, 2025

I mean before the panic itself. Is there anything?

Is that a new org that never had a repo before or does it exist already?

Why am getting the deprecated v2.8.3 with the latest tag anyway?

What do you mean? 3.0.1 is the latest version.

@pat-s
Copy link
Contributor

pat-s commented Jan 30, 2025

#4600

@qwerty287
Copy link
Contributor

@nyaaaaaaatalie can you verify that this is fixed in 3.0.1?

@nyaaaaaaatalie
Copy link
Author

Can confirm. Good to close. Apologies on my part for not checking it was up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants