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

goaccess crashing when using --keep-db-files --load-from-disk #813

Closed
brian77777 opened this issue Jun 16, 2017 · 20 comments
Closed

goaccess crashing when using --keep-db-files --load-from-disk #813

brian77777 opened this issue Jun 16, 2017 · 20 comments

Comments

@brian77777
Copy link

brian77777 commented Jun 16, 2017

here is the error:

==10202== GoAccess 1.0.2 crashed by Sig 11
==10202==
==10202== VALUES AT CRASH POINT
==10202==
==10202== Line number: 1864853
==10202== Offset: 0
==10202== Invalid data: 1653
==10202== Piping: 0
==10202== Response size: 120276307679 bytes
==10202==
==10202== STACK TRACE:
==10202==
==10202== 0 goaccess(sigsegv_handler+0x188) [0x40b8b8]
==10202== 1 /lib64/libc.so.6(+0x35250) [0x7f662682d250]
==10202== 2 /lib64/libc.so.6(+0x14ac86) [0x7f6626942c86]
==10202== 3 /lib64/libtokyocabinet.so.9(+0x3fd94) [0x7f6626e00d94]
==10202== 4 /lib64/libtokyocabinet.so.9(tcbdbput+0x8f) [0x7f6626e0198f]
==10202== 5 /lib64/libtokyocabinet.so.9(tcadbput+0x1a9) [0x7f6626e22409]
==10202== 6 goaccess() [0x424d89]
==10202== 7 goaccess() [0x418325]
==10202== 8 goaccess(parse_log+0x129) [0x418aa9]
==10202== 9 goaccess(main+0x1fe) [0x40813e]
==10202== 10 /lib64/libc.so.6(__libc_start_main+0xf5) [0x7f6626819b35]
==10202== 11 goaccess() [0x4090cd]
==10202==
==10202== Please report it by opening an issue on GitHub:
==10202== https://github.com/allinurl/goaccess/issues

Here is how I am running goaccess:

goaccess -f /var/log/jigsaw/jigsaw.log -o /var/www/goaccess/report.html --real-time-html --ws-url=hostname.com --keep-db-files --load-from-disk

It works perfectly without: --keep-db-files --load-from-disk

Proof that Tokyo Cabinet is installed:

goaccess -s
Built using Tokyo Cabinet On-Disk B+ Tree.

Please let me know how I should tune the memory in the configuration file to make this work properly.

@allinurl
Copy link
Owner

Thank you for reporting this. I was trying to replicate this on my side without success so far, so I'm thinking it may be a log specific issue. Could you please provide a few more details on how to reproduce this? For instance:

  1. Are you still able to reproduce this?
  2. Was that the first time running goaccess or did you already run it before and were you only appending new data to an existing data set?
  3. Does this occur with a smaller log? e.g., tail -500000 /var/log/jigsaw/jigsaw.log > test.log
  4. What distro/version are you using? and how did you install tokyocabinet?

Thanks for any insights you might have!

@brian77777
Copy link
Author

brian77777 commented Jun 19, 2017 via email

@allinurl
Copy link
Owner

Yes, but only when using the options: --keep-db-files --load-from-disk

Great, would you be able to build from source and run the latest version (v1.2) and see if it still occurs in there?

I have not tried this. I will try to do this and see if it works. Is there any known issues with larger data sets?

There are no known issues with larger data sets. However, this appears to be the same issue as #696.

BTW, does it crash if you remove --real-time-html?, e.g.,

goaccess -f /var/log/jigsaw/jigsaw.log -o /var/www/goaccess/report.html --ws-url=hostname.com --keep-db-files --load-from-disk

@brian77777
Copy link
Author

brian77777 commented Jun 20, 2017 via email

@allinurl
Copy link
Owner

Let me run a some tests using v1.0.2 and then I may ask you to try it out with v1.2.

Removing the --real-time-html flag will only generate a static report. If you need to update the report, you will need to rerun goaccess which will overwrite the html file. So there shouldn't be any issues as long as you are okay with a static report, mainly just to be sure that this flag it's not causing the issue.

The on-disk storage it's pretty lightweight when it comes to memory usage. However, a few bugs have been fixed regarding memory consumption on the WebSocket server, so it could be that if it was actually running out of memory, the DB files got somehow corrupted leading to the crash. Does it crash for you with existing DB files?, or does it crash even after deleting the existing DB files and generating the report again from scratch?

As far as tweaking memory in the config file, it shouldn't be necessary, other than improving performance, but I'm curious, how big are your goaccess DB files?

@brian77777
Copy link
Author

brian77777 commented Jun 20, 2017 via email

@allinurl
Copy link
Owner

If I follow your question, yes, the time frame will continue to grow. — depending on your setup, if it's real-time it will automatically update as dates are added, otherwise the time frame will be reflected every time you rerun goaccess to generate the new report.

@brian77777
Copy link
Author

brian77777 commented Jun 20, 2017 via email

@brian77777
Copy link
Author

brian77777 commented Jun 21, 2017 via email

@brian77777
Copy link
Author

brian77777 commented Jun 21, 2017 via email

@brian77777
Copy link
Author

brian77777 commented Jun 21, 2017 via email

@allinurl
Copy link
Owner

Thanks for running that test on v1.2. I'm looking into it.

As far as which version to install, I'd certainly recommend the default hash tables. I've been running it for months on a high traffic server without issues. Just build as:

$ wget http://tar.goaccess.io/goaccess-1.2.tar.gz
$ tar -xzvf goaccess-1.2.tar.gz
$ cd goaccess-1.2/
$ ./configure --enable-utf8 --enable-geoip=legacy
$ make
# make install

@brian77777
Copy link
Author

brian77777 commented Jun 21, 2017 via email

@allinurl
Copy link
Owner

That works too plus you get the benefit of committing data to disk (less memory). If you choose not to use --enable-tcb=btree, then speed performance will be much better at the cost of using more ram.

I see. So that must be why I haven't been able to reproduce this since it looks like the database got corrupted and wiping all the files solved the issue. However, I'm still curious how it got corrupted... I'm suspicion about the --real-time-html flag combined with btree.

Please run it for some time and let me know if v1.2 somehow also corrupts the database or if it fixed the issue.

@brian77777
Copy link
Author

brian77777 commented Jun 21, 2017 via email

@brian77777
Copy link
Author

brian77777 commented Jun 21, 2017 via email

@allinurl
Copy link
Owner

Either Ctrl+c or SIGPIPE|SIGTERM will cleanly terminate it.

@brian77777
Copy link
Author

brian77777 commented Jun 21, 2017 via email

@allinurl
Copy link
Owner

Assuming you don't specify a signal, killing the process works fine since it will send a SIGTERM. No worries, let me know how it goes. Thanks.

@allinurl
Copy link
Owner

The on-disk storage issue has been addressed. It now supports native on-disk persistence storage (no dependencies). New command line options are --persist, --restore, --keep-last=<num_days>. It also adds the ability to re-parse the same log(s) without counting data twice (see #334 or for exact details this post).

This will be pushed out in the upcoming release. However, it would be great if you could test this out before deployment by building from development.

Closing this as fixed. Feel free to post back as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants