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

Internal server error: out of memory #492

Closed voillyied8122 closed 2 years ago

voillyied8122 commented 2 years ago

I setup kiwix server on my raspi 4b (4GB RAM with raspi os lite, version : May 7th,2021) and visit the pages on another pc. After I open some zim files and search something, the error occured: error.JPG

And I closed the page, opened it again to do something else, this one occured: error2.JPG

Could you please tell me what caused these errors and how to get rid of them? Did the word "memory" referred to my SD card or RAM? And what can I do to solve these problem? I would appreciate if someone here could answer me

Here are the free space of my raspi, not sure if this is useful or not. Just put it here since I'm not good at using linux. error3.JPG

mgautierfr commented 2 years ago

What is the kiwix-serve version ? What zim file are you trying to read ?

Maybe related to https://github.com/kiwix/libkiwix/issues/515

voillyied8122 commented 2 years ago

What is the kiwix-serve version ? What zim file are you trying to read ?

Maybe related to https://github.com/kiwix/libkiwix/issues/515

I use 3.1.2 for arm32 (download from kiwix.org) And the zim files I want to read are often wikipedia_en_all_maxi_2021-03.zim and wikisource_en_all_maxi_2021-03.zim, sometimes other files like TED, project Gutenberg...(look at the picture of my free space, most of the storage are use for save the zim files)

But my problem is a little different from the error in issue 515. In issue 515, the application just not responding after "search". On my raspi, I got a message of the error.

mgautierfr commented 2 years ago

But my problem is a little different from the error in issue 515. In issue 515, the application just not responding after "search". On my raspi, I got a message of the error.

Yes, but the "fix" for 515 is to correctly detect something is wrong. And if in this case, raise a 505 error. (See PR description of https://github.com/openzim/libzim/pull/568) The real fix (at least for 515) is made on how we generate the zim files, there is not a lot we can do on code side.

Can you confirm one file on your side which cause problem, we will check how it has been created.

voillyied8122 commented 2 years ago

Can you confirm one file on your side which cause problem, we will check how it has been created.

Both wikipedia_en_all_maxi_2021-03.zim and wikisource_en_all_maxi_2021-03.zim caused this error, when I opened one and then open another one to search something by select "containing..."

kelson42 commented 2 years ago

@voillyied8122 I don't know what to do more with this ticket. One thing which is incoherent is that one of your error reports a LZMA error and we don't use LZMA compression since september last year for wikipedia, wikisource!

voillyied8122 commented 2 years ago

@voillyied8122 I don't know what to do more with this ticket. One thing which is incoherent is that one of your error reports a LZMA error and we don't use LZMA compression since september last year for wikipedia, wikisource!

I'm sorry for my poor language usage since this is an unfamiliar topic for me. Please just tell me what's the meaning of "not enough memory"? Is that means "I don't have enough SD card storage space", or "I don't have enough RAM to run the application"? I'd appreciate if you could answer this question.

kelson42 commented 2 years ago

It is about RAM.

voillyied8122 commented 2 years ago

It is about RAM.

Is there a limitation of Zim file's number/size when using kiwix-serve? It's unbelievable when the official site said "it's compatible with all types of raspberry pi" but I just run out of RAM when reading only two Zim files.

kelson42 commented 2 years ago

This is not the normal behaviour and this should work. Considering past commnents, we will wait to the next version of the full Wikipedia EN version and ask you to test again.

voillyied8122 commented 2 years ago

This is not the normal behaviour and this should work. Considering past commnents, we will wait to the next version of the full Wikipedia EN version and ask you to test again.

Ok. Thanks for your reply.

arslan0tahir commented 2 years ago

should we wait for new zim file or newer version of kiwix will do the job??? OR IS THERE ANY WORKAROUND TO RESOLVE THIS ISSUE TEMPORARILY. same issue in kiwix nighly

zim: wikipedia_en_all_maxi_2021-03 kiwix: 3.1.2-5 OS: Win 10 x64

`===== Unhandled error : Allocation error : not enough memory ========== INTERNAL ERROR !! ============ Requesting : full_url : /wiki/A/Africa method : GET (0) version : HTTP/1.1 request# : 23 headers :

kelson42 commented 2 years ago

We will release 3.2.0 and see id it works better. I suspect the problem might be fixed as well with more recent zim files.

mgautierfr commented 2 years ago

should we wait for new zim file or newer version of kiwix will do the job??? OR IS THERE ANY WORKAROUND TO RESOLVE THIS ISSUE TEMPORARILY.

The last version of libzim have a small workaround to mitigate the bug but the problem is still present. Only new zim files will solve completely the issue.

kelson42 commented 2 years ago

@voillyied8122 We have released kiwix-serve 3.2.0-1. You can find it at https://download.kiwix.org/release/kiwix-tools/. This version should not suffer of the bug you have reported. If this is still the case please reopen the ticket.