-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Increase log level when failing to create pipeline #4107
base: main
Are you sure you want to change the base?
Conversation
Increase verbosity of logs when failing to create pipelines. There are situations when woodpecker server may fail to create a pipeline and will only log the error under "debug", making it hard to debug the issue unless the user has explicitly activated debug logs. To reproduce this, set the server environment variable WOODPECKER_CONFIG_SERVICE_ENDPOINT to an invalid service, i.e. ``` WOODPECKER_CONFIG_SERVICE_ENDPOINT: "http://invalid/config" ``` And it will fail to create a pipeline, but no error logs will be displayed, only a debug log: ``` {"level":"debug","repo":"<redacted>","error":"failed to fetch config via http (0) Post \"http://ci-template-plugin/config\": dial tcp: lookup invalid on 198.18.0.1:53: no such host","time":"2024-09-13T14:06:02Z","caller":"/go/src/github.com/woodpecker-ci/woodpecker/server/pipeline/create.go:90","message":"error while fetching config '' in 'refs/heads/fernandrone-patch-1' with user: 'fernandrone'"} ```
I didn't open an issue given it's a trivial change. I couldn't find in past PRs if it was an explicit decision to leave logs as "debug" instead of "error" either. |
return nil, updatePipelineWithErr(ctx, _forge, _store, pipeline, repo, repoUser, fmt.Errorf("could not load config from forge: %w", err)) | ||
} | ||
|
||
pipelineItems, parseErr := parsePipeline(_forge, _store, pipeline, repoUser, repo, forgeYamlConfigs, nil) | ||
if pipeline_errors.HasBlockingErrors(parseErr) { | ||
log.Debug().Str("repo", repo.FullName).Err(parseErr).Msg("failed to parse yaml") | ||
log.Error().Str("repo", repo.FullName).Err(parseErr).Msg("failed to parse yaml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would not work well on public instance, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I follow. Something about the risk of someone flooding the logs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the risk of someone flooding the logs
Yes. While error on pulling config (whether config server / forge is misconfigured or network issues) is something admin copes with, pipeline syntax error is 'users' mistake.
HasBlockingErrors
It displays in UI, if I understand correctly. So, users see it and I as admin would probably not care (if would, then would set debug
).
I agree to @zc-devs and @fernandrone, you thumbed up the comment #4107 (comment), so I guess this can be closed? |
But I'm convinced in regards the first change.
Even message itself says, that it's error :) Edit 1 |
You're right, this case - the config is not found in the repo - is handled separately. These logs only trigger if something really went wrong |
I'll adjust the log level according to the comment so we can merge it.
Sorry for not getting back to this sooner but I've had a few hectic past
weeks. I'm away from my computer this weekend but should get this done next
week 👍🏻
…On Sun, Oct 6, 2024, 9:26 AM qwerty287 ***@***.***> wrote:
You're right, this case - the config is not found in the repo - is handled
separately. These logs only trigger if something really went wrong
—
Reply to this email directly, view it on GitHub
<#4107 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXO2TWRMGEI4M7FOSD55EDZ2EUADAVCNFSM6AAAAABOFPO6T2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJVGQZDCNBWGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Increase log level when failing to create pipelines. There are situations when woodpecker server may fail to create a pipeline and will only log the error under "debug", making it hard to debug the issue unless the user has explicitly activated debug logs.
To reproduce this, set the server environment variable WOODPECKER_CONFIG_SERVICE_ENDPOINT to an invalid service, i.e.
And it will fail to create a pipeline, but no error logs will be displayed, only a debug log: