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

Elastic Agent uses rename to move files, cannot move across filesystem boundaries #24213

Closed
pebrc opened this issue Feb 24, 2021 · 1 comment · Fixed by #27396
Closed

Elastic Agent uses rename to move files, cannot move across filesystem boundaries #24213

pebrc opened this issue Feb 24, 2021 · 1 comment · Fixed by #27396
Assignees
Labels
bug Team:Elastic-Agent Label for the Agent team v7.15.0

Comments

@pebrc
Copy link

pebrc commented Feb 24, 2021

In trying to work around #24160 we experimented with agent.download.install_path and agent.download.target_directory Specifically, running on Kubernetes, we tried to mount an emptyDir volume to use for both these locations as this would have allowed us to sidestep the noexec property of the main data path.

The problem with that approach seems that Agent uses a temporary directory in $path.home/data/tmp where it stages the programs to run to then move them to their final location (presumable with os.Rename ) which fails because source and target are not on the same filesystem

rename /var/lib/elastic-agent/data/tmp/elastic-agent-install414079180/metricbeat-7.11.1-linux-x86_64 /install/metricbeat-7.11.1-linux-x86_64: invalid cross-device link  

I think either this restriction needs to be documented/flagged up when mis-configured by the user or Elastic Agent should take the os.Open(src)/os.Create(tgt)/io.Copy(tgt, src)/os.Remove(src) approach instead of renaming.

@pebrc pebrc added the Team:Elastic-Agent Label for the Agent team label Feb 24, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Team:Elastic-Agent Label for the Agent team v7.15.0
Projects
None yet
6 participants