[OpenSIPS-Users] Error in module permission with db_text

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Feb 8 18:32:54 CET 2010


Hi Leonid,

It may sounds silly, but are you sure the 
/etc/opensips/dbtext/usr_preferences file exists and you have read 
rights on it?

Regards,
Bogdan

Leonid Nasedkin wrote:
> Hi, Bogdan.
>
> I have got one more error with module db_text.
>
> loadmodule "avpops.so"
> modparam("avpops","db_url","text:///etc/opensips/dbtext/")
> modparam("avpops","avp_table","usr_preferences")
> modparam("avpops","use_domain",0)
> modparam("avpops","uuid_column","uuid")
> modparam("avpops","username_column","username")
> modparam("avpops","domain_column","domain")
> modparam("avpops","attribute_column","attribute")
> modparam("avpops","type_column","type")
> modparam("avpops","value_column","value")
> ...
> avp_db_load("mediaproxy-RU","$avp(s:mediaproxy_ip)")
> ...
>
> usr_preferences:
> id(int,auto) uuid(str) username(str) domain(str) attribute(str) 
> type(int) value(str) last_modified(double,null)
> 10:mediaproxy-DEFAULT:mediaproxy-DEFAULT:domain:mediaproxy_ip:0:value:0
> 20:mediaproxy-RU:mediaproxy-RU:domain:mediaproxy_ip:0:value:0
>
> And I see in log:
> Feb 2 12:03:51 dev-sip /usr/sbin/opensips[19536]: 
> DBG:db_text:dbt_load_file: loading file 
> [/etc/opensips/dbtext//usr_preferences]
> Feb 2 12:03:51 dev-sip /usr/sbin/opensips[19536]: 
> ERROR:db_text:dbt_query: table does not exist!
> Feb 2 12:03:51 dev-sip /usr/sbin/opensips[19536]: 
> ERROR:avpops:ops_dbload_avps: db_load failed
>
> 2010/1/26 Bogdan-Andrei Iancu <bogdan at voice-system.ro 
> <mailto:bogdan at voice-system.ro>>
>
>     Hi Leonid,
>
>     Thanks for testing - I uploaded the fix on the 1.6 branch also.
>
>
>     Regards,
>     Bogdan
>
>     Леонид Наседкин wrote:
>
>         Hi, Bogdan.
>         Its working now. Thanks.
>         2010/1/26 Bogdan-Andrei Iancu <bogdan at voice-system.ro
>         <mailto:bogdan at voice-system.ro> <mailto:bogdan at voice-system.ro
>         <mailto:bogdan at voice-system.ro>>>
>
>
>         Hi Leonid,
>
>         An official fix is available on SVN trunk (rev 6534). I would
>         really appreciate if you could give it a try and test - if ok, I
>         will do the backport.
>
>         Thanks and regards,
>         Bogdan
>
>
>         Bogdan-Andrei Iancu wrote:
>
>         Ok, I will investigate to come up with an official fix.
>
>         Thanks and regards,
>         Bogdan
>
>         Леонид Наседкин wrote:
>
>         Hi Bogdan
>         Thank you. Its working now.
>
>         2010/1/15 Bogdan-Andrei Iancu <bogdan at voice-system.ro
>         <mailto:bogdan at voice-system.ro>
>         <mailto:bogdan at voice-system.ro <mailto:bogdan at voice-system.ro>>
>         <mailto:bogdan at voice-system.ro <mailto:bogdan at voice-system.ro>
>         <mailto:bogdan at voice-system.ro <mailto:bogdan at voice-system.ro>>>>
>
>         Hi Leonid,
>
>         Looks like there is a compatibility bug between
>         permission and
>         db_text modules when comes to DB data types....Give me
>         couple of
>         days to sort this out.
>
>         In the mean while, if you want to use db_text for
>         permissions,
>         please use the attached patch.
>
>         Thanks and regards,
>         Bogdan
>
>
>         Леонид Наседкин wrote:
>
>         Hi there.
>         I'm trying to use permission module with db_text,
>         and it's not
>         working, and I can't understand what's wrong.
>         Opensips 1.6.1 svnrevision: 2:6509
>
>         In opensips.cfg:
>         loadmodule "db_text.so"
>         modparam("db_text", "db_mode", 0)
>         loadmodule "permissions.so"
>         modparam("permissions","db_url",
>         "text:///etc/opensips/dbtext")
>
>         In /etc/opensips/dbtext/address:
>         id(int,auto) grp(int) ip(str) mask(int) port(int)
>         proto(str)
>         pattern(str,null) context_info(str,null)
>         10:1:10.100.0.0:23:5060:udp::
>         20:1:10.110.0.0:23:5060:udp::
>         30:1:10.120.0.0:23:5060:udp::
>
>         LOG:
>
>         DBG:core:init_mod: initializing module permissions
>         DBG:permissions:mod_init: initializing...
>         WARNING:permissions:parse_config_file: file not found:
>         /etc/opensips/permissions.allow
>         WARNING:permissions:mod_init: default allow file
>         (/etc/opensips/permissions.allow) not found =>
>         empty rule set
>         WARNING:permissions:parse_config_file: file not found:
>         /etc/opensips/permissions.deny
>         WARNING:permissions:mod_init: default deny file
>         (/etc/opensips/permissions.deny) not found => empty
>         rule set
>         DBG:core:find_mod_export: found <db_bind_api> in module
>         db_text [/usr/lib/opensips/modules/]
>         DBG:core:db_bind_mod: using db bind api for db_text
>         INFO:db_text:dbt_init: using database at:
>         /etc/opensips/dbtext/
>         DBG:db_text:dbt_cache_get_db: looking for db
>         /etc/opensips/dbtext/!
>         DBG:db_text:dbt_cache_get_db: new db!
>         DBG:db_text:dbt_load_file: request for table [version]
>         DBG:db_text:dbt_load_file: db is
>         [/etc/opensips/dbtext/]
>         DBG:db_text:dbt_load_file: loading file
>         [/etc/opensips/dbtext//version]
>         DBG:db_text:dbt_table_new: mtime is 1263556066
>         DBG:db_text:dbt_load_file: column[0] is STR!
>         DBG:db_text:dbt_load_file: column[1] is INT!
>         DBG:db_text:dbt_query: new res with 1 cols
>         DBG:db_text:dbt_result_new: new res with 1 cols
>         DBG:core:db_new_result: allocate 28 bytes for
>         result set at
>         0x816b044
>         DBG:core:db_allocate_columns: allocate 16 bytes for
>         result
>         columns at 0x816aedc
>         DBG:core:db_allocate_rows: allocate 28 bytes for
>         result rows
>         and values at 0x816b090
>         DBG:core:db_free_columns: freeing result columns at
>         0x816aedc
>         DBG:core:db_free_rows: freeing 1 rows
>         DBG:core:db_free_row: freeing row values at 0x816b098
>         DBG:core:db_free_rows: freeing rows at 0x816b090
>         DBG:core:db_free_result: freeing result set at
>         0x816b044
>         DBG:db_text:dbt_load_file: request for table [address]
>         DBG:db_text:dbt_load_file: db is
>         [/etc/opensips/dbtext/]
>         DBG:db_text:dbt_load_file: loading file
>         [/etc/opensips/dbtext//address]
>         DBG:db_text:dbt_table_new: mtime is 1263558311
>         DBG:db_text:dbt_load_file: column[0] is INT!
>         DBG:db_text:dbt_load_file: column[1] is INT!
>         DBG:db_text:dbt_load_file: column[2] is STR!
>         DBG:db_text:dbt_load_file: column[3] is INT!
>         DBG:db_text:dbt_load_file: column[4] is INT!
>         DBG:db_text:dbt_load_file: column[5] is STR!
>         DBG:db_text:dbt_load_file: column[6] is STR!
>         DBG:db_text:dbt_load_file: column[7] is STR!
>         DBG:db_text:dbt_query: new res with 8 cols
>         DBG:db_text:dbt_result_new: new res with 8 cols
>         DBG:core:db_new_result: allocate 28 bytes for
>         result set at
>         0x816b004
>         DBG:core:db_allocate_columns: allocate 128 bytes
>         for result
>         columns at 0x8186b68
>         DBG:core:db_allocate_rows: allocate 504 bytes for
>         result rows
>         and values at 0x8186bf4
>         DBG:permissions:reload_address_table: number of rows in
>         address table: 3
>         ERROR:permissions:reload_address_table: database
>         problem
>         DBG:core:db_free_columns: freeing result columns at
>         0x8186b68
>         DBG:core:db_free_rows: freeing 3 rows
>         DBG:core:db_free_row: freeing row values at 0x8186c0c
>         DBG:core:db_free_row: freeing row values at 0x8186cac
>         DBG:core:db_free_row: freeing row values at 0x8186d4c
>         DBG:core:db_free_rows: freeing rows at 0x8186bf4
>         DBG:core:db_free_result: freeing result set at
>         0x816b004
>         CRITICAL:permissions:init_address: reload of
>         address table failed
>         ERROR:permissions:mod_init: failed to initialize the
>         allow_address function
>         ERROR:core:init_mod: failed to initialize module
>         permissions
>         ERROR:core:main: error while initializing modules
>         DBG:db_text:destroy: destroy ...
>
>
>         -- WBR, Leonid Nasedkin
>         icq: 256816
>         skype: leonidnasedkin
>         ------------------------------------------------------------------------
>
>
>
>
>         -- Bogdan-Andrei Iancu
>         www.voice-system.ro <http://www.voice-system.ro>
>         <http://www.voice-system.ro>
>
>
>
>
>
>         -- 
>         WBR, Leonid Nasedkin
>         cell: +7 923 731 0077
>         icq: 256816
>         skype: leonidnasedkin
>
>
>
>     -- 
>     Bogdan-Andrei Iancu
>     www.voice-system.ro <http://www.voice-system.ro>
>
>
>
>
> -- 
> WBR, Leonid Nasedkin
> cell: +7 923 731 0077
> icq: 256816
> skype: leonidnasedkin


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list