# Traceback in summary email

**URL:** <https://community.zeek.org/t/traceback-in-summary-email/5676>\
**Category:** Zeek\
**Created:** [April 22, 2019, 8:15pm UTC](https://community.zeek.org/t/traceback-in-summary-email/5676 "2019-04-22T20:15:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Gardner](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mark\_Gardner](https://community.zeek.org/u/Mark_Gardner)\
**Post date:** [April 22, 2019, 8:15pm UTC](https://community.zeek.org/t/traceback-in-summary-email/5676/1 "2019-04-22T20:15:45Z")

</div>

I am getting a traceback in the connection summary emails rather than useful information. I didn’t have the Python SubnetTree package installed when I built, installed, and first started Zeek but have since installed it on the management/logger and all sensors. I restarted Zeek but am still seeing the traceback. Suggestions on where to look next?

Traceback (most recent call last):  
File “/usr/local/bro/bin/trace-summary”, line 22, in   
import SubnetTree  
File “/usr/local/bro/lib/broctl/SubnetTree.py”, line 21, in   
\_SubnetTree = swig\_import\_helper()  
File “/usr/local/bro/lib/broctl/SubnetTree.py”, line 20, in swig\_import\_helper  
return importlib.import\_module(’\_SubnetTree’)  
File “/usr/lib/python2.7/importlib/ **init**.py”, line 37, in import\_module  
**import** (name)  
ImportError: dynamic module does not define init function (init\_SubnetTree)

---

<div class="post-metadata">

**Author:** ![Jon\_Siwek](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Jon\_Siwek](https://community.zeek.org/u/Jon_Siwek)\
**Post date:** [April 23, 2019, 12:01am UTC](https://community.zeek.org/t/traceback-in-summary-email/5676/2 "2019-04-23T00:01:00Z")

</div>

> I am getting a traceback in the connection summary emails rather than useful information. I didn't have the Python SubnetTree package installed when I built, installed, and first started Zeek but have since installed it on the management/logger and all sensors.

That usually should get built/installed as part of the default Zeek  
installation and you don't have to independently install it.

> I restarted Zeek but am still seeing the traceback.

Just double-checking: the message didn't change after independently  
installing pysubnettree ? That would make sense since I expect  
there's some explicit PYTHONPATH that's always picking up the version  
installed with Bro/Zeek rather than the independently installed  
version.

You could try comparing:

&nbsp;&nbsp;&nbsp;&nbsp;python -c "import SubnetTree"

versus:

&nbsp;&nbsp;&nbsp;&nbsp;PYTHONPATH=/usr/local/bro/lib/broctl python -c "import SubnetTree"

as a test of whether either version successfully gets imported.

> Suggestions on where to look next?

Probably would help to get more details/info that could help reproduce  
the error.

What Zeek/Bro version ?

What operating system ?

What Python version and what `swig -version` ?

The full `./configure` command you used when building Zeek/Bro and its  
output may be most helpful.

A guess is that the configuration failed to detect a valid/consistent  
Python and somehow that botched the build/install of pysubnettree.

- Jon

---

<div class="post-metadata">

**Author:** ![Mark\_Gardner](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Mark\_Gardner](https://community.zeek.org/u/Mark_Gardner)\
**Post date:** [April 23, 2019, 8:10pm UTC](https://community.zeek.org/t/traceback-in-summary-email/5676/3 "2019-04-23T20:10:57Z")

</div>

> You could try comparing:
> 
> python -c “import SubnetTree”
> 
> versus:
> 
> PYTHONPATH=/usr/local/bro/lib/broctl python -c “import SubnetTree”
> 
> as a test of whether either version successfully gets imported.

This could be the difference:

python -c "import SubnetTree" PYTHONPATH=/usr/local/bro/lib/broctl python -c “import SubnetTree”  
Traceback (most recent call last):  
File “”, line 1, in   
File “/usr/local/bro/lib/broctl/SubnetTree.py”, line 21, in   
\_SubnetTree = swig\_import\_helper()  
File “/usr/local/bro/lib/broctl/SubnetTree.py”, line 20, in swig\_import\_helper  
return importlib.import\_module(‘\_SubnetTree’)  
File “/usr/lib/python2.7/importlib/ **init**.py”, line 37, in import\_module  
**import** (name)  
ImportError: dynamic module does not define init function (init\_SubnetTree)

> > Suggestions on where to look next?
> 
> Probably would help to get more details/info that could help reproduce  
> the error.
> 
> What Zeek/Bro version ?

2.6-167 built from source

> What operating system ?

Debian 9 “Stretch”

> What Python version and what `swig -version` ?

$ python --version  
Python 2.7.13

$ python3 --version  
Python 3.5.3

$ swig -version

SWIG Version 3.0.10  
Compiled with g++ [x86\_64-pc-linux-gnu]  
Configured options: +pcre

> The full `./configure` command you used when building Zeek/Bro and its  
> output may be most helpful.

$ CC=clang CXX=clang++ ./configure

The version of clang I am using:

$ clang --version

clang version 3.8.1-24 (tags/RELEASE\_381/final)  
Target: x86\_64-pc-linux-gnu  
Thread model: posix  
InstalledDir: /usr/bin

> A guess is that the configuration failed to detect a valid/consistent  
> Python and somehow that botched the build/install of pysubnettree.

It looks like the two versions of python are installed. That could be the problem as Python 2.7 is found for the interpreter but 3.5 is found for libraries. The following lines are taken from the configuration output:

…

– Found PythonInterp: /usr/bin/python (found version “2.7.13”)

…

– Found PythonLibs: /usr/lib/x86\_64-linux-gnu/[libpython3.5m.so](http://libpython3.5m.so) (found version “3.5.3”)  
– Found PythonDev: /usr/include/python3.5m

To test the theory, I will rebuild explicitly specifying the version of python:  
$ CC=clang CXX=clang++ ./configure --with-python=/usr/bin/python --with-python-lib=/usr/lib/x86\_64-linux-gnu/[libpython2.7.so](http://libpython2.7.so) --with-python-inc=/usr/include/python2.7

I’ll let you know how it turns out once the build finishes and I am able to test it.

Mark

---

<div class="post-metadata">

**Author:** ![JustinAzoff](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@JustinAzoff](https://community.zeek.org/u/JustinAzoff)\
**Post date:** [April 23, 2019, 10:47pm UTC](https://community.zeek.org/t/traceback-in-summary-email/5676/4 "2019-04-23T22:47:30Z")

</div>

Was it the same traceback before? The broctl bundles subnettree, so  
you should have already had it in the form of these 2 files:

/usr/local/bro/lib/broctl/\_SubnetTree.so  
/usr/local/bro/lib/broctl/SubnetTree.py

now it looks like you have 2 incompatible versions of it installed  
that are conflicting with each other.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:46pm UTC](https://community.zeek.org/t/traceback-in-summary-email/5676/5 "2022-05-06T15:46:27Z")

</div>


