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

"No secret found" error for global secret #2084

Closed
5 tasks done
lonix1 opened this issue Aug 1, 2023 · 8 comments
Closed
5 tasks done

"No secret found" error for global secret #2084

lonix1 opened this issue Aug 1, 2023 · 8 comments
Labels
bug Something isn't working server

Comments

@lonix1
Copy link
Contributor

lonix1 commented Aug 1, 2023

Component

server

Describe the bug

When I provision my woodpecker server, I supply a gitea-access-token global secret via the API (https://woodpecker.example.com/api/secrets). If I go to the "settings" page then the "secrets" tab, I can see that global secret in the list.

That global secret is used whenever a pipeline runs a "push" step - which uses the docker buildx plugin to push an image to the gitea docker registry.

Even though that works, it logs an error (notice at the end it complains about gitea-access-token):

2023/08/01 14:17:28 [Recovery] 2023/08/01 - 14:17:28 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:260 (0x45455c)
/usr/local/go/src/runtime/signal_unix.go:837 (0x45452c)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/forge/gitea/gitea.go:492 (0xdfa9ae)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/api/hook.go:111 (0xd4c370)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:174 (0xdb6f4d)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/token/token.go:33 (0xdb6ad8)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:174 (0xd44821)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/session/user.go:69 (0xd44807)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:174 (0xd4691e)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/store.go:29 (0xd46905)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:174 (0xd46247)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/logger.go:23 (0xd4622a)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:174 (0xdb6939)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/header/header.go:38 (0xdb6864)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:174 (0xdb67c1)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/header/header.go:30 (0xdb67a6)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:174 (0xdbbfca)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/router.go:44 (0xdbbfb0)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:174 (0xafcc41)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/recovery.go:102 (0xafcc2c)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/context.go:174 (0xafba4a)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/gin.go:620 (0xafb6d1)
/woodpecker/src/github.com/woodpecker-ci/woodpecker/vendor/github.com/gin-gonic/gin/gin.go:576 (0xafb1fc)
/usr/local/go/src/net/http/server.go:2936 (0x7b2195)
/usr/local/go/src/net/http/server.go:1995 (0x7ad6b1)
/usr/local/go/src/runtime/asm_amd64.s:1598 (0x4748a0)

{"level":"error","error":"no secret found for \"gitea-access-token\"","time":"2023-08-01T14:17:28+01:00","message":"paramsToEnv"}

I don't understand this error because everything works. Really weird!

System Info

1.0.0
docker

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • 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]
  • Check that this is a concrete bug. For Q&A join our Discord Chat Server or the Matrix room.
@lonix1 lonix1 added the bug Something isn't working label Aug 1, 2023
@qwerty287 qwerty287 added this to the 1.0.1 milestone Aug 3, 2023
@6543 6543 modified the milestones: 1.0.1, 1.0.2 Aug 7, 2023
@qwerty287 qwerty287 modified the milestones: 1.0.2, v1.0.3, 1.0.3 Aug 8, 2023
@6543 6543 modified the milestones: 1.0.2, 1.0.3 Aug 16, 2023
@lonix1
Copy link
Contributor Author

lonix1 commented Sep 4, 2023

I don't know if it's related or a separate issue, but whenever I see this:

{"level":"error","error":"no secret found for \"gitea_access_token\"","time":"2023-09-04T15:20:07+03:00","message":"paramsToEnv"}

...it's also followed by many of these:

{"level":"error","error":"no secret found for \"gitea_access_token\"","time":"2023-09-04T15:20:07+03:00","message":"paramsToEnv"}
{"level":"error","error":"no secret found for \"gitea_access_token\"","time":"2023-09-04T15:20:07+03:00","message":"paramsToEnv"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"244","error":"stream: not found","time":"2023-09-04T15:22:52+03:00","message":"done: cannot close log stream for step 1803"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"244","error":"stream: not found","time":"2023-09-04T15:22:52+03:00","message":"done: cannot close log stream for step 1804"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"244","error":"stream: not found","time":"2023-09-04T15:22:52+03:00","message":"done: cannot close log stream for step 1805"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"244","error":"stream: not found","time":"2023-09-04T15:22:52+03:00","message":"done: cannot close log stream for step 1806"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"244","error":"stream: not found","time":"2023-09-04T15:22:52+03:00","message":"done: cannot close log stream for step 1815"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"244","error":"stream: not found","time":"2023-09-04T15:22:52+03:00","message":"done: cannot close log stream for step 1816"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"244","error":"stream: not found","time":"2023-09-04T15:22:52+03:00","message":"done: cannot close log stream for step 1817"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"244","error":"stream: not found","time":"2023-09-04T15:22:52+03:00","message":"done: cannot close log stream for step 1818"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"244","error":"stream: not found","time":"2023-09-04T15:22:52+03:00","message":"done: cannot close log stream for step 1819"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"244","error":"stream: not found","time":"2023-09-04T15:22:52+03:00","message":"done: cannot close log stream for step 1820"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"244","error":"stream: not found","time":"2023-09-04T15:22:52+03:00","message":"done: cannot close log stream for step 1821"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"244","error":"stream: not found","time":"2023-09-04T15:22:52+03:00","message":"done: cannot close log stream for step 1822"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"244","error":"stream: not found","time":"2023-09-04T15:22:52+03:00","message":"done: cannot close log stream for step 1823"}
{"level":"error","repo_id":"17","pipeline_id":"225","workflow_id":"245","error":"stream: not found","time":"2023-09-04T15:22:53+03:00","message":"done: cannot close log stream for step 1803"}

@qwerty287
Copy link
Contributor

@lonix1 that's another issue see #2036

@qwerty287
Copy link
Contributor

I just tried to reproduce this, but I can't. Everything's working fine for me using a global secret with a plugin and I don't get the message.

That it works even though the error is displayed is expected, as the error is logged but it does not do something else.
However, the secret shouldn't be accessible in the plugin.

@lonix1
Copy link
Contributor Author

lonix1 commented Sep 22, 2023

1.0.2 ?

@qwerty287
Copy link
Contributor

What do you mean? I tried on next

@lonix1
Copy link
Contributor Author

lonix1 commented Sep 23, 2023

Ok (I'm using stable only). I guess when the next version comes out this problem will disappearthen. Thank you for looking into it.

@qwerty287 qwerty287 modified the milestones: 1.0.3, 1.0.4 Oct 15, 2023
@qwerty287
Copy link
Contributor

qwerty287 commented Nov 3, 2023

Seems to be fixed already (in next). Please comment if not

@qwerty287 qwerty287 removed this from the 1.0.4 milestone Nov 3, 2023
@lonix1
Copy link
Contributor Author

lonix1 commented Nov 3, 2023

Thanks. When the next version is released, I'll try it out.

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

No branches or pull requests

3 participants