Skip to content

fix(ext4): fail fast if mkfs.ext4 is too old for our feature set#2567

Closed
ValentaTomas wants to merge 1 commit into
mainfrom
fix/ext4-mkfs-version-check
Closed

fix(ext4): fail fast if mkfs.ext4 is too old for our feature set#2567
ValentaTomas wants to merge 1 commit into
mainfrom
fix/ext4-mkfs-version-check

Conversation

@ValentaTomas
Copy link
Copy Markdown
Member

Probe mkfs.ext4 -V once on first Make() and refuse to build a rootfs if the host's e2fsprogs is older than 1.43 (the first release that supports inline_data and packed_meta_blocks).

Addresses the build-break risk flagged on #2563: replaces an opaque mkfs failure with a clear, actionable error pointing at the host's e2fsprogs version. All currently-supported orchestrator hosts (Ubuntu 24.04 packer image ships 1.47.0) are well past the threshold, so this is a safety net rather than an active gate.

Probe `mkfs.ext4 -V` once on first Make() and refuse to build a rootfs
if the host's e2fsprogs is older than 1.43 (inline_data, packed_meta_blocks).
Replaces an opaque mkfs invocation failure with a clear, actionable error.
@cursor
Copy link
Copy Markdown

cursor Bot commented May 5, 2026

PR Summary

Medium Risk
Moderate risk because it introduces a new runtime gate in rootfs creation that can block builds if mkfs.ext4 -V output differs or version parsing fails. It also adds a dependency on sync.OnceValue availability in the project’s Go version.

Overview
This change can incorrectly fail rootfs builds if mkfs.ext4 -V output format doesn’t match the hardcoded mke2fs (\d+)\.(\d+) regex or if Atoi silently fails (errors are ignored), causing a false “too old” result. It also relies on sync.OnceValue, which will break compilation if the repo’s Go version doesn’t include it.

Reviewed by Cursor Bugbot for commit 410f3b8. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
2355 5 2350 5
View the full list of 5 ❄️ flaky test(s)
github.com/e2b-dev/infra/tests/integration/internal/tests/api/metrics::TestTeamMetrics

Flake rate in main: 55.56% (Passed 4 times, Failed 5 times)

Stack Traces | 3.29s run time
=== RUN   TestTeamMetrics
=== PAUSE TestTeamMetrics
=== CONT  TestTeamMetrics
    team_metrics_test.go:61: 
        	Error Trace:	.../api/metrics/team_metrics_test.go:61
        	Error:      	Should be true
        	Test:       	TestTeamMetrics
        	Messages:   	MaxConcurrentSandboxes should be >= 0
--- FAIL: TestTeamMetrics (3.29s)
github.com/e2b-dev/infra/tests/integration/internal/tests/api/sandboxes::TestUpdateNetworkConfig

Flake rate in main: 57.14% (Passed 6 times, Failed 8 times)

Stack Traces | 24.6s run time
=== RUN   TestUpdateNetworkConfig
=== PAUSE TestUpdateNetworkConfig
=== CONT  TestUpdateNetworkConfig
--- FAIL: TestUpdateNetworkConfig (24.59s)
github.com/e2b-dev/infra/tests/integration/internal/tests/api/sandboxes::TestUpdateNetworkConfig/pause_resume_preserves_allow_internet_access_false

Flake rate in main: 50.00% (Passed 6 times, Failed 6 times)

Stack Traces | 1.07s run time
=== RUN   TestUpdateNetworkConfig/pause_resume_preserves_allow_internet_access_false
Executing command curl in sandbox ij2n1b600tcpqtbc60wkt
    sandbox_network_update_test.go:372: Command [curl] output: event:{start:{pid:1365}}
    sandbox_network_update_test.go:372: Command [curl] output: event:{end:{exit_code:35 exited:true status:"exit status 35" error:"exit status 35"}}
Executing command curl in sandbox ij2n1b600tcpqtbc60wkt
    sandbox_network_update_test.go:372: Command [curl] output: event:{start:{pid:1366}}
    sandbox_network_update_test.go:372: Command [curl] output: event:{end:{exit_code:35 exited:true status:"exit status 35" error:"exit status 35"}}
    sandbox_network_update_test.go:391: Command [curl] output: event:{start:{pid:1367}}
    sandbox_network_update_test.go:391: Command [curl] output: event:{data:{stdout:"HTTP/2 302 \r\nx-content-type-options: nosniff\r\nlocation: https://dns.google/\r\ndate: Tue, 05 May 2026 01:41:21 GMT\r\ncontent-type: text/html; charset=UTF-8\r\nserver: HTTP server (unknown)\r\ncontent-length: 216\r\nx-xss-protection: 0\r\nx-frame-options: SAMEORIGIN\r\nalt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000\r\n\r\n"}}
    sandbox_network_update_test.go:391: Command [curl] output: event:{end:{exited:true status:"exit status 0"}}
    sandbox_network_update_test.go:391: Command [curl] completed successfully in sandbox ij2n1b600tcpqtbc60wkt
    sandbox_network_update_test.go:391: 
        	Error Trace:	.../api/sandboxes/sandbox_network_out_test.go:74
        	            				.../api/sandboxes/sandbox_network_update_test.go:60
        	            				.../api/sandboxes/sandbox_network_update_test.go:391
        	Error:      	An error is expected but got nil.
        	Test:       	TestUpdateNetworkConfig/pause_resume_preserves_allow_internet_access_false
        	Messages:   	https://8.8.8.8 should be blocked
--- FAIL: TestUpdateNetworkConfig/pause_resume_preserves_allow_internet_access_false (1.07s)
github.com/e2b-dev/infra/tests/integration/internal/tests/orchestrator::TestSandboxFilesystemPauseResumeIntegrity

Flake rate in main: 50.00% (Passed 1 times, Failed 1 times)

Stack Traces | 0s run time
=== RUN   TestSandboxFilesystemPauseResumeIntegrity
=== PAUSE TestSandboxFilesystemPauseResumeIntegrity
=== CONT  TestSandboxFilesystemPauseResumeIntegrity
--- FAIL: TestSandboxFilesystemPauseResumeIntegrity (0.00s)
github.com/e2b-dev/infra/tests/integration/internal/tests/orchestrator::TestSandboxFilesystemPauseResumeIntegrity/scattered_write_hash_survives_pause

Flake rate in main: 50.00% (Passed 1 times, Failed 1 times)

Stack Traces | 2.98s run time
=== RUN   TestSandboxFilesystemPauseResumeIntegrity/scattered_write_hash_survives_pause
=== PAUSE TestSandboxFilesystemPauseResumeIntegrity/scattered_write_hash_survives_pause
=== CONT  TestSandboxFilesystemPauseResumeIntegrity/scattered_write_hash_survives_pause
Executing command bash in sandbox i29uszolytf1ea9i5k1ox (user: root)
    filesystem_pause_resume_integrity_test.go:43: Command [bash] output: event:{start:{pid:1260}}
Executing command bash in sandbox ibdv9xwaz4u3zdmkg14pf (user: root)
    filesystem_pause_resume_integrity_test.go:43: Command [bash] output: event:{end:{exited:true status:"exit status 0"}}
    filesystem_pause_resume_integrity_test.go:43: Command [bash] completed successfully in sandbox iva1gmblgqgsr7v4k88bl
Executing command bash in sandbox i29uszolytf1ea9i5k1ox (user: root)
    filesystem_pause_resume_integrity_test.go:43: Command [bash] output: event:{start:{pid:1265}}
    filesystem_pause_resume_integrity_test.go:43: Command [bash] output: event:{data:{stdout:"68733113af49d9f3d9c4f7360642109bb8ffd6ffbcaf1bc79b4ad27f6a0eb629\n"}}
    filesystem_pause_resume_integrity_test.go:43: Command [bash] output: event:{end:{exited:true status:"exit status 0"}}
    filesystem_pause_resume_integrity_test.go:43: Command [bash] completed successfully in sandbox iva1gmblgqgsr7v4k88bl
Executing command bash in sandbox iva1gmblgqgsr7v4k88bl (user: root)
    filesystem_pause_resume_integrity_test.go:43: Command [bash] output: event:{start:{pid:1271}}
    filesystem_pause_resume_integrity_test.go:43: 
        	Error Trace:	.../tests/orchestrator/filesystem_pause_resume_integrity_test.go:114
        	            				.../tests/orchestrator/filesystem_pause_resume_integrity_test.go:133
        	            				.../tests/orchestrator/filesystem_pause_resume_integrity_test.go:43
        	Error:      	Received unexpected error:
        	            	failed to execute command bash in sandbox iva1gmblgqgsr7v4k88bl: invalid_argument: protocol error: incomplete envelope: unexpected EOF
        	Test:       	TestSandboxFilesystemPauseResumeIntegrity/scattered_write_hash_survives_pause
--- FAIL: TestSandboxFilesystemPauseResumeIntegrity/scattered_write_hash_survives_pause (2.98s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a version check for the host's mkfs.ext4 utility to ensure it supports the inline_data and packed_meta_blocks features. I have no feedback to provide.

@ValentaTomas ValentaTomas deleted the fix/ext4-mkfs-version-check branch May 6, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants