My permissions module refuses to load due to a "database problem." OpenSER can access this database (as it does for other modules) and I have even went as far as defining the table in the module's parameters even though it is a default installation.
Any help would be greatly appreciated.
OpenSER version 1.2.1 with TLS
Database: PostgreSQL
Openser.cfg:
loadmodule "permissions.so"
modparam("permissions", "db_url", "postgres://<<snip>> ")
modparam("permissions", "db_mode", 0)
modparam("permissions", "trusted_table", "trusted")
modparam("permissions", "address_table", "address")
modparam("permissions", "grp_col", "grp")
modparam("permissions", "ip_addr_col", "ip_addr")
modparam("permissions", "mask_col", "mask")
modparam("permissions", "port_col", "port")
modparam("permissions", "default_allow_file", "/usr/local/etc/openser/permissions.allow")
modparam("permissions", "default_deny_file", "/usr/local/etc/openser/permissions.deny")
Database:
openser=> select * from address;
id | grp | ip_addr | mask | port
----+-----+-------------+------+------
1 | 1 | <removed> | 32 | 5060
openser.log:
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: permissions - initializing
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: Default allow file (/usr/local/etc/openser/permissions.allow) not found => empty rule set
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: Default deny file (/usr/local/etc/openser/permissions.deny) not found => empty rule set
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: ERROR: permissions: address_reload(): Database problem
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: permissions:init_addresses(): Reload of address table failed
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: Error while initializing allow_address function
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: init_mod(): Error while initializing module permissions
In testing, it appears anytime there is a record in the address table my module will not load. Are there any other tables that should be updated when updating address?
kw
_____
From: users-bounces@openser.org [mailto:users-bounces@openser.org] On Behalf Of Kelvin Williams Sent: Saturday, June 16, 2007 12:56 PM To: users@openser.org Subject: [Users] ERROR: permissions: address_reload(): Database problem
My permissions module refuses to load due to a "database problem." OpenSER can access this database (as it does for other modules) and I have even went as far as defining the table in the module's parameters even though it is a default installation.
Any help would be greatly appreciated.
OpenSER version 1.2.1 with TLS
Database: PostgreSQL
Openser.cfg:
loadmodule "permissions.so"
modparam("permissions", "db_url", "postgres://<<snip>> ")
modparam("permissions", "db_mode", 0)
modparam("permissions", "trusted_table", "trusted")
modparam("permissions", "address_table", "address")
modparam("permissions", "grp_col", "grp")
modparam("permissions", "ip_addr_col", "ip_addr")
modparam("permissions", "mask_col", "mask")
modparam("permissions", "port_col", "port")
modparam("permissions", "default_allow_file", "/usr/local/etc/openser/permissions.allow")
modparam("permissions", "default_deny_file", "/usr/local/etc/openser/permissions.deny")
Database:
openser=> select * from address;
id | grp | ip_addr | mask | port
----+-----+-------------+------+------
1 | 1 | <removed> | 32 | 5060
openser.log:
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: permissions - initializing
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: Default allow file (/usr/local/etc/openser/permissions.allow) not found => empty rule set
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: Default deny file (/usr/local/etc/openser/permissions.deny) not found => empty rule set
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: ERROR: permissions: address_reload(): Database problem
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: permissions:init_addresses(): Reload of address table failed
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: Error while initializing allow_address function
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: init_mod(): Error while initializing module permissions
The database table is built as the database script intended. What could the error be with Postgres?
openser=# \d address
Table "public.address"
Column | Type | Modifiers
---------+-----------------------+------------------------------------------ ------------
id | integer | not null default nextval('address_id_seq'::regclass)
grp | smallint | not null default 0::smallint
ip_addr | character varying(15) | not null default ''::character varying
mask | numeric(4,0) | not null default 32
port | smallint | not null default 0::smallint
Indexes:
"address_pkey" PRIMARY KEY, btree (id)
openser=# insert into address (grp, ip_addr, mask, port) values (1,'192.168.1.1',32,5060);
INSERT 0 1
openser=# select * from address;
id | grp | ip_addr | mask | port
----+-----+-------------+------+------
2 | 1 | 192.168.1.1 | 32 | 5060
(1 row)
openser=#
[root@gaia openser]# openserctl start
database engine 'PGSQL' loaded
Control engine 'FIFO' loaded
Starting OpenSER :
ERROR: PID file /var/run/openser.pid does not exist -- OpenSER start failed
[root@gaia openser]# tail -f /var/log/openser.log
Jun 17 12:18:35 gaia /usr/local/sbin/openser[20500]: AUTH module - initializing
Jun 17 12:18:35 gaia /usr/local/sbin/openser[20500]: AUTH_DB module - initializing
Jun 17 12:18:35 gaia /usr/local/sbin/openser[20500]: AVPops - initializing
Jun 17 12:18:35 gaia /usr/local/sbin/openser[20500]: permissions - initializing
Jun 17 12:18:35 gaia /usr/local/sbin/openser[20500]: Default allow file (/usr/local/etc/openser/permissions.allow) not found => empty rule set
Jun 17 12:18:35 gaia /usr/local/sbin/openser[20500]: Default deny file (/usr/local/etc/openser/permissions.deny) not found => empty rule set
Jun 17 12:18:35 gaia /usr/local/sbin/openser[20500]: ERROR: permissions: address_reload(): Database problem
Jun 17 12:18:35 gaia /usr/local/sbin/openser[20500]: permissions:init_addresses(): Reload of address table failed
Jun 17 12:18:35 gaia /usr/local/sbin/openser[20500]: Error while initializing allow_address function
Jun 17 12:18:35 gaia /usr/local/sbin/openser[20500]: init_mod(): Error while initializing module permissions
openser=# delete from address;
DELETE 1
openser=# \q
[kelvin@gaia ~]$ su -
Password:
[root@gaia ~]# openserctl start
database engine 'PGSQL' loaded
Control engine 'FIFO' loaded
Starting OpenSER : INFO: started (pid: 20550)
[root@gaia ~]#
-----Original Message----- From: Juha Heinanen [mailto:jh@tutpro.com] Sent: Saturday, June 16, 2007 1:43 PM To: Kelvin Williams Cc: users@openser.org Subject: [Users] ERROR: permissions: address_reload(): Database problem
Jun 16 12:45:15 gaia /usr/local/sbin/openser[2871]: ERROR: permissions:
address_reload(): Database problem
this error occurs if checking of a row types and values fails. if your
ip address field is ok, then perhaps the error has something to do with
postgres.
-- juha
On Sonntag, 17. Juni 2007, Kelvin Williams wrote:
The database table is built as the database script intended. What could the error be with Postgres?
openser=# \d address [..]
This table is the same as in mysql, only the grp and port colums in mysql are 'unsigned smallint' instead of 'smallint'. And i think this module works with mysql in 1.2.
Cheers,
Henning