[SR-Users] driver error: Can't connect to MySQL server with kamailio 5.3.x and mysql-config-groups
Sergey Safarov
s.safarov at gmail.com
Mon Oct 28 16:26:55 CET 2019
please look install rpm content for "python23" string.
Looks as this string introduced on your local PC.
I have checked kamailio-5.3.0-14.1.x86_64.rpm
<https://api.opensuse.org/build/home:kamailio:v5.3.x-rpms/CentOS_7/x86_64/kamailio53/kamailio-5.3.0-14.1.x86_64.rpm>
in
kamailio and found deps
/bin/sh
/bin/sh
/bin/sh
/bin/sh
/usr/bin/python2
config(kamailio) = 5.3.0-14.1
libc.so.6()(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libc.so.6(GLIBC_2.3.2)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libc.so.6(GLIBC_2.7)(64bit)
libdl.so.2()(64bit)
libdl.so.2(GLIBC_2.2.5)(64bit)
libm.so.6()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit)
libprint.so.1()(64bit)
libresolv.so.2()(64bit)
libresolv.so.2(GLIBC_2.2.5)(64bit)
libsrdb1.so.1()(64bit)
libsrdb2.so.1()(64bit)
libsrutils.so.1()(64bit)
libtrie.so.1()(64bit)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)
rpmlib(PayloadIsXz) <= 5.2-1
Also you reps have other strange string "config(kamailio) = 5.3.0-14.el7.
centos.4com"
Please read
https://github.com/kamailio/kamailio/blob/master/pkg/kamailio/README.md
RPM section
On Mon, Oct 28, 2019 at 5:02 PM Karsten Horsmann <khorsmann at gmail.com>
wrote:
> Hello Daniel,
>
> i have a good news and bad news.
>
> First the good one:
>
> I tried the master and it works for me now with DBURL.
>
> kamailio -v
> version: kamailio 5.4.0-dev1 (x86_64/linux)
> flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS,
> DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC,
> F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT,
> USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST,
> HAVE_RESOLV_RES
> ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024,
> BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> id: unknown
> compiled on 13:04:06 Oct 28 2019 with gcc 4.8.5
> [root at sipedge1 ~]# grep DBURL /etc/kamailio/kamailio-local.cfg
> #!define DBURL "mysql://[kamailio]/kamailio"
>
> [root at sipedge1 ~]# grep '\[' /etc/kamailio/modules.cfg
> modparam("sqlops", "sqlcon", "cb=>mysql://[kamailio]/kamailio")
>
> The bad news: SPEC File seems broken for the dependency on CENTOS 7.7
> Self generated RPMS got /usr/bin/python23 as dependecy. This file not
> exits.
>
>
> rpm -qp kamailio-5.3.0-14.el7.centos.x86_64.rpm --requires
> /bin/sh
> /bin/sh
> /bin/sh
> /bin/sh
> /usr/bin/python23
> config(kamailio) = 5.3.0-14.el7.centos.4com
> libc.so.6()(64bit)
> libc.so.6(GLIBC_2.14)(64bit)
> libc.so.6(GLIBC_2.2.5)(64bit)
> libc.so.6(GLIBC_2.3)(64bit)
> libc.so.6(GLIBC_2.3.2)(64bit)
> libc.so.6(GLIBC_2.3.4)(64bit)
> libc.so.6(GLIBC_2.7)(64bit)
> libdl.so.2()(64bit)
> libdl.so.2(GLIBC_2.2.5)(64bit)
> libm.so.6()(64bit)
> libm.so.6(GLIBC_2.2.5)(64bit)
> libprint.so.1()(64bit)
> libresolv.so.2()(64bit)
> libresolv.so.2(GLIBC_2.2.5)(64bit)
> libsrdb1.so.1()(64bit)
> libsrdb2.so.1()(64bit)
> libsrutils.so.1()(64bit)
> libtrie.so.1()(64bit)
> rpmlib(CompressedFileNames) <= 3.0.4-1
> rpmlib(FileDigests) <= 4.6.0-1
> rpmlib(PartialHardlinkSets) <= 4.0.4-1
> rpmlib(PayloadFilesHavePrefix) <= 4.0-1
> rtld(GNU_HASH)
> rpmlib(PayloadIsXz) <= 5.2-1
>
> Am Fr., 25. Okt. 2019 um 12:58 Uhr schrieb Daniel-Constantin Mierla <
> miconda at gmail.com>:
>
>> Hello,
>>
>> can you try with the patch from next commit:
>>
>> -
>> https://github.com/kamailio/kamailio/commit/2aa614d49f4917faec62534a51fcf8ddfc5fb870
>>
>> If all ok, then I will backport.
>>
>> Cheers,
>> Daniel
>> On 25.10.19 12:50, Karsten Horsmann wrote:
>>
>> Hi Henning,
>>
>> changing a parser without understanding the parser is dangerous. IMHO the
>> [groupname] will be given to the mysql-libs.
>> I am not so deep inside kamailio c-code to full understand that case.
>>
>> Am Mi., 23. Okt. 2019 um 18:29 Uhr schrieb Henning Westerholt <
>> hw at skalatan.de>:
>>
>>> Hello,
>>>
>>>
>>>
>>> just an idea – maybe the easiest way would be to introduce another
>>> character for the groups, e.g. ‘{ }’ or similar. The overlapping between
>>> IPv6 and groups was not intended, the group support is probably older as
>>> IPv6 in Kamailio. 😉
>>>
>>>
>>>
>>> Cheers,
>>>
>>>
>>>
>>> Henning
>>>
>>>
>>>
>>> --
>>>
>>> Henning Westerholt - https://skalatan.de/blog/
>>>
>>> Kamailio services - https://skalatan.de/services
>>>
>>>
>>>
>>> *From:* sr-users <sr-users-bounces at lists.kamailio.org> *On Behalf Of *Karsten
>>> Horsmann
>>> *Sent:* Wednesday, October 23, 2019 6:17 PM
>>> *To:* Daniel-Constantin Mierla <miconda at gmail.com>
>>> *Cc:* Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
>>> *Subject:* Re: [SR-Users] driver error: Can't connect to MySQL server
>>> with kamailio 5.3.x and mysql-config-groups
>>>
>>>
>>>
>>> Hi Daniel,
>>>
>>>
>>>
>>> you mean this commit (see below). Maybe Alexey Vasilyev can told us
>>> something to that change?
>>>
>>>
>>>
>>> How can i use mysql-groups in the [] notation? Like:
>>>
>>> #!define DBURL "mysql://[kamailio]/kamailio"
>>>
>>> https://kamailio.org/docs/modules/5.3.x/modules/db_mysql.html#idm140
>>>
>>>
>>>
>>> AFAIK this change splits [ and ] to ipv6 Host and sets ST_HOST6 and
>>>
>>>
>>>
>>> commit a7588f382605991bef4499de8c89b10a9468c8cf
>>> Author: Alexey Vasilyev <alexei.vasilyev at gmail.com>
>>> Date: Wed Sep 4 13:47:23 2019 +0300
>>>
>>> db_mysql: database URL supports IPv6 address as hostname
>>>
>>> - changed parsing of db_url to accept IPv6 address for hostname
>>>
>>>
>>>
>>> Any help would be appreciated.
>>>
>>>
>>>
>>> Cheers Karsten
>>>
>>>
>>>
>>>
>>>
>>> Am Mi., 23. Okt. 2019 um 08:10 Uhr schrieb Daniel-Constantin Mierla <
>>> miconda at gmail.com>:
>>>
>>> Hello,
>>>
>>> it could be that a patch to support ipv6 in the db url is conflicting
>>> with the syntax for the group name, because both seem to use [ ] . Iirc,
>>> such a commit was not long time ago. I will have to look at the code for
>>> mysql conf group to see what exactly it expects, not sure I got time for it
>>> today, though, maybe others can check quicker.
>>>
>>> Cheers,
>>> Daniel
>>>
>>> On 22.10.19 16:38, Karsten Horsmann wrote:
>>>
>>> Hi Daniel,
>>>
>>>
>>>
>>> i create an Logfile with debug=3 on startup here:
>>> https://gist.github.com/khorsmann/91642daaa3715c59624cd5272bc3398a#file-logfile-txt-L4345
>>>
>>>
>>>
>>>
>>> 0(29174) DEBUG: db_mysql [km_my_con.c:108]: db_mysql_new_connection():
>>> opening connection: mysql://xxxx:xxxx@kamailio/kamailio
>>>
>>> I dont know where kamailio though that there is an "hostname" kamailio
>>> that holds the mysqldb/kamailio.
>>>
>>>
>>>
>>> I want to use groups in the future - cos i auto-generate mysql-passwords
>>> with / for example and that is possible in groups, but i dunno how in
>>> normal defines.
>>>
>>>
>>>
>>> Cheers
>>>
>>> Karsten
>>>
>>>
>>>
>>> Am Di., 22. Okt. 2019 um 15:40 Uhr schrieb Daniel-Constantin Mierla <
>>> miconda at gmail.com>:
>>>
>>> Hello,
>>>
>>> if you set debug=3, do you see any other log message that can give hints
>>> about the error?
>>>
>>> I do not recall any change in using mysql conf groups, but there were
>>> some changes in supporting usernames with domains and few other updates
>>> that could have affected indirectly this part.
>>>
>>> Cheers,
>>> Daniel
>>>
>>> On 22.10.19 15:20, Karsten Horsmann wrote:
>>>
>>> Hi List,
>>>
>>>
>>>
>>> me again - i also updated the test-system to latest CentOS 7.7.1908 to
>>> be sure that the rpm building source and my target system are on the same
>>> versions.
>>>
>>>
>>>
>>> lsb_release -a
>>> LSB Version: :core-4.1-amd64:core-4.1-noarch
>>> Distributor ID: CentOS
>>> Description: CentOS Linux release 7.7.1908 (Core)
>>> Release: 7.7.1908
>>> Codename: Core
>>>
>>>
>>>
>>> Am Di., 22. Okt. 2019 um 14:58 Uhr schrieb Karsten Horsmann <
>>> khorsmann at gmail.com>:
>>>
>>> Hi List,
>>>
>>>
>>>
>>> i updated one of my testing kamailios from 5.2.x to latest 5.3.x.
>>>
>>> After restarting the process, i got an mysql error that the server
>>> "kamailio" is not found.
>>>
>>>
>>>
>>> I use the config-feature of my.cnf config-group names within the
>>> kamailio.cfg
>>> I can start my kamailio 5.3.x installation with "normal
>>> username:password at host" definitions for DBURL.
>>>
>>>
>>>
>>> Did anyone have the same issue?
>>>
>>> 0(19625) ERROR: db_mysql [km_my_con.c:139]: db_mysql_new_connection():
>>> driver error: Can't connect to MySQL server on 'kamailio' (4)
>>> 0(19625) ERROR: <core> [db.c:319]: db_do_init2(): could not add
>>> connection to the pool
>>> 0(19625) ERROR: dialplan [dp_db.c:179]: dp_connect_db(): unable to
>>> connect to the database
>>> 0(19625) ERROR: dialplan [dialplan.c:191]: mod_init(): could not
>>> initialize data
>>> 0(19625) ERROR: <core> [core/sr_module.c:850]: init_mod(): Error while
>>> initializing module dialplan (/usr/lib64/kamailio/modules/dialplan.so)
>>> ERROR: error while initializing modules
>>>
>>>
>>> from my kamailio.cfg i defined the DBURL like this:
>>>
>>>
>>> # Use /etc/my.cnf.d/kamailio.cnf to store credentials
>>> # within a mysql-db-group
>>> #!define DBURL "mysql://[kamailio]/kamailio"
>>>
>>> and special modules can use it like this (or via DBURL)
>>> modparam("sqlops", "sqlcon", "cb=>mysql://[kamailio]/kamailio")
>>>
>>> cat /etc/my.cnf.d/kamailio.cnf
>>>
>>>
>>> # MySQL configuration group for kamailio
>>> [kamailio]
>>> user=kamailio
>>> password="kamailiorw"
>>> host=172.20.100.22
>>>
>>>
>>> rpm -qa | grep kam
>>> kamailio-dialplan-5.3.0-13.1.x86_64
>>> kamailio-websocket-5.3.0-13.1.x86_64
>>> kamailio-jansson-5.3.0-13.1.x86_64
>>> kamailio-mysql-5.3.0-13.1.x86_64
>>> kamailio-tls-5.3.0-13.1.x86_64
>>> kamailio-ims-5.3.0-13.1.x86_64
>>> kamailio-statsd-5.3.0-13.1.x86_64
>>> kamailio-5.3.0-13.1.x86_64
>>> kamailio-redis-5.3.0-13.1.x86_64
>>>
>>>
>>>
>>> cat /etc/redhat-release
>>> CentOS Linux release 7.6.1810 (Core)
>>>
>>>
>>>
>>> --
>>>
>>> Cheers
>>> *Karsten Horsmann*
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Mit freundlichen Grüßen
>>> *Karsten Horsmann*
>>>
>>>
>>>
>>> _______________________________________________
>>>
>>> Kamailio (SER) - Users Mailing List
>>>
>>> sr-users at lists.kamailio.org
>>>
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>> --
>>>
>>> Daniel-Constantin Mierla -- www.asipto.com
>>>
>>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>>>
>>> Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Mit freundlichen Grüßen
>>> *Karsten Horsmann*
>>>
>>> --
>>>
>>> Daniel-Constantin Mierla -- www.asipto.com
>>>
>>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>>>
>>> Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Mit freundlichen Grüßen
>>> *Karsten Horsmann*
>>>
>>
>>
>> --
>> Mit freundlichen Grüßen
>> *Karsten Horsmann*
>>
>> --
>> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat
>>
>>
>
> --
> Mit freundlichen Grüßen
> *Karsten Horsmann*
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20191028/c8d3da82/attachment.html>
More information about the sr-users
mailing list