Pgloader: mysql -> postgres error

Created on 29 Feb 2016  Â·  16Comments  Â·  Source: dimitri/pgloader

I installed pgloader through the docker image docker pull dimitri/pgloader and can't connect to postgresql when I run pgloader. Here's the error log:

$ pgloader --logfile ~/pgloader/resources/pgloader_sct_load.log 'mysql://root@localhost:3306/sct2016' 'postgres://snomedct:sct2016@localhost/snomedct'

An unhandled error condition has been signalled:
   Failed to connect to pgsql at "localhost" (port 5432) as user "snomedct": Database error: Socket error in "connect": ECONNREFUSED (Connection refused)

An unhandled error condition has been signalled:
   Failed to connect to pgsql at "localhost" (port 5432) as user "snomedct": Database error: Socket error in "connect": ECONNREFUSED (Connection refused)

; 
; compilation unit aborted
;   caught 1 fatal ERROR condition

I have postgresql 9.5 running in port 5432, and here's the relevant part of my local pg_hba.conf:

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5

Any ideas on how to fix this? The logfile I specified also isn't created, so I'm unable to give a more detailed log.

How To... Question

All 16 comments

Is the PostgreSQL instance running in the same docker container as pgloader? (what means localhost here actually) Also, you can use --verbose or even --debug to try and have more information on the console, but it fails quite early, not sure you will have anything more interesting really.

It's not in the same docker container. What should I set as the hostname, then?

Here's the debug log:

[~]$ pgloader --debug --logfile ~/pgloader/resources/pgloader_sct_load.log 'mysql://root@localhost:3306/sct2016' 'postgres://snomedct:sct2016@localhost/snomedct'
mkdir -p #P"/tmp/pgloader/"
sb-impl::*default-external-format* :ANSI_X3.4-1968
tmpdir: #P"/tmp/pgloader/"
2016-02-29T23:12:46.023000Z NOTICE Starting pgloader, log system is ready.
2016-02-29T23:12:46.036000Z INFO Starting monitor
2016-02-29T23:12:46.040000Z LOG Main logs in '/home/brian/pgloader/resources/snomed_transitive_closure/pgloader_sct_load.log'
2016-02-29T23:12:46.040000Z LOG Data errors in '/tmp/pgloader/'
2016-02-29T23:12:46.040000Z INFO SOURCE: "mysql://root@localhost:3306/sct2016"
2016-02-29T23:12:46.040000Z INFO TARGET: "postgres://snomedct:sct2016@localhost/snomedct"
2016-02-29T23:12:46.040000Z DEBUG LOAD DATA FROM #<PGLOADER.MYSQL:MYSQL-CONNECTION mysql://root@localhost:3306/sct2016 {1008D385C3}>
An unhandled error condition has been signalled:
   Failed to connect to pgsql at "localhost" (port 5432) as user "snomedct": Database error: Socket error in "connect": ECONNREFUSED (Connection refused)

Date/time: 2016-02-29-23:12An unhandled error condition has been signalled:
                              Failed to connect to pgsql at "localhost" (port 5432) as user "snomedct": Database error: Socket error in "connect": ECONNREFUSED (Connection refused)


Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1008AFE543}>
0: ((LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX))
1: (SB-IMPL::CALL-WITH-SANE-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {10097887DB}>)
2: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {10097887AB}>)
3: (PRINT-BACKTRACE :STREAM #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDOUT* {100029DA03}> :START 0 :FROM :DEBUGGER-FRAME :COUNT 4611686018427387903 :PRINT-THREAD T :PRINT-FRAME-SOURCE NIL :METHOD-FRAME-STYLE NIL)
4: (TRIVIAL-BACKTRACE:PRINT-BACKTRACE-TO-STREAM #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDOUT* {100029DA03}>)
5: (TRIVIAL-BACKTRACE:PRINT-BACKTRACE #<PGLOADER.CONNECTION:DB-CONNECTION-ERROR {1009781CE3}> :OUTPUT #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDOUT* {100029DA03}> :IF-EXISTS :APPEND :VERBOSE T)
6: (SIGNAL #<PGLOADER.CONNECTION:DB-CONNECTION-ERROR {1009781CE3}>)
7: (ERROR PGLOADER.CONNECTION:DB-CONNECTION-ERROR :MESG "Database error: Socket error in \"connect\": ECONNREFUSED (Connection refused)" :TYPE "pgsql" :HOST "localhost" :PORT 5432 :USER "snomedct")
8: (PGLOADER.PGSQL:LIST-RESERVED-KEYWORDS #<PGLOADER.PGSQL:PGSQL-CONNECTION pgsql://snomedct@localhost:5432/snomedct {1008E83FA3}>)
9: ((LAMBDA ()))
10: (PGLOADER:RUN-COMMANDS (LAMBDA NIL (LET* ((PGLOADER.SOURCES:*DEFAULT-CAST-RULES* (QUOTE ((:SOURCE (:TYPE #1="int" :AUTO-INCREMENT T :TYPEMOD (< PGLOADER.TRANSFORMS:PRECISION 10)) :TARGET (:TYPE #2="serial")) (:SOURCE (:TYPE #1# :AUTO-INCREMENT T :TYPEMOD (<= 10 PGLOADER.TRANSFORMS:PRECISION)) :TARGET (:TYPE #3="bigserial")) (:SOURCE (:TYPE #1# :AUTO-INCREMENT NIL :TYPEMOD (< PGLOADER.TRANSFORMS:PRECISION 10)) :TARGET (:TYPE #1#)) (:SOURCE (:TYPE #1# :AUTO-INCREMENT NIL :TYPEMOD (<= 10 PGLOADER.TRANSFORMS:PRECISION)) :TARGET (:TYPE #4="bigint")) (:SOURCE (:TYPE #5="tinyint" :AUTO-INCREMENT T) :TARGET (:TYPE #2#)) (:SOURCE (:TYPE #6="smallint" :AUTO-INCREMENT T) :T
ARGET (:TYPE #2#)) (:SOURCE (:TYPE #7="mediumint" :AUTO-INCREMENT T) :TARGET (:TYPE #2#)) (:SOURCE (:TYPE #4# :AUTO-INCREMENT T) :TARGET (:TYPE #3#)) (:SOURCE (:TYPE #5# :TYPEMOD (= 1 PGLOADER.TRANSFORMS:PRECISION)) :TARGET (:TYPE #8="boolean" :DROP-TYPEMOD T) :USING PGLOADER.TRANSFORMS::TINYINT-TO-BOOLEAN) (:SOURCE (:TYPE "bit" :TYPEMOD (= 1 PGLOADER.TRANSFORMS:PRECISION)) :TARGET (:TYPE #8# :DROP-TYPEMOD T) :USING PGLOADER.TRANSFORMS::BITS-TO-BOOLEAN) (:SOURCE (:TYPE #4# :TYPEMOD (< 19 PGLOADER.TRANSFORMS:PRECISION)) :TARGET (:TYPE #9="numeric" :DROP-TYPEMOD T)) (:SOURCE (:TYPE #5#) :TARGET (:TYPE #6# :DROP-TYPEMOD T)) (:SOURCE (:TYPE #6#) :TARGET (:TYPE #6# :DROP-
TYPEMOD T)) (:SOURCE (:TYPE #7#) :TARGET (:TYPE #10="integer" :DROP-TYPEMOD T)) (:SOURCE (:TYPE #10#) :TARGET (:TYPE #10# :DROP-TYPEMOD T)) (:SOURCE (:TYPE #11="float") :TARGET (:TYPE #11# :DROP-TYPEMOD T)) (:SOURCE (:TYPE #4#) :TARGET (:TYPE #4# :DROP-TYPEMOD T)) (:SOURCE (:TYPE "double") :TARGET (:TYPE "double precision" :DROP-TYPEMOD T)) (:SOURCE (:TYPE #9#) :TARGET (:TYPE #9# :DROP-TYPEMOD NIL)) (:SOURCE (:TYPE #12="decimal") :TARGET (:TYPE #12# :DROP-TYPEMOD NIL)) (:SOURCE (:TYPE "tinytext") :TARGET (:TYPE #13="text") :USING PGLOADER.TRANSFORMS::REMOVE-NULL-CHARACTERS) (:SOURCE (:TYPE #13#) :TARGET (:TYPE #13#) :USING PGLOADER.TRANSFORMS::REMOVE-NULL-CHARACTERS)
 (:SOURCE (:TYPE "mediumtext") :TARGET (:TYPE #13#) :USING PGLOADER.TRANSFORMS::REMOVE-NULL-CHARACTERS) (:SOURCE (:TYPE "longtext") :TARGET (:TYPE #13#) :USING PGLOADER.TRANSFORMS::REMOVE-NULL-CHARACTERS) (:SOURCE (:TYPE #14="varchar") :TARGET (:TYPE #14# :DROP-TYPEMOD NIL) :USING PGLOADER.TRANSFORMS::REMOVE-NULL-CHARACTERS) (:SOURCE (:TYPE #15="char") :TARGET (:TYPE #15# :DROP-TYPEMOD NIL) :USING PGLOADER.TRANSFORMS::REMOVE-NULL-CHARACTERS) (:SOURCE (:TYPE "binary") :TARGET (:TYPE #16="bytea") :USING PGLOADER.TRANSFORMS::BYTE-VECTOR-TO-BYTEA) (:SOURCE (:TYPE "varbinary") :TARGET (:TYPE #16#) :USING PGLOADER.TRANSFORMS::BYTE-VECTOR-TO-BYTEA) (:SOURCE (:TYPE "tinyblob
") :TARGET (:TYPE #16#) :USING PGLOADER.TRANSFORMS::BYTE-VECTOR-TO-BYTEA) (:SOURCE (:TYPE "blob") :TARGET (:TYPE #16#) :USING PGLOADER.TRANSFORMS::BYTE-VECTOR-TO-BYTEA) (:SOURCE (:TYPE "mediumblob") :TARGET (:TYPE #16#) :USING PGLOADER.TRANSFORMS::BYTE-VECTOR-TO-BYTEA) (:SOURCE (:TYPE "longblob") :TARGET (:TYPE #16#) :USING PGLOADER.TRANSFORMS::BYTE-VECTOR-TO-BYTEA) (:SOURCE (:TYPE #17="datetime" :DEFAULT #18="0000-00-00 00:00:00" :NOT-NULL T) :TARGET (:TYPE #19="timestamptz" :DROP-DEFAULT T :DROP-NOT-NULL T) :USING PGLOADER.TRANSFORMS::ZERO-DATES-TO-NULL) (:SOURCE (:TYPE #17# :DEFAULT #18#) :TARGET (:TYPE #19# :DROP-DEFAULT T) :USING PGLOADER.TRANSFORMS::ZERO-DATES-
TO-NULL) (:SOURCE (:TYPE #20="timestamp" :DEFAULT #18# :NOT-NULL T) :TARGET (:TYPE #19# :DROP-DEFAULT T :DROP-NOT-NULL T) :USING PGLOADER.TRANSFORMS::ZERO-DATES-TO-NULL) (:SOURCE (:TYPE #20# :DEFAULT #18#) :TARGET (:TYPE #19# :DROP-DEFAULT T) :USING PGLOADER.TRANSFORMS::ZERO-DATES-TO-NULL) (:SOURCE (:TYPE #21="date" :DEFAULT "0000-00-00") :TARGET (:TYPE #21# :DROP-DEFAULT T) :USING PGLOADER.TRANSFORMS::ZERO-DATES-TO-NULL) (:SOURCE (:TYPE #21#) :TARGET (:TYPE #21#)) (:SOURCE (:TYPE "year") :TARGET (:TYPE #10# :DROP-TYPEMOD T)) (:SOURCE (:TYPE #17#) :TARGET (:TYPE #19#) :USING PGLOADER.TRANSFORMS::ZERO-DATES-TO-NULL) (:SOURCE (:TYPE #20#) :TARGET (:TYPE #19#) :USING PG
LOADER.TRANSFORMS::ZERO-DATES-TO-NULL) (:SOURCE (:TYPE "enum") :TARGET (:TYPE #<FUNCTION PGLOADER.MYSQL::CAST-ENUM>)) (:SOURCE (:TYPE "set") :TARGET (:TYPE #<FUNCTION PGLOADER.MYSQL::CAST-SET>) :USING PGLOADER.TRANSFORMS::SET-TO-ENUM-ARRAY) (:SOURCE (:TYPE #22="point") :TARGET (:TYPE #22#) :USING PGLOADER.TRANSFORMS::CONVERT-MYSQL-POINT)))) (PGLOADER.SOURCES:*CAST-RULES* (QUOTE NIL)) (PGLOADER.MYSQL:*DECODING-AS* (QUOTE NIL)) (PGLOADER.PARAMS:*PG-SETTINGS* (PGLOADER.PGSQL:SANITIZE-USER-GUCS (QUOTE NIL))) (PGLOADER.PARAMS:*PGSQL-RESERVED-KEYWORDS* (PGLOADER.PGSQL:LIST-RESERVED-KEYWORDS #23=#<PGLOADER.PGSQL:PGSQL-CONNECTION pgsql://snomedct@localhost:5432/snomedct {100
8E83FA3}>)) (PGLOADER.PARAMS:*COPY-BATCH-ROWS* (OR NIL PGLOADER.PARAMS:*COPY-BATCH-ROWS*)) (PGLOADER.PARAMS:*COPY-BATCH-SIZE* (OR NIL PGLOADER.PARAMS:*COPY-BATCH-SIZE*)) (PGLOADER.PARAMS:*CONCURRENT-BATCHES* (OR NIL PGLOADER.PARAMS:*CONCURRENT-BATCHES*)) (PGLOADER.PARAMS:*IDENTIFIER-CASE* (OR NIL PGLOADER.PARAMS:*IDENTIFIER-CASE*)) (PGLOADER.PARSER::SOURCE (MAKE-INSTANCE (QUOTE PGLOADER.MYSQL:COPY-MYSQL) :TARGET-DB #23# :SOURCE-DB #<PGLOADER.MYSQL:MYSQL-CONNECTION mysql://root@localhost:3306/sct2016 {1008D385C3}>))) NIL (PGLOADER.SOURCES:COPY-DATABASE PGLOADER.PARSER::SOURCE :INCLUDING (QUOTE NIL) :EXCLUDING (QUOTE NIL) :MATERIALIZE-VIEWS (QUOTE NIL) :SET-TABLE-OIDS 
T) NIL)) :START-LOGGER NIL :SUMMARY NIL :LOG-FILENAME NIL :LOG-MIN-MESSAGES NIL :CLIENT-MIN-MESSAGES NIL)
11: (PGLOADER:LOAD-DATA :FROM #<PGLOADER.MYSQL:MYSQL-CONNECTION mysql://root@localhost:3306/sct2016 {1008D385C3}> :INTO #<PGLOADER.PGSQL:PGSQL-CONNECTION pgsql://snomedct@localhost:5432/snomedct {1008E83FA3}> :ENCODING :UTF-8 :FIELDS NIL :OPTIONS NIL :GUCS NIL :CASTS NIL :BEFORE NIL :AFTER NIL :START-LOGGER NIL)
12: ((FLET #:CLEANUP-FUN-272 :IN PGLOADER::MAIN)) [cleanup]
13: (PGLOADER::MAIN ("pgloader" "--debug" "--logfile" "/home/brian/pgloader/resources/snomed_transitive_closure/pgloader_sct_load.log" "mysql://root@localhost:3306/sct2016" "postgres://snomedct:sct2016@localhost/snomedct"))
14: ((LAMBDA NIL :IN "/opt/src/pgloader/dumper-2SKVI5f7.lisp"))
15: ((FLET #:WITHOUT-INTERRUPTS-BODY-89 :IN SAVE-LISP-AND-DIE))
16: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))

An unhandled error condition has been signalled:
   Failed to connect to pgsql at "localhost" (port 5432) as user "snomedct": Database error: Socket error in "connect": ECONNREFUSED (Connection refused)

Date/time: 2016-02-29-23:12An unhandled error condition has been signalled:
                              Failed to connect to pgsql at "localhost" (port 5432) as user "snomedct": Database error: Socket error in "connect": ECONNREFUSED (Connection refused)


Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1008AFE543}>
0: ((LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX))
1: (SB-IMPL::CALL-WITH-SANE-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {10097EC77B}>)
2: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {10097EC74B}>)
3: (PRINT-BACKTRACE :STREAM #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDOUT* {100029DA03}> :START 0 :FROM :DEBUGGER-FRAME :COUNT 4611686018427387903 :PRINT-THREAD T :PRINT-FRAME-SOURCE NIL :METHOD-FRAME-STYLE NIL)
4: (TRIVIAL-BACKTRACE:PRINT-BACKTRACE-TO-STREAM #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDOUT* {100029DA03}>)
5: (TRIVIAL-BACKTRACE:PRINT-BACKTRACE #<PGLOADER.CONNECTION:DB-CONNECTION-ERROR {1009781CE3}> :OUTPUT #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDOUT* {100029DA03}> :IF-EXISTS :APPEND :VERBOSE T)
6: ((FLET #:CLEANUP-FUN-272 :IN PGLOADER::MAIN)) [cleanup]
7: (PGLOADER::MAIN ("pgloader" "--debug" "--logfile" "/home/brian/savannahinformatics/resources/snomed_transitive_closure/pgloader_sct_load.log" "mysql://root@localhost:3306/sct2016" "postgres://snomedct:sct2016@localhost/snomedct"))
8: ((LAMBDA NIL :IN "/opt/src/pgloader/dumper-2SKVI5f7.lisp"))
9: ((FLET #:WITHOUT-INTERRUPTS-BODY-89 :IN SAVE-LISP-AND-DIE))
10: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))


Well my understanding is that if it's not in the same container, it can't be localhost. After that, you need to see about your container's network settings, can't help you there...

Closing as I don't think your issue has anything to do with pgloader itself, please feel free to ask for more advice here if needed, or to re-open if you find it's actually something to do with pgloader.

I've decided to build from source. I don't really want to go down the docker rabbithole as I'm quite constrained for time. The problem I'm having now is libsybdb.so: cannot open shared object file: No such file or directory.

sbcl --noinform --no-sysinit --no-userinit --load build/quicklisp/setup.lisp                 \
             --eval '(push "/home/brian/git/pgloader/" asdf:*central-registry*)'      \
             --eval '(ql:quickload "pgloader")'                     \
             --eval '(quit)'
To load "pgloader":
  Load 1 ASDF system:
    pgloader
; Loading "pgloader"
.............................
debugger invoked on a LOAD-FOREIGN-LIBRARY-ERROR in thread
#<THREAD "main thread" RUNNING {1002A4CD73}>:
  Unable to load foreign library (SYBDB).
  Error opening shared object "libsybdb.so":
  libsybdb.so: cannot open shared object file: No such file or directory.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [RETRY                        ] Try loading the foreign library again.
  1: [USE-VALUE                    ] Use another library instead.
  2: [SKIP                         ] Skip loading foreign library tds.
  3: [TRY-RECOMPILING              ] Recompile mssql and try loading it again
  4: [RETRY                        ] Retry
                                     loading FASL for #<CL-SOURCE-FILE "mssql" "src" "mssql">.
  5: [ACCEPT                       ] Continue, treating
                                     loading FASL for #<CL-SOURCE-FILE "mssql" "src" "mssql">
                                     as having been successful.
  6:                                 Retry ASDF operation.
  7: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  8: [ABORT                        ] Give up on "pgloader"
  9: [CONTINUE                     ] Ignore runtime option --eval "(ql:quickload \"pgloader\")".
 10:                                 Skip rest of --eval and --load options.
 11:                                 Skip to toplevel READ/EVAL/PRINT loop.
 12: [EXIT                         ] Exit SBCL (calling #'EXIT, killing the process).

(CFFI::FL-ERROR "Unable to load foreign library (~A).~%  ~A" SYBDB "Error opening shared object \"libsybdb.so\":
  libsybdb.so: cannot open shared object file: No such file or directory.")
0] 

I couldn't find freetds-dev for Ubuntu 14.04, so I installed tdsodbc.

On rebuilding, I ran /sbin/ldconfig -p /usr/local/lib | grep libsybdb, I get:
libsybdb.so.5 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libsybdb.so.5.

Symlinking with

sudo ln -s /usr/lib/x86_64-linux-gnu/libsybdb.so.5 /usr/lib/x86_64-linux-gnu/libsybdb.so

doesn't fix this.

Build was successful after cp /usr/lib/x86_64-linux-gnu/libsybdb.so.5 /usr/lib/x86_64-linux-gnu/libsybdb.so.

Now I'm seeing this after running
pgloader --debug --logfile ~/pgloader/resources/pgloader_sct_load.log 'mysql://root:mysql@localhost:3306/sct2016' 'postgres://snomedct:sct2016@localhost/snomedct'

  select c.table_name, t.table_comment,
         c.column_name, c.column_comment,
         c.data_type, c.column_type, c.column_default,
         c.is_nullable, c.extra
    from information_schema.columns c
         join information_schema.tables t using(table_schema, table_name)
   where c.table_schema = 'sct2016' and t.table_type = 'BASE TABLE'



order by table_name, ordinal_position
2016-03-01T09:49:38.286000+03:00 DEBUG MySQL: sending query: 
    SELECT tc.table_name, tc.constraint_name, k.referenced_table_name ft,

           group_concat(         k.column_name
                        order by k.ordinal_position) as cols,

           group_concat(         k.referenced_column_name
                        order by k.position_in_unique_constraint) as fcols,

           rc.update_rule, rc.delete_rule

      FROM information_schema.table_constraints tc

           JOIN information_schema.referential_constraints rc
             ON rc.constraint_schema = tc.table_schema
            AND rc.constraint_name = tc.constraint_name
            AND rc.table_name = tc.table_name

      LEFT JOIN information_schema.key_column_usage k
             ON k.table_schema = tc.table_schema
            AND k.table_name = tc.table_name
            AND k.constraint_name = tc.constraint_name

    WHERE     tc.table_schema = 'sct2016'
          AND k.referenced_table_schema = 'sct2016'
          AND tc.constraint_type = 'FOREIGN KEY'




 GROUP BY tc.table_name, tc.constraint_name, ft
2016-03-01T09:49:38.286000+03:00 FATAL We have a situation here.

Can you add more lines of output so that we see what situation we have? it should have a longer message about it in the output...

Having the same issue of not being able to connect to postgres:

root@wdh-003:~$pgloader mysql://root@localhost/mysql postgresql://postgres@localhost/postgres
2016-09-09T10:42:44.236000Z LOG Main logs in '/tmp/pgloader/pgloader.log'
2016-09-09T10:42:44.251000Z LOG Data errors in '/tmp/pgloader/'
An unhandled error condition has been signalled:
   Failed to connect to pgsql at "localhost" (port 5432) as user "postgres": Database error 28000: Ident authentication failed for user "postgres"

What I am missing not to get psql access?!!!
Thanks!

Try it with psql postgresql://postgres@localhost/postgres which should signal the same error. Then read the manual about connections settings in PostgreSQL and fix it for psql. Then it'll work also for pgloader.

okay thank ypu so much!

2016-09-10 16:05 GMT+00:00 Dimitri Fontaine [email protected]:

Try it with psql postgresql://postgres@localhost/postgres which should
signal the same error. Then read the manual about connections settings in
PostgreSQL and fix it for psql. Then it'll work also for pgloader.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/dimitri/pgloader/issues/348#issuecomment-246119960,
or mute the thread
https://github.com/notifications/unsubscribe-auth/APZMgq8iCwS-Xvtlzxf-nfNvYr-t1QWZks5qotVggaJpZM4Hl6y-
.

Steps for migrating using docker installation and uri connection strings, if databases are on your host:

  • Get the IP address of your host from the docker container:

    • run command $ docker run -it --rm alpine /sbin/ip route|awk '/default/ { print $3 }'

      That'll give you ip of the host. Probably it'll be 172.17.0.1

  • Allow remote access to mysql server:

    • Find mysqld.cnf file invoking $ locate mysqld.cnf

      Change the bind-address to *

    • Restart mysql server; $ systemctl restart mysql

    • Also check PRIVILEGES for the desired user - database - table binding (Command SHOW GRANTS FOR 'username'@'hostname'; could be used

  • Allow remote access to psql server:

    • For Psql version 9.5 check the file /etc/postgresql/9.5/main/postgresql.conf;

      Change the listen_addresses to *

    • Locate pg_hba.conf file and edit it: Add line host all all <host-ip>/16 trust and restart the server:

      systemctl restart postgresql.service

  • Now it's possible to launch pgloader:

    • docker run --security-opt seccomp=unconfined --rm --name pgloader dimitri/pgloader:latest pgloader mysql://user:pass@<host-ip>/dbname postgresql://user:pass@<host-ip>/dbname

Would you add a page about that in the wiki here at GitHub? Thanks!

@dimitri Hello, how should I name that page?

I've added it here: link. Please change the name to the appropriate one.

Apparently you can't edit page names. Maybe "Docker setup" would have been a good alternate name, the current one is pretty good for searching I think. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fabswt picture fabswt  Â·  5Comments

fernandoluizao picture fernandoluizao  Â·  4Comments

aa8y picture aa8y  Â·  7Comments

mmuruev picture mmuruev  Â·  4Comments

rap2hpoutre picture rap2hpoutre  Â·  5Comments