Skip to content

[Elastic-Agent] Work around unix socket path length limit #18118

@michalpristas

Description

@michalpristas

Elastic agent uses unix sockets or windows named pipes to create a communication layer between agent and a process it manages.

What is unfortunate is a length limit operating systems put on path lengths:

  • Windows: 256 characters link
  • Unix: 108 chars link
  • Mac and BSD: 104

Construction of this path in agent consist of few variables which makes it easy to overflow this limit.
we create unix socket inside data path (where agent lives + data, or provided by user)
we post fix this by output name and program name which are also not limited in length.

Previously we had unix socket created in /var/run which resulted in shorter paths but a need for root privileges.

The problem is we do not know there is a problem until beat crashes with unknown error. Not until we search beats logs which are not helpful as well because golangs default answer for this is bind: invalid argument golang issue

For this reason this should be part of health checks (#17737) which will become part of beats so we know that something failed and ideally what failed.

We were thinking together with @ph about the right strategy but we could not find the right solution here which allows us to stay outside of paths which requires us to run elevated and not putting some funny length limits to data path (where agent lives), output name and program name.

Metadata

Metadata

Assignees

Labels

Ingest Management:beta1Group issues for ingest management beta1bugdiscussIssue needs further discussion.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions