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

Improve error messages in garm log #314

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

maigl
Copy link
Contributor

@maigl maigl commented Nov 22, 2024

finding errors in logs is very important and there are some logs that are errors but seem to be rather normal:

  • workflow events without labels -> this happens very often (at least in our GHE instance), this might be a bug in github code .. but garm probably has to accept this and don't consider this an error
  • workflows that have runner_names which are not our runners. This always happens in a scenario where our garm runners are not the only runner setup (and we still get the workflow_job events, e.g. enterprise wide hooks)

@maigl maigl marked this pull request as ready for review November 22, 2024 10:50
Copy link
Member

@gabriel-samfira gabriel-samfira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I should have added more context to those messages.

database/sql/jobs.go Outdated Show resolved Hide resolved
@@ -244,7 +246,8 @@ func (s *sqlDatabase) CreateOrUpdateJob(ctx context.Context, job params.Job) (pa
if err == nil {
workflowJob.InstanceID = &instance.ID
} else {
slog.With(slog.Any("error", err)).ErrorContext(ctx, "failed to get instance by name")
// This usually is very normal as not all jobs run on our runners.
slog.DebugContext(ctx, fmt.Sprintf("failed to get instance by name: %s", job.RunnerName))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above. The level change to DebugContext is fine.

@gabriel-samfira
Copy link
Member

I think we need to bump golangci-lint to >= 1.60.1. Details here: golangci/golangci-lint#4662 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants