aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-07-06 23:30:19 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-07-06 23:30:19 -0700
commite4670b7513aa6057f4a02b58682dbd427b3de04e (patch)
tree7457c1c072b825cc40ce77e1a2339274754bb51a
parent4601531bf015c54dc4793173f93d6c09c90c7611 (diff)
downloadbun-e4670b7513aa6057f4a02b58682dbd427b3de04e.tar.gz
bun-e4670b7513aa6057f4a02b58682dbd427b3de04e.tar.zst
bun-e4670b7513aa6057f4a02b58682dbd427b3de04e.zip
Improve error message for outdated linux kernel
Diffstat (limited to '')
-rw-r--r--src/http_client_async.zig29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/http_client_async.zig b/src/http_client_async.zig
index f3fbd45cf..e3a23f0e4 100644
--- a/src/http_client_async.zig
+++ b/src/http_client_async.zig
@@ -42,7 +42,34 @@ pub fn onThreadStart(_: ?*anyopaque) ?*anyopaque {
default_allocator = default_arena.allocator();
NetworkThread.address_list_cached = NetworkThread.AddressListCache.init(default_allocator);
AsyncIO.global = AsyncIO.init(1024, 0) catch |err| {
- Output.prettyErrorln("<r><red>error<r>: Failed to initialize network thread: <red><b>{s}<r>.\nHTTP requests will not work. Please file an issue and run strace().", .{@errorName(err)});
+ log: {
+ if (comptime Environment.isLinux) {
+ if (err == error.SystemOutdated) {
+ Output.prettyErrorln(
+ \\<red>error<r>: Linux kernel version doesn't support io_uring, which Bun depends on.
+ \\
+ \\To fix this error: <b>please upgrade to a newer Linux kernel<r>.
+ \\
+ \\If you're using Windows Subsystem for Linux, here's how:
+ \\ 1. Open PowerShell as an administrator
+ \\ 2. Run this:
+ \\ <cyan>wsl --update<r>
+ \\ <cyan>wsl --shutdown<r>
+ \\
+ \\If that doesn't work (and you're on a Windows machine), try this:
+ \\ 1. Open Windows Update
+ \\ 2. Download any updates to Windows Subsystem for Linux
+ \\
+ \\If you're having trouble,
+ \\
+ , .{});
+ break :log;
+ }
+ }
+
+ Output.prettyErrorln("<r><red>error<r>: Failed to initialize network thread: <red><b>{s}<r>.\nHTTP requests will not work. Please file an issue and run strace().", .{@errorName(err)});
+ }
+
Output.flush();
os.exit(1);
};