Bug 13163 - pmacct v1.7.8: no such column: vlan_in [CU 175]
Summary: pmacct v1.7.8: no such column: vlan_in [CU 175]
Status: CLOSED FIXED
Alias: None
Product: IPFire
Classification: Unclassified
Component: --- (show other bugs)
Version: 2
Hardware: unspecified Unspecified
: Will only affect a few users Major Usability
Assignee: Adolf Belka
QA Contact: iptom
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-26 18:17 UTC by Jon
Modified: 2023-08-07 11:21 UTC (History)
3 users (show)

See Also:


Attachments
Patch file for the pmacct commit 5a5e272 (14.41 KB, patch)
2023-07-05 12:33 UTC, Adolf Belka
Details
.ipfire package for updated pmacct (500.00 KB, application/x-tar)
2023-07-08 16:09 UTC, Adolf Belka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jon 2023-06-26 18:17:34 UTC
I see these errors in the message log.  This causes pmacct to stop sending data to the sqlite database.

```
Jun 13 22:45:01 ipfire pmacctd[4485]: INFO ( plugin3/sqlite3 ): *** Purging cache - START (PID: 4485) *** 
Jun 13 22:45:01 ipfire pmacctd[4485]: ERROR ( plugin3/sqlite3 ): no such column: vlan_in  
Jun 13 22:45:02 ipfire last message repeated 327 times
Jun 13 22:45:02 ipfire pmacctd[4485]: INFO ( plugin3/sqlite3 ): *** Purging cache - END (PID: 4485, QN: 0/328, ET: 1) *** 
```

this is using this version of pmacct:
```
[**root@ipfire** ~] # pmacct -V
pmacct IMT plugin client, pmacct 1.7.8-git (RELEASE)
```

found on:
apu4d4
IPFire 2.27 (x86_64) - Core-Update 175

after upgrading from cu174 to cu175









See:
https://community.ipfire.org/t/pmacct-unknown-key-interface/9947/14?u=jon
Comment 1 Jon 2023-06-26 18:24:42 UTC
I entered a bug report with pmacct.

https://github.com/pmacct/pmacct/issues/696

and it looks similar to this existing bug report:
https://github.com/pmacct/pmacct/issues/695

@iptom did this helpful test:
https://community.ipfire.org/t/pmacct-unknown-key-interface/9947/35?u=jon
Comment 2 Jon 2023-07-05 00:03:35 UTC
from pmacct:

> hi Jon, this was a bug should now be resolved with the latest commit. 
> If you get a chance, let me know if this works for you. Paolo

See:
https://github.com/pmacct/pmacct/issues/696#issuecomment-1620718377
-and-
https://github.com/pmacct/pmacct/commit/5a5e2722206dd75e4429b51f0d6311ae4cfc52ec
Comment 3 Adolf Belka 2023-07-05 12:33:43 UTC
Created attachment 1207 [details]
Patch file for the pmacct commit 5a5e272

This is the patch file created from the commit by pmacct to fix this bug. This will need to be applied to the pmacct package in the LFS file.

The LFS file for ntp gives an example of how to do this.
Comment 4 Jon 2023-07-05 23:17:19 UTC
from Paolo at pmacct:

> Yes, this will be part of 1.7.9. There is no committed date yet
> for its release but for sure it will be by the end of the year,
> with code freeze & version bump already taking place in a couple
> of months. This said, please start having a test to current code
> so to see all is working good for you. Keep me posted. Paolo

https://github.com/pmacct/pmacct/issues/696#issuecomment-1622634748

Thank you for creating the patch!  I'll test in the next two days.
Comment 5 Adolf Belka 2023-07-08 16:07:13 UTC
I tried the build with the patch file I got from the pmacct github but of course it didn't work properly.

Two files patched exactly as they should.

7 files patched but with offsets varying from 4 to 30 lines.

1 file failed to patch because the file was very different to the file in the current status and the patch is being applied to the source tarball from Dec 2022 whereas the patch file has been created on the basis of the source tarball that would be in place now if the files were packaged.

I adjusted the patch to update all the files and then ran the build.

The build failed. Several of the patches are referring to a variable_3 where variable can be a few different names.

The problem is that in the 2.7.8 tarball the only ones known about are variable_1 and variable_2.

This is again because the patch set has been done on the basis of the pmacct package as it is now and there have been many changes since Dec 2022.

Unfortunately this variable_3 can not be fixed easily in the patch set.

What I have done is downloaded an archive file from the pmacct github that is the status of the package at the stage of the bug fix with commit 5a5e272

This is provided as a zip file so I extracted the contents and archived into a tar.gz file.

I then built with this version and the build has been successful.

I will attach the pmacct ipfire package file which will need to be tested out to see if it is solving the problem reported in this bug.

If it solves the problem then I will submit the update patch.
Comment 6 Adolf Belka 2023-07-08 16:09:01 UTC
Created attachment 1208 [details]
.ipfire package for updated pmacct

This is the .ipfire package file with the pmacct bug fixes included in it.

This needs to be manually installed to test if it resolves the problems from this bug report.
Comment 7 Jon 2023-07-11 20:23:45 UTC
I get an error at the end of the install.

Error:
/usr/sbin/pmacctd: error while loading shared libraries: libcdada.so.0: cannot open shared object file: No such file or directory       [ FAIL ]

Here is the terminal log:
```
[root@ipfireAPU tmp] # NAME=pmacct ./install.sh
Extracting files...
etc/
etc/rc.d/
etc/rc.d/init.d/
etc/rc.d/init.d/pmacct
etc/pmacct/
etc/pmacct/pmacct.conf
usr/
usr/share/
usr/share/pmacct/
usr/share/pmacct/sql/
usr/share/pmacct/sql/pmacct-create-table_v9.sqlite3
usr/share/pmacct/sql/pmacct-create-table_v8.sqlite3
usr/share/pmacct/sql/pmacct-create-table_v7.sqlite3
usr/share/pmacct/sql/pmacct-create-table_v6.sqlite3
usr/share/pmacct/sql/pmacct-create-table_v5.sqlite3
usr/share/pmacct/sql/pmacct-create-table_v4.sqlite3
usr/share/pmacct/sql/pmacct-create-table_v3.sqlite3
usr/share/pmacct/sql/pmacct-create-table_v2.sqlite3
usr/share/pmacct/sql/pmacct-create-table_v1.sqlite3
usr/share/pmacct/sql/pmacct-create-table_bgp_v1.sqlite3
usr/share/pmacct/sql/README.sqlite3
usr/share/pmacct/examples/
usr/share/pmacct/examples/tee_receivers.lst.example
usr/share/pmacct/examples/sampling.map.example
usr/share/pmacct/examples/probe_sflow.conf.example
usr/share/pmacct/examples/probe_netflow.conf.example
usr/share/pmacct/examples/primitives.lst.example
usr/share/pmacct/examples/pretag.map.example
usr/share/pmacct/examples/ports.lst.example
usr/share/pmacct/examples/pmacctd-sqlite3.conf.example
usr/share/pmacct/examples/pmacctd-sql.conf.example
usr/share/pmacct/examples/pmacctd-multiple-plugins.conf.example
usr/share/pmacct/examples/pmacctd-imt.conf.example
usr/share/pmacct/examples/peers.map.example
usr/share/pmacct/examples/pcap_interfaces.map.example
usr/share/pmacct/examples/nfacctd-sql.conf.example
usr/share/pmacct/examples/networks.lst.example
usr/share/pmacct/examples/lg/
usr/share/pmacct/examples/lg/pmbgp.py
usr/share/pmacct/examples/kafka/
usr/share/pmacct/examples/kafka/kafka_consumer.py
usr/share/pmacct/examples/flow_to_rd.map.example
usr/share/pmacct/examples/bgp_xconnects.map.example
usr/share/pmacct/examples/bgp_md5.lst.example
usr/share/pmacct/examples/bgp_agent.map.example
usr/share/pmacct/examples/avro/
usr/share/pmacct/examples/avro/avro_file_decoder.py
usr/share/pmacct/examples/amqp/
usr/share/pmacct/examples/amqp/amqp_receiver.py
usr/share/pmacct/examples/allow.lst.example
usr/sbin/
usr/sbin/pmacctd
usr/bin/
usr/bin/pmacct
var/
var/spool/
var/spool/pmacct/
var/ipfire/
var/ipfire/backup/
var/ipfire/backup/addons/
var/ipfire/backup/addons/includes/
var/ipfire/backup/addons/includes/pmacct
...Finished.
Restoring Backup...
etc/pmacct/
etc/pmacct/pmacct.conf.bak
etc/pmacct/pmacct.conf
var/spool/pmacct/
...Finished.
Starting the pmacctd daemon...
/usr/sbin/pmacctd: error while loading shared libraries: libcdada.so.0: cannot open shared object file: No such file or directory       [ FAIL ]
[root@ipfireAPU tmp] # 
```

Tested on:
APU4D4
IPFire 2.27 (x86_64) - Core-Update 175
Comment 8 Jon 2023-07-11 20:26:55 UTC
same error with start:

[root@ipfireAPU tmp] # /etc/rc.d/init.d/pmacct start
Starting the pmacctd daemon...
/usr/sbin/pmacctd: error while loading shared libraries: libcdada.so.0: cannot open shared object file: No such file or directory       [ FAIL ]
Comment 9 Adolf Belka 2023-07-11 20:38:04 UTC
Did you uninstall both pmacct and libcdada with pakfire before doing the install from the .ipfire file?

If yes then you need to install the libcdada addon as it is a dependency for the pmacct package.

If you left the libcdada package installed before installing the pmacct .ipfire package then I don't know what is going on. I will have to have a look with my vm testbed when I get some time.

Are these two files in the /usr/lib/ directory?

usr/lib/libcdada.so.0
usr/lib/libcdada.so.0.0.0

Both of these should be present if libcdada is installed.
Comment 10 Jon 2023-07-11 22:50:41 UTC
That worked!  Now I have to build up or copy over a sql db to test it with!
Comment 11 Jon 2023-07-12 19:58:17 UTC
After a day of running, all seems A-OK!  no vlan errors.
Comment 12 Adolf Belka 2023-07-13 10:37:08 UTC
(In reply to Jon from comment #11)
> After a day of running, all seems A-OK!  no vlan errors.

That sounds good. Then I will do a patch submission into the system.
Comment 14 Adolf Belka 2023-08-02 12:18:56 UTC
Patch has been merged into CU177

https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=7642da793c938fce6bf0bb7b7dce97dbf2a51f9d
Comment 15 Adolf Belka 2023-08-03 12:18:59 UTC
Fix has been merged into CU177 Testing master/c649a194