Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJgmZ-004adp-RC for pgsql-general@arkaria.postgresql.org; Fri, 06 Dec 2024 22:26:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tJgmV-00EBHr-N3 for pgsql-general@arkaria.postgresql.org; Fri, 06 Dec 2024 22:26:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJgmV-00EBHi-6G for pgsql-general@lists.postgresql.org; Fri, 06 Dec 2024 22:26:40 +0000 Received: from fhigh-b7-smtp.messagingengine.com ([202.12.124.158]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJgmP-001Ph5-BA for pgsql-general@lists.postgresql.org; Fri, 06 Dec 2024 22:26:38 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id A10882540110; Fri, 6 Dec 2024 17:26:31 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Fri, 06 Dec 2024 17:26:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1733523991; x=1733610391; bh=KcNwnntCjVZwsklsCI8J9N/khc2KhzroHJn74tBF2Zk=; b= jBzNICYZltHXdljh/9jxUm7lqBiL3O5CTakenjKsE16O5zdTM8bc6kDVVyDKjXRl dhX2+IBUknNyJVi9i2bOj3WPlJIQTAVZhGh5M0vzko0T78F3LnbC6dFQFI3zNa4J 4gc56ZMI8deWhoboEUJgEuaYnV7ZnKrElxKnOP3i4Lau2+HcsizSg2RonH9mY5Ge h3n7HkAgQAEHDAcKdDZ/wcte9TK9/2yMCS1pG7p1xcdjutJmg4+rJe6K6KXOtVbZ rhunweI5au34yS+2Wg/5mIFa7ZfsPBv7SQAPPqlkl8+nx8QB7/WC7Gx4orWSBVAH hbpkcDmeNHQzYNTybvVirQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1733523991; x=1733610391; bh=K cNwnntCjVZwsklsCI8J9N/khc2KhzroHJn74tBF2Zk=; b=Peef6tmI+oSXC9Jpa yV0So99rl8o+KQU1uyjZxtiLKQpYsVHjThiqE8ZkTAY0Omn2oRm2fHkQ1FnW8iL5 CRjOjc0Sx6ZaBAjmLdSvwgZ64ejkSpGk1J+wQm76wEifZvZUzs97wXuGYbV7M3la 8qBd2K1+FfG7vZRv8phbQTmQLSkwKqNdbK15qE+rBVG6ZSGOViEfIj3Uq+kvA3ii EUx1F4C8io6DuddcaNHMaDBuk1yAXpR3gip5IAwB0OYMT7r2E9EB9URT3qtnCDOX Asd7AYkVfkZb/CXNFLjQcfl89KoXl9gqjuvxLpsP6FeU8PJmh8ri1sgnfUchkcXm sqjCQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrieelgdduheekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeen ucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeffkeekteehleevfeevgefh fedtfeekgfeggfdvgeefjeduveeljeekgfeiudfgkeenucffohhmrghinhepshhomhgvug homhgrihhnrdhnvghtpdhfihhrshhtfihorhhkshdrtghomhenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhu thdprhgtphhtthhopehsiigrtghhvghrsehmtgifrdgvughupdhrtghpthhtohepphhgsh hqlhdqghgvnhgvrhgrlheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 6 Dec 2024 17:26:30 -0500 (EST) Message-ID: <1fc6909b-0b22-4b56-8f4e-4b2107e4572e@aklaver.com> Date: Fri, 6 Dec 2024 14:26:30 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: tds_fdw DB-Library error: DB #: 20002, DB Msg: Adaptive Server connection failed To: "Zacher, Stacy" , "pgsql-general@lists.postgresql.org" References: <8dc1be7b-1a1b-4286-b939-12f60e906a4c@aklaver.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/6/24 14:10, Zacher, Stacy wrote: > Hi Adrian: > > Please see my replies below: ** > > Thank you! > Stacy > -----Original Message----- > From: Adrian Klaver > Sent: Friday, December 6, 2024 3:51 PM > To: Zacher, Stacy ; pgsql-general@lists.postgresql.org > Subject: Re: tds_fdw DB-Library error: DB #: 20002, DB Msg: Adaptive Server connection failed > > ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. > ________________________________ > > On 12/6/24 13:19, Zacher, Stacy wrote: >> Hello: >> >> We recently did an OS upgrade from Rocky Linux 8 to 9 on a Postgres >> v13 server that has 2 Foreign data wrappers that use tds_fdw for >> connections to 2 different SQL Servers. >> >> After the OS upgrade, one of the FDWs stopped working for some reason >> but the other one still works. >> >> The error message when trying to run the import statement in psql is >> as follows (I changed some of the names): >> >> using psql: >> > >> I tested connecting to the server/port via ncat and it returns >> successfully. >> >> When I try sqlcmd or tsql, The 1477 port is static (vs. dynamic) >> >> [postgres@rh9server bin]$ ./sqlcmd -S 141.xxx.x.xxx,1477 -C -d >> Pdata_db -U PData_Reader -P xxxxxxxxxxxxxx >> >> Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : TCP Provider: >> Error code 0x2746. > > Some searching mentions that this 'TCP Provider: Error code 0x2746.' can be related to lack of TLS 1.2 support. > > I don't see your tsql connection attempt. > > ** Here is the tsql attempt: > tsql -H mysqlserver.somedomain.net -p 1477 -U 'PData_Reader' -P 'xxxxxxxxxxxxxx' > locale is "en_US.UTF-8" > locale charset is "UTF-8" > using default charset "UTF-8" > Error 20002 (severity 9): > Adaptive Server connection failed > Error 20002 (severity 9): > Adaptive Server connection failed > There was a problem connecting to the server From this: http://software.firstworks.com/2017/04/tlsssl-encryption-with-ms-sql-server.html "Connect to the database from the application server using the FreeTDS-supplied tsql program as follows: tsql -S EXAMPLEDB -U exampleuser -P examplepass If the connection fails, it will most likely fail with: Error 20002 (severity 9): Adaptive Server connection failed Which isn't very helpful. Running tsql with TDSDUMP enabled... TDSDUMP=stdout tsql -S EXAMPLEDB -U exampleuser -P examplepass ...may be slightly more revealing. " > >> The FDW that is still working is going to a SQL Server v14.x 2017 >> server and the broken one is going to a SQL Server version 13 2016 server. > > Are the SQL Server instances running on the same machine? > ** No, they are two different servers. > > If not what versions of Windows are they using in each case? > ** The broken FDW to the SQL server 2016 is running on Windows 2012 R2 > ** The one that works is running on is running SQL Server 2017 on Windows Server 2016 Datacenter > >> >> Also, I recreated the FDW that is broken on another server (Postgres >> 16 on Rocky Linux 8) and it works there. >> >> So I'm puzzled here as to why it's not working on the upgraded server, >> yet the other FDW on the same server still works. >> >> Any help on this issue would be greatly appreciated. >> >> Thank you, >> >> Stacy >> >> szacher@mcw.edu >> > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com