Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: avoid connection logging crashes in agent#20307

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
deansheather merged 3 commits intomainfromdean/connlog-fix-main
Oct 15, 2025

Conversation

@deansheather
Copy link
Member

For main

  • Ignore errors when reporting a connection from the server, just log them instead
  • Translate connection log IPlocalhost to127.0.0.1 on both the server and the agent

Note that the temporary fix for converting invalid IPs to localhost is not required in main since the database no longer forbids NULL for the IP column since#19788

Relates to#20194

// Do not fail the loop if we fail to report a connection, just
// log a warning.
// Related to https://github.com/coder/coder/issues/20194
logger.Warn(ctx,"failed to report connection to server",slog.Error(err))
Copy link
Member

Choose a reason for hiding this comment

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

what is the consequence for a failed report? I see one action isDisconnect, so do we have hanging connection in our reports?

This would fundamentally change that behavior, which is ok if we can document it. Or have some other kind of timeout/heartbeat to resolve the hanging "connection"

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see,Connection Logs is a new page to me. TIL

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

It's fine if connection logs get dropped. We document them as best effort

Comment on lines +823 to +828
// If the IP is "localhost" (which it can be in some cases), set it to
// 127.0.0.1 instead.
// Related to https://github.com/coder/coder/issues/20194
ifip=="localhost" {
ip="127.0.0.1"
}
Copy link
Member

Choose a reason for hiding this comment

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

Technicallylocalhost is not case sensitive. We should cover all bases and handle differentlocalhost casing

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I thought about this, but in the end these will just show up asNULL in the DB which I think is OK.localhost (or any variant) isn't very useful anyway

// If the IP is "localhost" (which it can be in some cases), set it to
// 127.0.0.1 instead.
// Related to https://github.com/coder/coder/issues/20194
ifip=="localhost" {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to handle this in both agent and coderd? I'd imagine just coderd would suffice but then again doesn't hurt either.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yeah it probably doesn't need to be fixed here, but I think it's fine. It'd be great to fix the localhost issue entirely cuz it does seem like it shouldn't be happening anyway (should probably be a tailnet IP?)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think tailnet IP would be more appropriate 👍🏻

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
@deansheatherdeansheather merged commit6c99d5e intomainOct 15, 2025
30 checks passed
@deansheatherdeansheather deleted the dean/connlog-fix-main branchOctober 15, 2025 14:56
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsOct 15, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@mafredrimafredrimafredri approved these changes

@EmyrkEmyrkEmyrk approved these changes

Assignees

@deansheatherdeansheather

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@deansheather@mafredri@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp