Has anyone experienced the behavior of pgloader hanging when the .conf
file has an incorrect filename?
When I execute with the correct filename, everything works just fine.
However, when I use an incorrect filename, I get the below:
PG_DB> pgloader -c hangs.pgload.conf -v
pgloader INFO Logger initialized
pgloader INFO Reformat path is
['/usr/share/python-support/pgloader/reformat']
pgloader INFO Will consider following sections:
pgloader INFO emaillistuploaddata
emaillistuploaddata INFO emaillistuploaddata processing
pgloader INFO All threads are started, wait for them to
terminate
emaillistuploaddata ERROR [Errno 2] No such file or directory:
'mb2.up.txt.complete'
Exception in thread emaillistuploaddata:
Traceback (most recent call last):
File "/usr/lib64/python2.4/threading.py", line 442, in __bootstrap
self.run()
File "/usr/share/python-support/pgloader/pgloader/pgloader.py", line
840, in run
self.process()
File "/usr/share/python-support/pgloader/pgloader/pgloader.py", line
1201, in process
self.data_import()
File "/usr/share/python-support/pgloader/pgloader/pgloader.py", line
1220, in data_import
for offsets, line, columns in self.readlines():
File "/usr/share/python-support/pgloader/pgloader/pgloader.py", line
1138, in readlines
for offsets, line, columns in self.reader.readlines():
File "/usr/share/python-support/pgloader/pgloader/textreader.py", line
86, in readlines
check_count = False)
File "/usr/share/python-support/pgloader/pgloader/reader.py", line
192, in __init__
raise PGLoader_Error, error
PGLoader_Error: [Errno 2] No such file or directory:
'mb2.up.txt.complete'
Here is my hangs.pgload.conf file (I named it 'hangs' because I
intentionally inserted an invalid filename):
[pgsql]
host = localhost
port = 5432
base = PG_DB
user = pg_user
pass = None
log_file = /tmp/0000.pgload.log
log_min_messages = DEBUG
client_min_messages = WARNING
lc_messages = C
;client_encoding = 'utf-8'
client_encoding = 'latin1'
copy_every = 100000
commit_every = 100000
null = ""
empty_string = "\ "
max_parallel_sections = 10
[emaillistuploaddata]
table = emaillistuploaddata
format = text
filename = mb2.up.txt.complete
field_sep = |
skip_head_lines = 0
columns = listid,data
We would expect pgloader to kick back an error and exit if the source
file could not be found.
Thanks.