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

error: InvalidVersion and exit when running on Fedora 41 #362

Open
joshbaptiste opened this issue Jan 17, 2025 · 14 comments
Open

error: InvalidVersion and exit when running on Fedora 41 #362

joshbaptiste opened this issue Jan 17, 2025 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@joshbaptiste
Copy link

Hello,

Trying out the latest binary release today and does not run at all on Fedora 41

josh@fedora ~/Downloads [1]> sha1sum lightpanda-x86_64-linux 
38980cef5905236c1e14f4d2eaac2bcbb68e6f10  lightpanda-x86_64-linux

josh@fedora ~/lDownloads> ./lightpanda-x86_64-linux 
error: InvalidVersion
josh@fedora ~/Downloads [1]> ./lightpanda-x86_64-linux --dump https://lightpanda.io
error: InvalidVersion

josh@fedora ~/Downloads> lsb_release -a
LSB Version:    n/a
Distributor ID: Fedora
Description:    Fedora Linux 41 (KDE Plasma)
Release:        41
Codename:       n/a

Strace ending snippet

rt_sigaction(SIGPIPE, {sa_handler=0x152b900, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f555e245090}, NULL, 8) = 0
unlinkat(AT_FDCWD, "/tmp/lightpanda", 0) = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0
bind(3, {sa_family=AF_UNIX, sun_path="/tmp/lightpanda"}, 110) = 0
listen(3, 1)                            = 0
getsockname(3, {sa_family=AF_UNIX, sun_path="/tmp/lightpanda"}, [110 => 18]) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f555e51c000
uname({sysname="Linux", nodename="fedora", ...}) = 0
close(3)                                = 0
write(2, "error: InvalidVersion\n", 22error: InvalidVersion
) = 22
exit_group(1)                           = ?
+++ exited with 1 +++
josh@fedora ~/Downloads [1]> strace -f ./lightpanda-x86_64-linux
@marcohuxam
Copy link

I have the same issue, I took the install link directly from the read me in my x86_64 docker container but I cannot run it because any command gives me "Invalid version".

@krichprollsch krichprollsch self-assigned this Jan 17, 2025
@krichprollsch krichprollsch added the bug Something isn't working label Jan 17, 2025
@MeshkatShB
Copy link

Dear all, I use Windows and wanted to run the project via WSL based on the README file but I get the same error:

./lightpanda-x86_64-linux --dump https://lightpanda.io
error: InvalidVersion
./lightpanda-x86_64-linux --host 127.0.0.1 --port 9333
error: InvalidVersion

P.S.
The ./lightpanda-x86_64-linux -h command worked fine as it showed the usage descriptions.

@krichprollsch
Copy link
Member

Hello here,
Thanks for the reports.
I can't reproduce in a fedora 41 docker container.
I'll try with a VM.

@MeshkatShB
Copy link

Hello here, Thanks for the reports. I can't reproduce in a fedora 41 docker container. I'll try with a VM.

Hi there.

To be clear, I used Ubuntu 22.04 LTS with WSL on Windows and got the exact same error.

@krichprollsch
Copy link
Member

Ok I was able to reproduce with a VM + Fedora41.

[fedora@ip-172-31-26-243 browser]$ zig build run
debug(cli): Server opts: listening internally on /tmp/lightpanda...
error: InvalidVersion
/home/fedora/zig-linux-x86_64-0.13.0/lib/std/SemanticVersion.zig:117:73: 0x1811ea5 in parse (lightpanda)
            for (id) |c| if (!std.ascii.isAlphanumeric(c) and c != '-') return error.InvalidVersion;
                                                                        ^
/home/fedora/browser/vendor/zig-js-runtime/vendor/tigerbeetle-io/io/linux.zig:28:25: 0x181533a in init (lightpanda)
        const version = try std.SemanticVersion.parse(release);
                        ^
/home/fedora/browser/vendor/zig-js-runtime/src/loop.zig:55:16: 0x181652b in init (lightpanda)
        io.* = try IO.init(32, 0);
               ^
/home/fedora/browser/src/main.zig:263:24: 0x183aafa in main (lightpanda)
            var loop = try jsruntime.Loop.init(alloc);
                       ^
run
└─ run lightpanda failure
error: the following command exited with error code 1:
/home/fedora/browser/.zig-cache/o/719a702fa0dd81f041d9ca288151f514/lightpanda 
Build Summary: 2/4 steps succeeded; 1 failed (disable with --summary none)
run transitive failure
└─ run lightpanda failure
error: the following build command failed with exit code 1:
/home/fedora/browser/.zig-cache/o/b4a33ce755d18c0851ea3820f21123c8/build /home/fedora/zig-linux-x86_64-0.13.0/zig /home/fedora/browser /home/fedora/browser/.zig-cache /home/fedora/.cache/zig --seed 0xd995ba9a -Z0d5e70409161dfc2 run

@krichprollsch
Copy link
Member

The check of the minimal linux for the loop version fails.
https://github.com/lightpanda-io/tigerbeetle-io/blob/main/io/linux.zig#L28-L31

The Zig's SemanticVersion seems unhappy with the kernel version format returned by Fedora.
https://github.com/ziglang/zig/blob/0.13.0/lib/std/SemanticVersion.zig#L116-L117

It appears Tigerbeetle changed the way they get the kernel version https://github.com/tigerbeetle/tigerbeetle/blob/main/src/stdx.zig#L479-L508
I think using the same way will fix the issue.

@joshbaptiste
Copy link
Author

The check of the minimal linux for the loop version fails. https://github.com/lightpanda-io/tigerbeetle-io/blob/main/io/linux.zig#L28-L31

The Zig's SemanticVersion seems unhappy with the kernel version format returned by Fedora. https://github.com/ziglang/zig/blob/0.13.0/lib/std/SemanticVersion.zig#L116-L117

It appears Tigerbeetle changed the way they get the kernel version https://github.com/tigerbeetle/tigerbeetle/blob/main/src/stdx.zig#L479-L508 I think using the same way will fix the issue.

Ah ok, on my machines with older kernels (< 6.12.9) binary works fine..
I have 2 machines that have fairly recent kernels Fedora (6.12.9) and Arch (6.12.10) and binary fails on both

Though now that I have updated to latest stable kernel (6.12.9) in Fedora 41 the error has changed..

josh@fedora ~ [1]> ./lightpanda-x86_64-linux
error(cli): Server listen error: error.Unexpected

josh@fedora ~ [1]> uname -a
Linux fedora 6.12.9-200.fc41.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan  9 16:05:40 UTC 2025 x86_64 GNU/Linux

@krichprollsch
Copy link
Member

krichprollsch commented Jan 22, 2025

I forced a nightly build against the last version.
Can you test with the new binary to check if the InvalidVersion is fixed please?

https://github.com/lightpanda-io/browser/releases/tag/nightly

@krichprollsch
Copy link
Member

krichprollsch commented Jan 22, 2025

@joshbaptiste the error.Unexpected is returned only once in the codebase.

My bad, error.Unexpected can be returned by the Zig's stdlib.

$ ag "error.Unexpected;" /usr/local/zig-0.13.0/lib/std/
/usr/local/zig-0.13.0/lib/std/Progress.zig
690:        return error.Unexpected;
694:        return error.Unexpected;
702:        return error.Unexpected;
711:            return error.Unexpected;
721:        return error.Unexpected;

/usr/local/zig-0.13.0/lib/std/posix.zig
630:    stream.readNoEof(buf) catch return error.Unexpected;
7322:    return error.Unexpected;

/usr/local/zig-0.13.0/lib/std/net.zig
881:                    if (!first) return error.Unexpected;

/usr/local/zig-0.13.0/lib/std/os/windows.zig
1200:            if (info.Name.MaximumLength == 0) break :blk error.Unexpected;
1283:            if (!mem.eql(u16, expected_prefix, final_path[0..expected_prefix.len])) return error.Unexpected;
1609:                    if (!first) return error.Unexpected;
2776:    return error.Unexpected;
2790:    return error.Unexpected;

/usr/local/zig-0.13.0/lib/std/c/darwin.zig
2838:    return error.Unexpected;

/usr/local/zig-0.13.0/lib/std/process.zig
1743:    if (amt != 50) return error.Unexpected;
1746:    if (!std.mem.eql(u8, label, "MemTotal:")) return error.Unexpected;
1747:    const int_text = it.next() orelse return error.Unexpected;
1748:    const units = it.next() orelse return error.Unexpected;
1749:    if (!std.mem.eql(u8, units, "kB")) return error.Unexpected;

But I think it's a different issue. If confirmed, I will close here to open a new one.

@krichprollsch
Copy link
Member

krichprollsch commented Jan 22, 2025

@joshbaptiste I upgraded to the last kernel on my debian too and I reproduce the issue.
So I created #373.

I'm closing this one b/c the InvalidVersion should be fixed now.
Feel free to re-open if the problem persists with the last version and/or create new issues if you a get different error.

@spidy0x0
Copy link
Contributor

┌─[user@parrot]─[~/Integuru]
└──╼ $./lightpanda-x86_64-linux --host 127.0.0.1 --port 9222
error: InvalidVersion

facing the same issue on parrotOS (debian 11)

└──╼ $wget https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux

i downloaded the nightly version

@krichprollsch krichprollsch reopened this Jan 28, 2025
@krichprollsch
Copy link
Member

Hello @spidy0x0,

Can you share the output of uname -a please?

@spidy0x0
Copy link
Contributor

Hello @spidy0x0,

Can you share the output of uname -a please?

└──╼ $uname -a
Linux parrot 6.11+parrot-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.11.5-1parrot1 (2024-12-13) x86_64 GNU/Linux

@krichprollsch
Copy link
Member

krichprollsch commented Jan 30, 2025

@spidy0x0 it looks like the patch version is missing from the kernel release 🤔
The program expects uname --kernel-release returns a X.Y.Z version followed by optional special chars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants