dimitri / pgloader

Migrate to PostgreSQL in a single command!
http://pgloader.io
Other
5.45k stars 548 forks source link

cannot connect to mssql if servername has backslash #1628

Closed patAtBwalk closed 23 hours ago

patAtBwalk commented 1 day ago

Thanks for contributing to pgloader by reporting an issue! Reporting an issue is the only way we can solve problems, fix bugs, and improve both the software and its user experience in general.

The best bug reports follow those 3 simple steps:

  1. show what you did,

run this command (names\secrets obfuscated): pgloader --verbose --debug --type "mssql mssql://Supabase_User:[MY_SECRET]@[SERVERNAME]\DEV:1433/[DBNAME]" "postgresql://postgres.[MY_SERVER]:[MY_SECRET]@aws-0-ca-central-1.pooler.supabase.com:6543/postgres"

issue appears to be the backslash character in the mssql connection string: [SERVERNAME]\DEV it keeps stripping out the backslash or failing to parse.

  1. show the result you got,
    
    2024-11-21T00:27:08.010000Z NOTICE Starting pgloader, log system is ready.
    2024-11-21T00:27:08.019999Z INFO Starting monitor
    2024-11-21T00:27:08.019999Z LOG pgloader version "3.6.7~devel"
    2024-11-21T00:27:08.019999Z INFO     SOURCE: "mssql://Supabase_User:[MY_SECRET]@[SERVERNAME]DEV:1433/[DBNAME]"
    2024-11-21T00:27:08.019999Z INFO SOURCE URI: #<PGLOADER.SOURCE.MSSQL:MSSQL-CONNECTION mssql://Supabase_User@[SERVERNAME]DEV:1433/[DBNAME] {1005DCA353}>
    2024-11-21T00:27:08.019999Z INFO     TARGET: "postgresql://postgres.[MY_SECRET]:bjubnw9tvh8FTYchz@aws-0-ca-central-1.pooler.supabase.com:6543/postgres"
    2024-11-21T00:27:08.019999Z INFO TARGET URI: #<PGLOADER.PGSQL:PGSQL-CONNECTION pgsql://postgres.[MY_SECRET]@aws-0-ca-central-1.pooler.supabase.com:6543/postgres {1005FA8FE3}>
    2024-11-21T00:27:08.019999Z DEBUG LOAD DATA FROM #<PGLOADER.SOURCE.MSSQL:MSSQL-CONNECTION mssql://Supabase_User@[SERVERNAME]DEV:1433/[DBNAME] {1005DCA353}>
    2024-11-21T00:27:08.399990Z DEBUG CONNECTED TO #<PGLOADER.PGSQL:PGSQL-CONNECTION pgsql://postgres.[MY_SECRET]@aws-0-ca-central-1.pooler.supabase.com:6543/postgres {1005FA8FE3}>
    2024-11-21T00:27:08.399990Z DEBUG SET client_encoding TO 'utf8'
    2024-11-21T00:27:08.539878Z DEBUG SET application_name TO 'pgloader'
    2024-11-21T00:27:08.939555Z LOG Migrating from #<MSSQL-CONNECTION mssql://Supabase_User@[SERVERNAME]DEV:1433/[DBNAME] {1005DCA353}>
    2024-11-21T00:27:08.939555Z LOG Migrating into #<PGSQL-CONNECTION pgsql://postgres.[MY_SECRET]@aws-0-ca-central-1.pooler.supabase.com:6543/postgres {1005FA8FE3}>
    2024-11-21T00:27:21.105024Z ERROR mssql: Failed to connect to mssql at "[SERVERNAME]DEV" (port 1433) as user "Supabase_User": Connection to the database failed for an unknown reason.
    2024-11-21T00:27:21.105024Z LOG report summary reset
    2024-11-21T00:27:21.114971Z INFO Stopping monitor

  5. explain how the result is not what you expected.
expect that I can escape the backslash with one of the following options I tried
- %5C
- /\
- \\

 pgloader --version  

user@LHAAVGHM:~$ pgloader --version pgloader version "3.6.7~devel" compiled with SBCL 2.2.9.debian



  - [x] did you test a fresh compile from the source tree?
    NO, just installed latest

  - [x] did you search for other similar issues?
  - YES, found nothing about escaping the server name other than what was attempted. GPT let me down too :(

  - [x] how can I reproduce the bug?
  - set up a mssql instance with a backslash in the name
patAtBwalk commented 23 hours ago

found some similar issues and will attempt those first.