Problems with pythonmodule (versions 1.4.4 and 1.4.5)

Hi all,

Trying with both unbound-1.4.4 and unbound-1.4.5, I’ve got different problems when enable python modules. In both cases, configuration is done --with-pythonmodule, and set unbound.conf as follows:

module-config: “validator python iterator”

python-script: “/usr/local/etc/unbound/e1.py”

#where e1.py is the same as http://www.unbound.net/documentation/pythonmod/examples/example0.html (Fundamentals)

I’m lost here! Could you please lend me a hand?

Please find history below with both versions.

Tkx!
Leandro.

Doing it in unbound-1.4.4:

[root@rhel54ca-vm5 unbound-1.4.4]# ./unbound -dvv
[1278947428] unbound[1406:0] notice: Start of unbound 1.4.4.
[1278947428] unbound[1406:0] debug: creating udp4 socket 0.0.0.0 53
[1278947428] unbound[1406:0] debug: creating tcp4 socket 0.0.0.0 53
[1278947428] unbound[1406:0] debug: creating tcp4 socket 0.0.0.0 953
[1278947428] unbound[1406:0] debug: setup SSL certificates
[1278947428] unbound[1406:0] warning: did not exit gracefully last time (1384)
[1278947428] unbound[1406:0] debug: drop user privileges, run as unbound
[1278947428] unbound[1406:0] debug: switching log to /tmp/unbound.log
Traceback (most recent call last):
File “”, line 1, in ?
ImportError: No module named unboundmodule

If I copy unboundmodule.py, from pythonmod directory to :

[root@rhel54ca-vm5 unbound-1.4.4]# ./unbound -dvv
[1278947480] unbound[1424:0] notice: Start of unbound 1.4.4.
[1278947480] unbound[1424:0] debug: creating udp4 socket 0.0.0.0 53
[1278947480] unbound[1424:0] debug: creating tcp4 socket 0.0.0.0 53
[1278947480] unbound[1424:0] debug: creating tcp4 socket 0.0.0.0 953
[1278947480] unbound[1424:0] debug: setup SSL certificates
[1278947480] unbound[1424:0] warning: did not exit gracefully last time (1406)
[1278947480] unbound[1424:0] debug: drop user privileges, run as unbound
[1278947480] unbound[1424:0] debug: switching log to /tmp/unbound.log
Traceback (most recent call last):
File “”, line 1, in ?
File “./unboundmodule.py”, line 46, in ?
class query_info(_object):
File “./unboundmodule.py”, line 58, in query_info
if _newclass:qtype_str = _swig_property(_get_qtype_str)
NameError: name ‘_swig_property’ is not defined

Finally, in unbound-1.4.5

[root@rhel54ca-vm5 unbound-1.4.5]# ./unbound -dvv
[1278955339] unbound[1698:0] notice: Start of unbound 1.4.5.
[1278955339] unbound[1698:0] debug: creating udp4 socket 0.0.0.0 53
[1278955339] unbound[1698:0] debug: creating tcp4 socket 0.0.0.0 53
[1278955339] unbound[1698:0] debug: creating tcp4 socket 0.0.0.0 953
[1278955339] unbound[1698:0] debug: setup SSL certificates
[1278955339] unbound[1698:0] warning: did not exit gracefully last time (1682)
[1278955339] unbound[1698:0] debug: drop user privileges, run as unbound
[1278955339] unbound[1698:0] debug: switching log to /tmp/unbound.log

Looking at the log:

[1278955339] unbound[1698:0] debug: module config: “validator python iterator”
[1278955339] unbound[1698:0] error: Unknown value for next module: ’ python iterator’
[1278955339] unbound[1698:0] fatal error: failed to setup modules

Try: yum/apt-get install swig

Looks like you are missing the swig python package.

Paul

Hi Paul,

Swig doesn’t seem to be the problem!

[root@rhel54ca-vm5 ~]# yum list installed | grep -i swig

swig.x86_64 1.3.29-2.el5 installed

Furthermore, 1.4.4 does not show that error, even though it is installed with 1.4.5 in the same box…

Thanks!
Leandro.

Hello Leandro,

I've seen the same error you see on 1.4.5 when compiling unbound on
Debian 4.x. I do not see the error on Debian 5.x or Ubuntu. I guess the
swig system is too old on your system. On Ubuntu I have Swig version 1.3.40.

-- Carsten Strotmann

ok, Carsten.

I will take an ubuntu, centos or RHEL box with higher glibc and glibc-devel version (at least 2.8 required to build swig 1.3.40). Let’s give it a try.

Thanks!
Leandro.

ok, Carsten.

That was the problem. I’ve installed Fedora 12 with swig 1.3.40 and everything worked ok.

I copied unboundmodule.py from pythonmod directory to unbound home directory though, to avoid problems to unbound when wants to locate that file. At least that way worked for me.

Thanks!

Leandro C. Tino | IT evoluxion
Viamonte 577 Piso 8º, Capital Federal, Buenos Aires, Argentina