After transition from python 2.7 to 3.7, flow-report(1) seems to have some issues... for example: # flow-cat ft-v05.2020-06-19.000001+0200 | flow-report Traceback (most recent call last): File "/usr/local/bin/flow-rptfmt", line 533, in <module> rpt.load(sys.stdin, opt_sort_field, opt_max_lines, opt_percent) File "/usr/local/bin/flow-rptfmt", line 297, in load splt = string.split(line2,',') AttributeError: module 'string' has no attribute 'split' flow-report: pclose(flow-rptfmt -f ascii): failed exit code=1. Another example: # flow-cat ft-v05.2020-06-19.000001+0200 | flow-report -v TYPE=ip-destination-address/ip-destination-port -v SORT=+octets -v OPTIONS=-header Traceback (most recent call last): File "/usr/local/bin/flow-rptfmt", line 533, in <module> rpt.load(sys.stdin, opt_sort_field, opt_max_lines, opt_percent) File "/usr/local/bin/flow-rptfmt", line 324, in load for i in string.split(line[8:],','): AttributeError: module 'string' has no attribute 'split' flow-report: pclose(flow-rptfmt -f ascii): failed exit code=1. As asked in bug #249388, comment #6, here is the content of /usr/local/etc/cfg/stat.cfg: stat-report default type @{TYPE:-summary-detail} output format ascii sort @{SORT:-+} fields @{FIELDS:-+} options @{OPTIONS:-+header,+xheader,+totals} path |flow-rptfmt @{RPTOPT:--f ascii} stat-definition default report default
Created attachment 219567 [details] patch-flow-log2rrd
Created attachment 219568 [details] patch-flow-rpt2rrd
Created attachment 219569 [details] patch-flow-rptfmt
I attached patches for this port, please try it out. Looking for port update.
Created attachment 219570 [details] Patch for the port maintainer (In reply to Volodymyr Pushkar from comment #4) Wonderful, thank you Vlad: I just tested them and they look like working for me! I merged them all in this patch for port's maintainer.
Build and package info is available at https://gitlab.com/swills/freebsd-ports/pipelines/221374697
Created attachment 221834 [details] Current patched port (In reply to Volodymyr Pushkar from comment #4) Sorry to disturb you again Vlad, but I just applied your patches to the latest port version on FreeBSD 12.2/amd64, and the issue raised again: # flow-cat ft-v05.2021-01-23.113001+0100 | flow-report -v OPTIONS=-header -v SORT=+octets -v TYPE=ip-source-address/ip-destination-port Traceback (most recent call last): File "/usr/local/bin/flow-rptfmt", line 533, in <module> rpt.load(sys.stdin, opt_sort_field, opt_max_lines, opt_percent) File "/usr/local/bin/flow-rptfmt", line 324, in load for i in string.split(line[8:],','): AttributeError: module 'string' has no attribute 'split' flow-report: pclose(flow-rptfmt -f ascii): failed exit code=1. Please find attached the patched files I'm using to build the package from.
(In reply to Andrew from comment #7) Just checked on my system (I use python 3.8 if this matters) and everything works fine with your patch: # ['/usr/local/bin/flow-rptfmt', '-f', 'ascii'] ip-source-address ip-destination-port flows octets packets duration 10.12.37.1 0 15 28182 197 750017 10.12.32.4 0 15 25324 198 769031 According to the error you are getting, it looks like your files are not patched. Please check for availability of the following files: #/usr/ports/net-mgmt/flow-tools>ls -la files/patch-flow-* | grep -v orig -rw-r--r-- 1 root wheel 264 24 янв. 09:26 files/patch-flow-log2rrd -rw-r--r-- 1 root wheel 2505 24 янв. 09:26 files/patch-flow-rpt2rrd -rw-r--r-- 1 root wheel 2034 24 янв. 09:26 files/patch-flow-rptfmt
(In reply to Volodymyr Pushkar from comment #8) I'm so sorry... I simply missed to apply files/patch-flow-rptfmt: it's still working (I'm using Python 3.7). Thank you Vlad! It would be also nice if someone with the commit bit might apply the patch to SVN/Git Ports tree, thus we'll be able to close this bug report.
Created attachment 222203 [details] Patch for the whole port #2 Added additional patches for lib/ftpaths.c, pkg-plist, and Makefile. Bumped PORTREVISION once again. Now flow-filter and flow-nfilter will look into /usr/local/etc/flow-tools instead of missing /usr/local/etc/sym or /usr/local/etc/cfg. Also files under /usr/local/etc/flow-tools covered by '@sample' in pkg-plist which gives us samples (.sample suffix) and prevents modified configs from overwriting.
Hi, Thanks for the patch. I am sorry that I have been AFK for a while due to travels and getting positive and stranded on a foreign soil. However I am back now and committing. Just to make sure that there are two patches now. Can anyone confirm please which one I should actually use? Moreover I am actually maintaining standalone flow-tools here at https://github.com/5u623l20/flow-tools/ to reduce patch clutters in the ports itself.
Hello, welcome back ;) The last added one includes all previous and also the new one.
A commit references this bug: Author: bofh Date: Sat Feb 13 12:37:53 UTC 2021 New revision: 565131 URL: https://svnweb.freebsd.org/changeset/ports/565131 Log: net-mgmt/flow-tools: Fix config path - Fix errors with python3.7 [1] PR: 251054 [1] , 252131 Submitted by: vladimir.pushkar@gmail.com [1] Reported by: may@vlant.ru , andrew.hotlab@hotmail.com [1] Changes: head/net-mgmt/flow-tools/Makefile head/net-mgmt/flow-tools/distinfo head/net-mgmt/flow-tools/files/patch-lib_ftxlate.c head/net-mgmt/flow-tools/files/patch-src_acl2.c head/net-mgmt/flow-tools/pkg-plist