kiwix / kiwix-tools

Command line Kiwix tools: kiwix-serve, kiwix-manage, ...
https://download.kiwix.org/release/kiwix-tools/
GNU General Public License v3.0
433 stars 85 forks source link

kiwix-serve cant instantiate HTTP daemon on windows #701

Open rgaudin opened 1 week ago

rgaudin commented 1 week ago

Using https://tmp.kiwix.org/ci/dev_preview/zim-tools_windows/kiwix-tools_win-x86_64-2024-09-02.zip on Windows 11 (VM) I can't seem to start kiwix-serve.

Either as regular user or administrator, I always get the following error:

C:\Users\reg\test-tools>kiwix-serve.exe -p 8001 ..\python-libzim\rlz\test.zim
Unable to instantiate the HTTP daemon. The port 8001 is maybe already occupied or need more permissions to be open. Please try as root or with a port number higher or equal to 1024.
mgautierfr commented 1 week ago

This may be related to https://github.com/kiwix/kiwix-tools/pull/673 Can you test with kiwix-serve.exe -i ipv4 -p 8001 foo.zim ?

rgaudin commented 1 week ago

It works ; I got the same dialog btw.

Screenshot 2024-09-02 at 16 33 18
rgaudin commented 1 week ago

Should we update the error message then?

kelson42 commented 1 week ago

What happens exactly here which leads to this error? @sgourdas Any idea?

sgourdas commented 1 week ago

That is pretty strange.

From a quick look at the code, the only difference in flow that I can see, when no -i parameter is supplied, is the address variable being left unitialized. But regardless, without explicitly assigned it to "" it should still have that value.

Regardless, even though it should be automatically initialized as an empty string we could still assign it explicitly when the -i option is not provided, just to ensure consistency, or remove the other assignments that do the same.

I will try to test when as soon as I get time.

sgourdas commented 1 week ago

@kelson42 is there a way for me to build kiwix-serve for Windows?

rgaudin commented 1 week ago

@sgourdas ; you can using kiwix-build ; see the windows notes on the Wiki

kelson42 commented 4 days ago

@sgourdas I believe this bug might be just fixed by properly analysing the code.