pgloader icon indicating copy to clipboard operation
pgloader copied to clipboard

"Connection to the database failed for an unknown reason." connection to MSSQL fails even when tsql succeeds

Open Anass954 opened this issue 2 months ago • 2 comments

connexion Issue with PgLoader :

~$ pgloader --debug --verbose --dry-run ms.load pgloader version 3.6.3~devel compiled with SBCL 2.1.11.debian sb-impl::default-external-format :UTF-8 tmpdir: #P"/tmp/pgloader/" 2025-10-14T10:42:02.004001Z NOTICE Starting pgloader, log system is ready. 2025-10-14T10:42:02.012001Z INFO Starting monitor 2025-10-14T10:42:02.016001Z LOG pgloader version "3.6.3~devel" 2025-10-14T10:42:02.040002Z INFO Parsed command: LOAD DATABASE FROM mssql://Test_Connexion:[email protected]:1433/BDD_PRE_PRODUCTION INTO pgsql://postgres:[email protected]:5432/my_bdd_test ;

2025-10-14T10:42:02.040002Z LOG Loading the FreeTDS shared librairy (sybdb) 2025-10-14T10:42:02.044002Z LOG DRY RUN, only checking connections. 2025-10-14T10:42:02.044002Z LOG Attempting to connect to #<MSSQL-CONNECTION mssql://[email protected]:1433/BDD_PRE_PRODUCTION {1007F983D3}> 2025-10-14T10:42:02.076004Z FATAL Failed to connect to #<MSSQL-CONNECTION mssql://[email protected]:1433/BDD_PRE_PRODUCTION {1007F983D3}>: Failed to connect to mssql at "VDRSQL2019.primever.local" (port 1433) as user "Test_Connexion": Connection to the database failed for an unknown reason. 2025-10-14T10:42:02.076004Z LOG Attempting to connect to #<PGSQL-CONNECTION pgsql://[email protected]:5432/my_bdd_test {1007F99113}> 2025-10-14T10:42:02.120006Z DEBUG CONNECTED TO #<PGLOADER.PGSQL:PGSQL-CONNECTION pgsql://[email protected]:5432/my_bdd_test {1007F99113}> 2025-10-14T10:42:02.124006Z LOG Success, opened #<PGSQL-CONNECTION pgsql://[email protected]:5432/my_bdd_test {1007F99113}>. 2025-10-14T10:42:02.124006Z LOG Running a simple query: SELECT 1; 2025-10-14T10:42:02.128006Z SQL SELECT 1; 2025-10-14T10:42:02.128006Z LOG report summary reset table name errors read imported bytes total time read write



2025-10-14T10:42:02.152007Z INFO Stopping monitor

Connexion with sqlcmd OK:

~$ /opt/mssql-tools18/bin/sqlcmd -S host2019.domaine.local -U "Test_Connexion" -P "Test...2025" 1> exit ~$

Anass954 avatar Oct 14 '25 10:10 Anass954

Have you tried without the hostname and using the ip address?

coreyman avatar Oct 21 '25 04:10 coreyman

using the IP address worked for me.

acnicholls avatar Oct 31 '25 01:10 acnicholls