As some of you may have suspected, it was an issue of the environment having been set up to pick up our old Sybase libraries instead of the TDS libs.
The root of the problem was really that my understanding of the use of PerlSetEnv to set variables like FREETDSCONF, SYBASE and LD_LIBRARY_PATH was flawed, and that stuff all has to be set in the environment in which Apache is first invoked. It can't be set subsequent to the web server startup.
In any case,. I'm up and running under Apache now. Looking forward to reaping the benefits of FreeTDS, and facing (with some distaste) MSSQL server access and migration.
Thanks.
Eric
_____________________________________________
From: Berg, Eric: IT (NYK)
Sent: Thursday, October 07, 2010 3:06 PM
To: '[email protected]'
Subject: Cmd. Line connections fine, but mod_perl connection fails
I'm using FreeTDS with Perl and mod_perl in an Apache 2.2.15, mod_perl 2.0.4, Perl 5.12.2 environment (brand spankin new) and I'm experiencing some discrepencies between running my DBD::Sybase (ver 1.10)/DBI (ver 1.615) on the command line and from within mod_perl.
We are connecting to 3 different SQL servers: 12.5 Sybase on Linux, 12.5 Sybase on Solaris 5.8, and MS SQL.
Everything's fine from the command line, but from mod_perl, we're seeing the following FreeTDS trace:
log.c:190:Starting log file for FreeTDS 0.82
on 2010-10-07 14:08:53 with debug flags 0x4fff.
iconv.c:363:iconv to convert client-side data to the "ISO-8859-1" character set
iconv.c:516:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
iconv.c:516:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
net.c:210:Connecting to 10.55.109.2 port 5100 (TDS version 8.0)
net.c:264:tds_open_socket: connect(2) returned "Operation now in progress"
net.c:303:tds_open_socket() succeeded
util.c:162:Changed query state from DEAD to IDLE
login.c:735:quietly sending TDS 7+ login packet
token.c:312:tds_process_login_tokens()
util.c:334:tdserror(0x2a8ba30, 0x2acf570, 20017, 0)
ct.c:334:ct_con_props() action = CS_GET property = 9108
ct.c:486:fetching userdata 0x2ac8ee0
util.c:368:tdserror: client library returned TDS_INT_CANCEL(2)
util.c:389:tdserror: returning TDS_INT_CANCEL(2)
util.c:162:Changed query state from IDLE to DEAD
token.c:316:looking for login token, got 0()
token.c:108:tds_process_default_tokens() marker is 0()
token.c:111:leaving tds_process_default_tokens() connection dead
util.c:334:tdserror(0x2a8ba30, 0x2acf570, 20002, 0)
ct.c:334:ct_con_props() action = CS_GET property = 9108
ct.c:486:fetching userdata 0x2ac8ee0
util.c:368:tdserror: client library returned TDS_INT_CANCEL(2)
util.c:389:tdserror: returning TDS_INT_CANCEL(2)
mem.c:563:tds_free_all_results()
ct.c:630:leaving ct_connect() returning 0
ct.c:1865:ct_con_drop()
And this is what I'm seeing on the solaris box in the error log:
02:00000:02549:2010/10/07 14:26:05.14 server Error: 1621, Severity: 18, State: 1
02:00000:02549:2010/10/07 14:26:05.14 server Type '10' not allowed before login.
01:00000:02475:2010/10/07 14:26:05.22 server Error: 1621, Severity: 18, State: 1
01:00000:02475:2010/10/07 14:26:05.23 server Type '10' not allowed before login.
05:00000:02968:2010/10/07 14:26:05.86 server Error: 1621, Severity: 18, State: 1
05:00000:02968:2010/10/07 14:26:05.86 server Type '10' not allowed before login.
04:00000:01438:2010/10/07 14:26:06.07 server Error: 1621, Severity: 18, State: 1
04:00000:01438:2010/10/07 14:26:06.07 server Type '10' not allowed before login.
00:00000:02755:2010/10/07 14:26:44.38 kernel Cannot send, host process disconnected: 0000016a suid: 1343
00:00000:02755:2010/10/07 14:26:44.38 server Error: 1608, Severity: 18, State: 3
00:00000:02755:2010/10/07 14:26:44.38 server A client process exited abnormally, or a network error was encountered. Unless other errors occurred, continue processing normally.
00:00000:02755:2010/10/07 14:26:44.38 kernel extended error information: hostname: login: gsaread
My freetds.conf config for this server looks like this:
[GSAPROD]
host = sybx.myco.com
port = 5100
tds version = 4.2
And in our web server logs, we see this:
DBIWrapper connect('packetSize=4096;loginTimeout=5;server=GSAPROD;scriptName=httpd;hostname=client-host;database_name=ourdb','user',...) failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (49)
Server GSAPROD, database
Message String: Unexpected EOF from the server
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (34)
Server GSAPROD, database
Message String: Adaptive Server connection failed
I've looked at the LD_LIBRARY_PATH, SYBASE, FREETDS and other environment items, but have been unable to find the problem.
It was suggested in this thread (http://lists.ibiblio.org/pipermail/freetds/2006q2/019981.html) that explicitly setting the database_name
Any help will be appreciate?
Eric
_______________________________________________
This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging wit
h Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered offic
e at 1 Churchill Place, London, E14 5HP. This email may relate to or be sent from other members of the Barclays Group.
_______________________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.