-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
issues after upgrade - lz4 compression stopped working #525
Comments
It looks like, you did not read my comments at phaag/nfsen#33 Between the two commits, there is no change which breaks any compression whatsoever. You can test this by yourself by compiling both commits and run a collector:
then run in another shell:
Finally temintate (cntrl-C) the collector and check the resulting file:
This works likewise for both commits:
Regarding the missing lz4.h in config.log. As I explained in phaag/nfsen#33
This is a test, if the local lz4 library is installed on the system. If so, it uses and links the system provided lz4 librray, I suspect, that you maybe have some local inconsistencies on your system or in NfSen not the latest version. The compression flags are controlled by NfSen, when starting up the collectors. However, your case is not an nfdump/nfcapd issue. |
I understood what you said, however this was not the case. After upgrading and figuring out that the issue was nfcapd was not compressing the files I went back at the config log and saw the lz4 lib not being included. Which I thought was odd since lz4 was just previously working on previous version and lz4 working fine when I tried it out. So thought hey maybe I tried reverting nfdump to earlier versions as noted, but each time I kept having the same issue. I start nfsen, see nfcapd store flows with lz4... then shortly afterwards the new files would be uncompressed.. so lz4 no longer used. I was trying to isolate what change and reverted to various versions, but each time the same outcome. I gave up and went back to I honestly have no clue if its some sort of forking/threading issue where settings get loss or what, why I shared the configs/service, and also if there was some lib linking issue which is why I shared the process I follow to do the upgrade. |
Again, check your NfSen installation and correct settings as well as using the latest github main branch. The ps output shows the running collectors and their arguments. It is not an nfdump/nfcapd issue. |
I shared what the ps output showed above, the command used then vs now is exactly the same (just different pid). Which i noted I see Looking back at logs around may 16th 1600 utc is when i stopped nfsen to upgrade nfdump something does stand out now that I'm digging through this.
I wonder if I can correlate that each time it did that it caused nfdump to stop using compression.. as you can see first run fine then 2nd+ exit.. which matches up with what I was seeing. and just like before currently, working fine:
Is there any recent changes to nfdump that would require updates to nfsen to make something play nice again? When I get some free time this week I'll try to replicate it and see if I can triage it better with your suggestions. |
moving issue from nfsen to here and cleaning up issue to focus on just the one problem here.
When upgrading from 9198d94 to latest (564f3a9) code, nfcapd stopped storing files in lz4 compression. Reverting back to 9198d94 and everything works as before.
upgraded nfdump from:
to
changes between git hashes:
https://github.com/phaag/nfdump/compare/9198d94..564f3a9
I upgraded nfdump at 2024-05-16 ~1600 UTC, and while appeared fine initially but per graphs there you can see it struggled up until a day later box ran out of hdd space..
At first I thought maybe stuff stopped expiring but then later discovered that after the upgrade nfcapd was no longer compressing the data to lz4 like before. Which caused it to use up the rest of the free space on the box until everything broke down.
Looking at one router as example..
before upgrade ~115M a file, then post upgrade 450M a file
so went from lz4 compressed
to not compressed
This box is running: Ubuntu 20.04.6 LTS
Have been using it to solely handle nfsen/nfdump as a netflow ingestion box.
The upgrade process:
I've done this process numerous times over the years without any issues, and for whatever reason this time you can see that in the config.log when I built out 564f3a9 that it failed to include lz4:
during this, you can see it failed check for lz4 but ended up with embedded support for lz4:
I looked back and saw that nothing really changed on the box just the normal security patches weeks ago but nothing recently since the last server boot as the box has been working fine upto this point and I see lz4 is still installed.
I thought maybe
liblz4-dev
needs to be installed now?Installed and tried rebuilding latest code again, and lz4 this time was built/included:
do see:
Then also to rule out any gremlins I rebooted the box.
On boot, nfsen started and I saw that some nfcapd files being saved were compressed with lz4.
looking at nfsen status, I do see it is
-z=lz4
is being passed to nfcapdI can confirm one of the uncompressed files can be compressed with nfdump just fine manually:
But files again are no longer was being compressed.
I did not see anything in logs to give me any clue why, so thinking it was just a code bug I tried reverting nfdump code to earlier versions (built+install) to try and isolate where it might have been included.
Tried:
Same issue, see lz4 being used at first:
Then checking an hour later, compression no longer being used:
Stopped and reverted nfdump to older commit:
Same issue, no compression..
Reverting back to the version I was running before all this started..
No everything using lz4 compression just fine, even hours/days later:
in case it helps, here are config/service info:
nfdump.conf
nfsen.conf
nfsen.service
cleaning up
To just document here to help others, due to amount of files (if doing layout 1) for the profile it meant that when you tried to do something like
nfdump -r live/ -J lz4
it would run and eventually stop once it hit x files (guessing argument list limit internally or something). So I just segment it to doing it per subfolder in the profile, and could also have it focus on a specific day with something like:During this command, various routers would toss a "appendix offset error" for "nfcapd.202405171645".
I had to delete this nfcapd file before the above command could actually handle any of the files afterwards.
So for me was easy to just delete anything smaller than 8k as we know that would be a 'bad' file:
Then just re-run command, and now since it wont get hung up on those files it should be able to convert all the files...
If you find that your files ownership changed, you can fixup by doing:
sudo chown <user>:<group> /data/nfsen/profiles-data/live -R
Now that all that is done, rebuild profile:
It makes me puzzled of what changes could cause compression to stop working, and oddly for it to work for a few files then stop.. when upgrading to newer code.
The text was updated successfully, but these errors were encountered: