dimitri / pgloader

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

Error: 30 fell through ECASE expression. Wanted one of (2 10) #1035

Open svetlyak40wt opened 4 years ago

svetlyak40wt commented 4 years ago
pgloader --verbose mysql://mysql-host.mycompany.net/f1db 'pgsql://pg-host.mycompany.net:6432/f1db?sslmode=require'
pgloader --verbose mysql://mysql-host.mycompany.net/f1db 'pgsql://pg-host.mycompany.net:6432/f1db?sslmode=require'
2019-10-10T09:27:30.016000+01:00 NOTICE Starting pgloader, log system is ready.
2019-10-10T09:27:30.021000+01:00 LOG pgloader version "3.6.1"
2019-10-10T09:27:30.023000+01:00 LOG Data errors in '/private/tmp/pgloader/'
KABOOM!
FATAL error: Failed to connect to pgsql at "pg-host.mycompany.net" (port 6432) as user "art": 30 fell through ECASE expression. Wanted one of (2 10).
An unhandled error condition has been signalled:
   Failed to connect to pgsql at "pg-host.mycompany.net" (port 6432) as user "art": 30 fell through ECASE expression. Wanted one of (2 10).

What I am doing here?

Failed to connect to pgsql at "pg-host.mycompany.net" (port 6432) as user "art": 30 fell through ECASE expression. Wanted one of (2 10).

Here is the stacktrace obtained from running pgloader:main in the REPL:

Failed to connect to pgsql at "pg-host.mycompany.net" (port 6432) as user "art": 30 fell through ECASE expression. Wanted one of (2 10).
   [Condition of type DB-CONNECTION-ERROR]

Restarts:
 0: [RETRY] Retry SLY mREPL evaluation request.
 1: [*ABORT] Return to SLY's top level.
 2: [ABORT] abort thread (#<THREAD "sly-channel-1-mrepl-remote-1" RUNNING {1003BFC2D3}>)

Backtrace:
 0: ((FLET "FUN26" :IN LIST-RESERVED-KEYWORDS) #<SB-KERNEL:CASE-FAILURE expected-type: (MEMBER 2 10) datum: 30>)
      Locals:
        SB-FORMAT::FORMAT-ARG1 = #<SB-KERNEL:CASE-FAILURE expected-type: (MEMBER 2 10) datum: 30>
        PGLOADER.PGSQL::PGCONN = #<PGSQL-CONNECTION pgsql://art@pg-host.mycompany.net:6432/f1db {1005B17803}>
        #:|conn1| = #<PGSQL-CONNECTION pgsql://art@pg-host.mycompany.net:6432/f1db {1005B17803}>
 1: (LIST-RESERVED-KEYWORDS #<PGSQL-CONNECTION pgsql://art@pg-host.mycompany.net:6432/f1db {1005B17803}>)
      Locals:
        #:CELL28 = (:CONDITION . #<SB-KERNEL:CASE-FAILURE expected-type: (MEMBER 2 10) datum: 30>)
        PGCONN = #<PGSQL-CONNECTION pgsql://art@pg-host.mycompany.net:6432/f1db {1005B17803}>
        #:|conn1| = #<PGSQL-CONNECTION pgsql://art@pg-host.mycompany.net:6432/f1db {1005B17803}>
 2: ((LAMBDA ()))
      [No Locals]
 3: (RUN-COMMANDS (LAMBDA NIL (LET* (# # # # # # ...) NIL (PGLOADER.LOAD:COPY-DATABASE PGLOADER.PARSER::SOURCE :INCLUDING # :EXCLUDING # ...) NIL)) :START-LOGGER NIL :FLUSH-SUMMARY T :SUMMARY NIL :LOG-FIL..
      Locals:
        #:.DEFAULTING-TEMP. = NIL
        #:.DEFAULTING-TEMP.#1 = T
        #:.DEFAULTING-TEMP.#2 = NIL
        #:.DEFAULTING-TEMP.#3 = NIL
        #:.DEFAULTING-TEMP.#4 = NIL
        #:.DEFAULTING-TEMP.#5 = NIL
        FLUSH-SUMMARY = T
        FUNC = #<FUNCTION (LAMBDA ()) {231E86CB}>
        FUNCS = (#<FUNCTION (LAMBDA ()) {231E86CB}>)
        #:LOOP-LIST-23 = NIL
        #:N-SUPPLIED-0 = 0
        #:N-SUPPLIED-1 = 0
        #:N-SUPPLIED-2 = 0
        #:N-SUPPLIED-3 = 0
        SOURCE = (LAMBDA () ..)
        START-LOGGER = NIL
 4: (LOAD-DATA :FROM #<MYSQL-CONNECTION mysql://art@mysql-host.mycompany.net:3306/f1db {1005B0E2C3}> :INTO #<PGSQL-CONNECTION pgsql://art@pg-host.mycompany.net:6432/f1db {1005B17803..
 5: (PROCESS-SOURCE-AND-TARGET "mysql://mysql-host.mycompany.net/f1db" "pgsql://art@pg-host.mycompany.net:6432/f1db?sslmode=require" NIL NIL NIL NIL NIL NIL NIL NIL)
 6: ((LAMBDA NIL :IN MAIN))
 7: (PGLOADER.MONITOR::CALL-WITH-MONITOR #<CLOSURE (LAMBDA NIL :IN MAIN) {1005AFE28B}>)
 8: ((FLET "FORM-FUN-62" :IN MAIN))
 9: (MAIN ("pgloader" "mysql://mysql-host.mycompany.net/f1db" "pgsql://art@pg-host.mycompany.net:6432/f1db?sslmode=require") :INTERACTIVE T)
10: (SB-INT:SIMPLE-EVAL-IN-LEXENV (MAIN (LIST "pgloader" "mysql://mysql-host.mycompany.net/f1db" "pgsql://art@pg-host.mycompany.net:6432/f1db?sslmode=require") :INTERACTIVE T) #<NUL..
11: (EVAL (MAIN (LIST "pgloader" "mysql://mysql-host.mycompany.net/f1db" "pgsql://art@pg-host.mycompany.net:6432/f1db?sslmode=require") :INTERACTIVE T))
12: ((LAMBDA NIL :IN SLYNK-MREPL::MREPL-EVAL-1))
dimitri commented 4 years ago

If I had to guess, I would blame https://github.com/marijnh/Postmodern/blob/master/cl-postgres/public.lisp#L114 and try to understand what kind of connection you have here if it's neither ipv4 (2) nor ipv6 (10). What does it mean if (sb-bsd-sockets:host-ent-address-type host-ent) is 30?

Are you in a position to hack and find out?

svetlyak40wt commented 4 years ago

Right now don't have time, sorry.

jw1u1 commented 1 year ago

Same here @dimitri pgloader --version pgloader version "3.6.7~devel" compiled with SBCL 2.1.1.debian

2022-11-17T15:09:38.084001Z LOG Migrating from #<PGSQL-CONNECTION pgsql://pgmigrator@foo:5432/bar {100640D873}> ... 2022-11-17T15:09:38.108001Z ERROR pgsql: Failed to connect to pgsql at "foo" (port 5432) as user "pgmigrator": 10 fell through ECASE expression. Wanted one of (0 2 3 4 5 6 7 8).

This is ipv4 and trust is not an option.