[OpenSIPS-Users] unixodbc connection problem - gnutls /dev/urandom error

Jeff Pyle JPyle at fusionconnect.com
Fri Mar 31 09:44:10 EDT 2017


Of course after playing with this for 2 days I find the solution right after I post to the list.

It was a tds_version issue.  For whatever reason FreeTDS configured with versions 7.1 and 7.2 don't connect from OpenSIPS, but they do from isql.  4.2, 7.3 and 7.4 work fine from both.  In my case it's to a MS SQL Server 2014 so 7.4 appropriate<http://www.freetds.org/userguide/choosingtdsprotocol.htm>.  The default tds_version is 8.0, an alias for 7.1, so that's why the default didn't work.



- Jeff


________________________________
From: Users [users-bounces at lists.opensips.org] on behalf of Jeff Pyle
Sent: Friday, March 31, 2017 09:29
To: users at lists.opensips.org
Subject: [OpenSIPS-Users] unixodbc connection problem - gnutls /dev/urandom error

Hello,

I'm trying to connect OpenSIPS 2.2.3 to a MS SQL database for avpops through unixodbc + freetds on Debian 8.  I see the following OpenSIPS errors:

DBG:db_unixodbc:db_unixodbc_new_connection: opening connection: unixodbc://xxxx:xxxx@localhost/SQLMaster
ERROR:db_unixodbc:db_unixodbc_new_connection: failed to connect
ERROR:db_unixodbc:db_unixodbc_extract_error: unixodbc:SQLDriverConnect=08001:1:0:[unixODBC][FreeTDS][SQL Server]Unable to connect to data source
ERROR:db_unixodbc:db_unixodbc_extract_error: unixodbc:SQLDriverConnect=01000:2:20002:[unixODBC][FreeTDS][SQL Server]Adaptive Server connection failed

This only occurs within OpenSIPS.  Testing on isql with the same credentials and DSN works fine.

FreeTDS gives the following logs:

login.c:1057:detected flag 0
net.c:1259:GNUTLS: level 5:
  REC[0x21569b0]: Allocating epoch #0
net.c:1259:GNUTLS: level 3:
  ASSERT: gnutls_constate.c:586
net.c:1259:GNUTLS: level 5:
  REC[0x21569b0]: Allocating epoch #1
net.c:1259:GNUTLS: level 2:
  Failed to read /dev/urandom: Bad file descriptor
net.c:1259:GNUTLS: level 3:
  ASSERT: rnd.c:174
net.c:1259:GNUTLS: level 3:
  ASSERT: rnd.c:291
...and so on.

/dev/urandom is present, has crw-rw-rw- permissions, and works properly according to rngtest from rng-tools.

I've seen some posts indicating this may be a gnutls bug and recompiling freetds with openssl is required.  I tried that - no change.

Since this only occurs within OpenSIPS I thought I'd pose the question here.  Any insight is greatly appreciated.



- Jeff

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170331/872bac59/attachment.html>


More information about the Users mailing list