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

Agend Flow crash after client reboot #4916

Closed
timo1707 opened this issue Aug 24, 2023 · 1 comment · Fixed by #5772
Closed

Agend Flow crash after client reboot #4916

timo1707 opened this issue Aug 24, 2023 · 1 comment · Fixed by #5772
Assignees
Labels
bug Something isn't working frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.

Comments

@timo1707
Copy link
Contributor

What's wrong?

after rebooting windows 10 clients the grafana agent flow service wont start anymore

when deleting C:\ProgramData\Grafana Agent Flow\data\module.file.logs\loki.source.windowsevent.application the service can start again

Steps to reproduce

using below config on windows and reboot the client

System information

WIN10 x64

Software version

v0.34 & v0.35.4

Configuration

/********************************************
 * LOKI SCRAPE
 ********************************************/
loki.source.windowsevent "application"  {
    eventlog_name = "Application"
    forward_to = [loki.process.extract_labels.receiver]
}

/********************************************
 * LOKI REGEX LABELS
 ********************************************/
loki.process "extract_labels" {
  forward_to = [loki.relabel.hostname.receiver]
  stage.regex {
    expression = "\"event_id\":(?P<event_id>\\d+),\"level\":(?P<severity>\\d+)"
  }
  stage.labels {
    values = {
      "level"  = "severity",
      "event_id" = "event_id",
    }
  }
}

loki.relabel "hostname" {
  forward_to = [loki.write.default.receiver]

  rule {
    action       = "replace"
    target_label = "computer"
    replacement  = constants.hostname
  }
}

/********************************************
 * LOKI WRITE
 ********************************************/
loki.write "default" {
    endpoint {
        url ="https://redacted"
        tenant_id = "redacted"
    }
}

Logs

runtime error: index out of range [0] with length 0

goroutine 207 [running]:
github.com/grafana/loki/clients/pkg/promtail/targets/windows/win_eventlog.formatEventString(0x1, 0xc001a7bd10?, 0x200?)
	/go/pkg/mod/github.com/grafana/[email protected]/clients/pkg/promtail/targets/windows/win_eventlog/win_eventlog.go:532 +0x1db
github.com/grafana/loki/clients/pkg/promtail/targets/windows/win_eventlog.(*EventFetcher).renderEvent(_, 

level=error msg="service exited with error" err="exit status 2" exit_code=2
@rfratto
Copy link
Member

rfratto commented Aug 31, 2023

Thanks for reporting! Sounds like it got corrupted on reboot, and we need to find a way to handle that more gracefully.

@tpaschalis tpaschalis added this to the v0.37.0 milestone Sep 5, 2023
@tpaschalis tpaschalis modified the milestones: v0.37.0, v0.38.0 Oct 6, 2023
@mattdurham mattdurham moved this from Todo to In Progress in Grafana Agent (Public) Oct 17, 2023
@mattdurham mattdurham self-assigned this Oct 17, 2023
@rfratto rfratto removed the type/core label Nov 2, 2023
@rfratto rfratto removed this from the v0.38.0 milestone Nov 2, 2023
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
No open projects
Status: In Progress
4 participants