Skip to content

[9.1] (backport #9322) Enhancement/5235 handle insufficient disk space errors in artifact unpack#9821

Merged
kaanyalti merged 1 commit into9.1from
mergify/bp/9.1/pr-9322
Sep 12, 2025
Merged

[9.1] (backport #9322) Enhancement/5235 handle insufficient disk space errors in artifact unpack#9821
kaanyalti merged 1 commit into9.1from
mergify/bp/9.1/pr-9322

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Sep 9, 2025

PR 2/6

  • Enhancement

What does this PR do?

Why is it important?

Non-wrapped errors mask the underlying disk space error when using errors.Is. This is need to address the original issue.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

If the agent runs into disk space errors when it is unpacking the downloaded agent archive, the status and fleet ui will show "insufficient disk space" as the error message

How to test this PR locally

  • Build for windows, mac, linux

  • Install agent (managed and standalone)

  • Fill up disk until there is approximately 500mb left

  • Trigger upgrade

    • From fleet
    • Cli with remote url and file
  • Validate the upgrade detail error message shows insufficient disk error message both in the status output and on fleet ui.

  • Run the upgrade, step_unpack tests

Related issues


This is an automatic backport of pull request #9322 done by [Mergify](https://mergify.com).

…pack (#9322)

* enhancement(5235): added stdlib wrappers in step_unpack

* enhancement(5235): wrap errors in step_unpack

* enhancement(5235): removed nolint:gosec comment from step_unpack

* enhancement(5235): refactored unpack step to abstract the unpack function from upgrader. abstracted unzip and untar to be able to test unpack function. updated unpack step tests to test for stdlib failures in unzip and untar and added tests for unpack

* enhancement(5235}: added unpackHandler interface to abstract the unpack function from upgrader

* enhancement(5235): added getPackageMetadata into unpackHandler interface for testability

* enhancement(5235): using unpacker.getPackageMetadata

* enhancement(5235): added abstractions in upgrader for testability

* enhancement(5235): removed unpack specific test from upgrade tests, added test cases in the upgrade error handling test

* enhancement(5235): using formatted test assertion api

(cherry picked from commit f70ff02)
@mergify mergify bot added the backport label Sep 9, 2025
@mergify mergify bot requested a review from a team as a code owner September 9, 2025 01:17
@mergify mergify bot requested review from michel-laterman and pchila and removed request for a team September 9, 2025 01:18
@github-actions github-actions bot added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team skip-changelog labels Sep 9, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@elastic-sonarqube
Copy link
Copy Markdown

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

cc @kaanyalti

@kaanyalti kaanyalti merged commit a3b211a into 9.1 Sep 12, 2025
21 checks passed
@kaanyalti kaanyalti deleted the mergify/bp/9.1/pr-9322 branch September 12, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants