ntop / ntopng

Web-based Traffic and Security Network Traffic Monitoring
http://www.ntop.org
GNU General Public License v3.0
6.05k stars 640 forks source link

Compile 5.4 stable with nDPI 4.4 Stable (or greater) #7029

Closed christinaMentat closed 1 year ago

christinaMentat commented 1 year ago

Environment:

What happened: compiled nDPI 4.4 per instructions compiled ntopng 5.4 per instructions

After changing password on sign-in via the web UI this is in the UI and the logs: 09/Dec/2022 12:11:04 [LuaEngine.cpp:1254] WARNING: Script failure [/opt/ntopng5.4/ntopng/scripts/lua/index.lua][/opt/ntopng5.4/ntopng/scripts/lua/inc/menu.lua:309: field 'getFlowDevices' is not callable (a nil value)]

How did you reproduce it? I was able to replicate on three other identical systems (Dell PowerEdge R-340 server) with the latest nDPI as well. Trying to stay on stable ntopng if at all possible.

I did try setting --community in the /etc/ntopng/ntopng.conf file - but that did not work. Debug Information:

Paste debug information below:

ntopng-5 4-error

RobertTheProfessional commented 1 year ago

Had the same issue. Had to build with the dev branch of nDPI and the following commit hash c10ae0c105a4fd6983d58dcef638f2612b7b1993 of ntopng in order to sucessfully get past that issue with my Dream Machine Pro

Here's an example Dockerfile denoting the steps I took. Note while I can start up ntopng, this Dockerfile isn't indicative of a production environment. ntopng-udm Dockerfile

lucaderi commented 1 year ago

I believe you did something wrong. If you go to https://github.com/ntop/ntopng/blob/5.4-stable/src/LuaEngineInterface.cpp#L4661 you will see that getFlowDevices() is callable. I am sorry but you need to help yourself and debug on your system

lucaderi commented 1 year ago

As of https://github.com/ntop/ntopng/issues/7029#issuecomment-1344896075 please open a ticket and report the exact problem you have

TheLinuxGuy commented 1 year ago

I also came across this error after pulling the latest ntopng build I usually use on my nanopi arm devices: https://hub.docker.com/layers/dlk3/ntopng-udm/latest/images/sha256-b943d67a1beb37446caf5b406f4281b408c417285e3982a13e49c713f6594f93?context=explore

HTTP/1.1 302 Found Server: ntopng 5.5.221206 (aarch64) Set-Cookie: session=b806a8975b5a264b3f95b50a2cc09f79; path=/; HttpOnly; SameSite=lax; Secure Location: /lua/http_status_code.lua?message=internal_error&referer=192.168.100.1%3A3001%2F&error_message=%2Fusr%2Fshare%2Fntopng%2Fscripts%2Flua%2Finc%2Fmenu.lua%3A308%3A%20field%20%27getFlowDevices%27%20is%20not%20callable%20%28a%20nil%20value%29 /usr/share/ntopng/scripts/lua/inc/menu.lua:308: field 'getFlowDevices' is not callable (a nil value)

Going to try another image dlk3/ntopng-udm:5.5.221122

docker run --net=host --privileged --restart always --name ntopng -v /docker/ntopng/GeoIP.conf:/etc/GeoIP.conf -v /docker/ntopng/ntopng.conf:/etc/ntopng/ntopng.conf -v /docker/ntopng/redis.conf:/etc/redis/redis.conf -v /docker/ntopng/lib:/var/lib/ntopng -v /docker/ntopng/redis:/var/lib/redis dlk3/ntopng-udm:5.5.221122

The above image worked wonderfully - my sense is that something upstream did break. I am not the maintainer of the docker image I use for my openwrt device but it has worked very stable and as far as I know the maintainer of the docker container simply runs some commands to build the special arm64 flavor then make it available in docker registry.

RobertTheProfessional commented 1 year ago

Thanks to you @lucaderi and team. ntopng is a thrill to play with.

From the code you referenced, it appears I'm having issues with the getFlowDevices call since my builder does not define the NTOPNG_PRO for the conditional compiler.

Can I define NTOPNG_PRO during my build and still use the --community flag at runtime without any issue?

christinaMentat commented 1 year ago

I believe you did something wrong. If you go to https://github.com/ntop/ntopng/blob/5.4-stable/src/LuaEngineInterface.cpp#L4661 you will see that getFlowDevices() is callable. I am sorry but you need to help yourself and debug on your system

Luca, I reviewed my steps on the 4 systems used for testing. I cleaned them. I reviewed the two 5.4 debian package versions I built and then reviewed the commit history for nDPI and ntopng. I ended up doing this:

(basically matching the two 5.4 stable package versions that have not been updated since August 2022 - which matches the nDPI commit hash and the ntopng commit hash from August 2022)

and I am able to get the UI working. All other steps are per the ntopng-compilation document. I even tried building ntopng without using the specific commit hash on the 4th system - that failed as before. Not re-opening this.

This is probably something specific to our Debian 10 installs for the software my company develops leveraging OpenVPN - so maybe another package is interfering.

FYI - I love ntopng and the work you and your team have done is absolutely amazing. Been using the new versions since 2017.