Creating a Zato cluster using IPv6

Hey there!

I am trying to install Zato from the lastest sources inside a Docker container running Ubuntu 18.04, with PostgreSQL and Redis outside of the container, as per the tutorial which I posted here a while ago.

When running this command inside the Docker container:

zato@myhostname:~/zato$ mkdir --parents /opt/zato/env/qs-1
zato@myhostname:~/zato$ /opt/zato/zato/code/bin/zato quickstart create --odb_host [::1] --odb_port 5432 --odb_user zato --odb_db_name zato --odb_password '' --kvdb_password '' /opt/zato/env/qs-1/ postgresql [::1] 6379

I get this output and error:

2020-04-13 14:28:51,740 - INFO - 9933:MainThread - Create:319 - [1/9] Certificate authority created
[2/9] ODB schema already exists
2020-04-13 14:28:51,768 - INFO - 9933:MainThread - Create:327 - [2/9] ODB schema already exists
[3/9] ODB initial data created
2020-04-13 14:28:53,527 - INFO - 9933:MainThread - Create:345 - [3/9] ODB initial data created
[4/9] server1 created
2020-04-13 14:28:53,582 - INFO - 9933:MainThread - Create:377 - [4/9] server1 created
[5/9] server2 created
2020-04-13 14:28:53,615 - INFO - 9933:MainThread - Create:377 - [5/9] server2 created
[6/9] Load-balancer created
2020-04-13 14:28:53,617 - INFO - 9933:MainThread - Create:399 - [6/9] Load-balancer created
OperationalError: ('could not translate host name "[::1]" to address: Name or service not known\n',) (Hint: re-run with --verbose for full traceback)

I have tried both with and without square brackets []. Actually, without brackets you don’t get very far:

zato@myhostname:~/zato$ /opt/zato/zato/code/bin/zato quickstart create --odb_host ::1 --odb_port 5432 --odb_user zato --odb_db_name zato --odb_password '' --kvdb_password '' /opt/zato/env/qs-1/ postgresql ::1 6379
[1/9] Certificate authority created
2020-04-13 14:33:16,153 - INFO - 9991:MainThread - Create:319 - [1/9] Certificate authority created
ValueError: ("invalid literal for int() with base 10: ':1:5432'",) (Hint: re-run with --verbose for full traceback)
2020-04-13 14:33:16,155 - ERROR - 9991:MainThread - Create:675 - ValueError: ("invalid literal for int() with base 10: ':1:5432'",) (Hint: re-run with --verbose for full traceback)

Is Zato supposed to work using IPv6?

For your information, PSQL client can connect outside of the Docker container:

zato@ranma:~/zato$ psql --host=::1 --username=zato --dbname=zato --tuples-only --no-align --command="SELECT 1"
1

Thanks!

Hi @jsabater,

can you please run the command in the --verbose mode to check where this exception stems from?

Thanks.

Hey, Dariusz! Here you are!

zato@myhostname:~/zato$ /opt/zato/zato/code/bin/zato quickstart create --verbose --odb_host [::1] --odb_port 5432 --odb_user zato --odb_db_name zato --odb_password '' --kvdb_password '' /opt/zato/env/qs-1/ postgresql [::1] 6379
[1/9] Certificate authority created
2020-04-13 16:15:17,902 - INFO - 10212:MainThread - Create:319 - [1/9] Certificate authority created [2/9] ODB schema already exists
2020-04-13 16:15:17,940 - INFO - 10212:MainThread - Create:327 - [2/9] ODB schema already exists
[3/9] ODB initial data created
2020-04-13 16:15:20,697 - INFO - 10212:MainThread - Create:345 - [3/9] ODB initial data created
[4/9] server1 created
2020-04-13 16:15:20,816 - INFO - 10212:MainThread - Create:377 - [4/9] server1 created
[5/9] server2 created
2020-04-13 16:15:20,882 - INFO - 10212:MainThread - Create:377 - [5/9] server2 created
[6/9] Load-balancer created
2020-04-13 16:15:20,887 - INFO - 10212:MainThread - Create:399 - [6/9] Load-balancer created
File "/opt/zato/zato/code/bin/zato", line 11, in <module>
    load_entry_point('zato-cli', 'console_scripts', 'zato')()
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/zato_command.py", line 449, in main
    return run_command(args)
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/__init__.py", line 385, in run_command
    command_class[args.command](args).run(args)
  Traceback (most recent call last):
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
    self.connect()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/backends/base/base.py", line 171, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 175, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/psycopg2/__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not translate host name "[::1]" to address: Name or service not known


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/__init__.py", line 663, in run
    return_code = self.execute(args)
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/quickstart.py", line 419, in execute
    create_web_admin_args, False, web_admin_password, True)
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/create_web_admin.py", line 185, in execute
    call_command('migrate', run_syncdb=True, interactive=False, verbosity=0)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/core/management/__init__.py", line 119, in call_command
    return command.execute(*args, **defaults)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 89, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/migrations/executor.py", line 20, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in __init__
    self.build_graph()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/migrations/loader.py", line 176, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 65, in applied_migrations
    self.ensure_schema()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 52, in ensure_schema
    if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/backends/base/base.py", line 233, in cursor
    cursor = self.make_cursor(self._cursor())
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/backends/base/base.py", line 204, in _cursor
    self.ensure_connection()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
    self.connect()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/utils.py", line 95, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
    self.connect()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/backends/base/base.py", line 171, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 175, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/psycopg2/__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: could not translate host name "[::1]" to address: Name or service not known

Hm, it looks like psycopg2 not accepting an IPv6 address?

Yes, it does. But outside of the Docker container, on my own project, I can use SQLAlchemy’s create_engine() to connect to the PostgreSQL database and create the schema.

This is the connection string I have in my config.ini file:

[database]
uri = postgresql://genesisng@[::1]/genesisng

And this is the relevant part of the bit of code I am using in my script:

database_uri = config['database']['URI']
echo = config['database']['echo'] == 'True'
engine = create_engine(database_uri, echo=echo)
connection = engine.connect()
schema.base.Base.metadata.create_all(engine)

And it’s working fine.

This is the relevant part of the output of my project’s pip freeze:

psycopg2==2.8.5
psycopg2-binary==2.8.5

I see that Zato is currently using psycopg2 version 2.7.4 as per its requirements.txt file.

I’m going to check the changelog, see if I find anything in the 2.8 version…

I don’t see anything relevant in the changelog or the list of issues.

Dariusz, how’s the connection string built inside Django from the parametres received? From the log error it seems that the variable is reaching its destination correctly as [::1], so I take it that there must be something else at or around there…

Have you development or production sites running under IPv6?

I cannot think of any - most people prefer to use DNS.

Well, good news is that it does, indeed, work with IPv6 if using a host name:

$ /opt/zato/zato/code/bin/zato quickstart create --verbose --odb_host ip6-localhost --odb_port 5432 --odb_user zato --odb_db_name zato --odb_password '' --kvdb_password '' /opt/zato/env/qs-1/ postgresql ip6-localhost 6379
[1/9] Certificate authority created
2020-04-13 21:23:12,917 - INFO - 10307:MainThread - Create:319 - [1/9] Certificate authority created
[2/9] ODB schema already exists
2020-04-13 21:23:12,961 - INFO - 10307:MainThread - Create:327 - [2/9] ODB schema already exists
[3/9] ODB initial data created
2020-04-13 21:23:15,768 - INFO - 10307:MainThread - Create:345 - [3/9] ODB initial data created
[4/9] server1 created
2020-04-13 21:23:15,891 - INFO - 10307:MainThread - Create:377 - [4/9] server1 created
[5/9] server2 created
2020-04-13 21:23:15,965 - INFO - 10307:MainThread - Create:377 - [5/9] server2 created
[6/9] Load-balancer created
2020-04-13 21:23:15,969 - INFO - 10307:MainThread - Create:399 - [6/9] Load-balancer created
Superuser created successfully.
[7/9] Web admin created
[8/9] Scheduler created
[9/9] Management scripts created
Quickstart cluster quickstart-220606 created
Web admin user:[admin], password:[l6nB-eOPj_WsrkLfU28xabvBeYNdUXwE]
Start the cluster by issuing the /opt/zato/env/qs-1/zato-qs-start.sh command
Visit https://zato.io/support for more information and support options

Where ip6-localhost points at ::1 in the /etc/hosts file.

So I was trying to continue where I left it yesterday and found the next problem:

zato@ranma:~$ /opt/zato/env/qs-1/zato-qs-start.sh
Starting Zato cluster quickstart-190509
Checking configuration
InterfaceError: ("(pg8000.core.InterfaceError) ('communication error', ConnectionRefusedError(111, 'Connection refused'))",) (Hint: re-run with --verbose for full traceback)
2020-04-14 18:09:17,324 - ERROR - 361:MainThread - CheckConfig:675 - InterfaceError: ("(pg8000.core.InterfaceError) ('communication error', ConnectionRefusedError(111, 'Connection refused'))",) (Hint: re-run with --verbose for full traceback)

So I edited the /opt/zato/env/qs-1/zato-qs-start.sh file and added verbosity to the config checks:

echo Starting Zato cluster $CLUSTER
echo Checking configuration

$ZATO_BIN check-config $BASE_DIR/server1 --verbose
$ZATO_BIN check-config $BASE_DIR/server2 --verbose

echo [1/$STEPS] Redis connection OK
echo [2/$STEPS] SQL ODB connection OK

And this is what I got:

zato@ranma:~$ /opt/zato/env/qs-1/zato-qs-start.sh
Starting Zato cluster quickstart-190509
Checking configuration
File "/opt/zato/zato/code/bin/zato", line 11, in <module>
    load_entry_point('zato-cli', 'console_scripts', 'zato')()
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/zato_command.py", line 449, in main
    return run_command(args)
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/__init__.py", line 385, in run_command
    command_class[args.command](args).run(args)
  Traceback (most recent call last):
  File "/opt/zato/zato/code/lib/python3.6/site-packages/pg8000/core.py", line 1165, in __init__
    self._usock.connect((host, port))
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2276, in _wrap_pool_connect
    return fn()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 363, in connect
    return _ConnectionFairy._checkout(self)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
    rec = pool._do_get()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
    self._dec_overflow()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
    raise value
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
    return self._create_connection()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
    return _ConnectionRecord(self)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
    self.__connect(first_connect_check=True)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
    connection = pool._invoke_creator(self)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 482, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/pg8000/__init__.py", line 50, in connect
    application_name, max_prepared_statements, tcp_keepalive)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/pg8000/core.py", line 1178, in __init__
    raise InterfaceError("communication error", e)
pg8000.core.InterfaceError: ('communication error', ConnectionRefusedError(111, 'Connection refused'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/__init__.py", line 663, in run
    return_code = self.execute(args)
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/__init__.py", line 945, in execute
    return self._get_dispatch()[json_data['component']](args)
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/check_config.py", line 238, in _on_server
    self.check_sql_odb_server_scheduler(cm, server_conf, fs_sql_config, False)
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/check_config.py", line 88, in check_sql_odb_server_scheduler
    self.ping_sql(cm, engine_params, get_ping_query(fs_sql_config, engine_params))
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/check_config.py", line 68, in ping_sql
    session = create_pool(cm, engine_params, ping_query)
  File "/opt/zato/zato/code/zato-common/src/zato/common/odb/__init__.py", line 65, in create_pool
    engine.execute(ping_query)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2181, in execute
    connection = self._contextual_connect(close_with_result=True)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2242, in _contextual_connect
    self._wrap_pool_connect(self.pool.connect, None),
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2280, in _wrap_pool_connect
    e, dialect, self
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1547, in _handle_dbapi_exception_noconnection
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
    raise value.with_traceback(tb)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2276, in _wrap_pool_connect
    return fn()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 363, in connect
    return _ConnectionFairy._checkout(self)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
    rec = pool._do_get()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
    self._dec_overflow()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
    raise value
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
    return self._create_connection()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
    return _ConnectionRecord(self)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
    self.__connect(first_connect_check=True)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
    connection = pool._invoke_creator(self)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 482, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/pg8000/__init__.py", line 50, in connect
    application_name, max_prepared_statements, tcp_keepalive)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/pg8000/core.py", line 1178, in __init__
    raise InterfaceError("communication error", e)
sqlalchemy.exc.InterfaceError: (pg8000.core.InterfaceError) ('communication error', ConnectionRefusedError(111, 'Connection refused'))
(Background on this error at: http://sqlalche.me/e/rvf5)

2020-04-14 18:13:04,802 - ERROR - 424:MainThread - CheckConfig:675 - File "/opt/zato/zato/code/bin/zato", line 11, in <module>
    load_entry_point('zato-cli', 'console_scripts', 'zato')()
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/zato_command.py", line 449, in main
    return run_command(args)
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/__init__.py", line 385, in run_command
    command_class[args.command](args).run(args)
  Traceback (most recent call last):
  File "/opt/zato/zato/code/lib/python3.6/site-packages/pg8000/core.py", line 1165, in __init__
    self._usock.connect((host, port))
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2276, in _wrap_pool_connect
    return fn()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 363, in connect
    return _ConnectionFairy._checkout(self)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
    rec = pool._do_get()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
    self._dec_overflow()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
    raise value
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
    return self._create_connection()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
    return _ConnectionRecord(self)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
    self.__connect(first_connect_check=True)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
    connection = pool._invoke_creator(self)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 482, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/pg8000/__init__.py", line 50, in connect
    application_name, max_prepared_statements, tcp_keepalive)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/pg8000/core.py", line 1178, in __init__
    raise InterfaceError("communication error", e)
pg8000.core.InterfaceError: ('communication error', ConnectionRefusedError(111, 'Connection refused'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/__init__.py", line 663, in run
    return_code = self.execute(args)
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/__init__.py", line 945, in execute
    return self._get_dispatch()[json_data['component']](args)
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/check_config.py", line 238, in _on_server
    self.check_sql_odb_server_scheduler(cm, server_conf, fs_sql_config, False)
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/check_config.py", line 88, in check_sql_odb_server_scheduler
    self.ping_sql(cm, engine_params, get_ping_query(fs_sql_config, engine_params))
  File "/opt/zato/zato/code/zato-cli/src/zato/cli/check_config.py", line 68, in ping_sql
    session = create_pool(cm, engine_params, ping_query)
  File "/opt/zato/zato/code/zato-common/src/zato/common/odb/__init__.py", line 65, in create_pool
    engine.execute(ping_query)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2181, in execute
    connection = self._contextual_connect(close_with_result=True)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2242, in _contextual_connect
    self._wrap_pool_connect(self.pool.connect, None),
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2280, in _wrap_pool_connect
    e, dialect, self
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1547, in _handle_dbapi_exception_noconnection
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
    raise value.with_traceback(tb)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2276, in _wrap_pool_connect
    return fn()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 363, in connect
    return _ConnectionFairy._checkout(self)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
    rec = pool._do_get()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
    self._dec_overflow()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
    raise value
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
    return self._create_connection()
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
    return _ConnectionRecord(self)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
    self.__connect(first_connect_check=True)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
    connection = pool._invoke_creator(self)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 482, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/pg8000/__init__.py", line 50, in connect
    application_name, max_prepared_statements, tcp_keepalive)
  File "/opt/zato/zato/code/lib/python3.6/site-packages/pg8000/core.py", line 1178, in __init__
    raise InterfaceError("communication error", e)
sqlalchemy.exc.InterfaceError: (pg8000.core.InterfaceError) ('communication error', ConnectionRefusedError(111, 'Connection refused'))
(Background on this error at: http://sqlalche.me/e/rvf5)

It’s gotta be some bit of code that is not used when installing the cluster as the installation went fine (I checked the tables inside the zato database on my PostgreSQL 12 and both psql and redis-cli can connect from inside the Docker container to their respective database servers.

Any idea?

Hi Jaume,

this is a connection refused error but I am not clear - what is being refused here? A connection to what address?

May it be that the ip6-localhost address name was not stored somewhere or is not being used? It looks like no address was being used while checking the connection.

Is there some place, some config file or similar, I could check to see if the right data was stored there? Or how it was stored?

I am going to reinstall the Zato container from scratch but using IPv4 instead of IPv6 and see if it works fine. I’ll keep two separate containers with the same info, one using IPv4 and the other IPv6.

P.S. I am using the latest sources from the Github repository.

ODB connection details are in server.conf files, in the [odb] stanza and this is where the ‘host’ key will be.

So I reinstalled the container from scratch:

  • Disabled IPv4 in postgresql.conf and pg_hba.conf, leaving only IPv6.
  • Created a zato6 username and a zato6 database on PostgreSQL and allowed access in the pg_hba.conf file.
  • Created the Docker container named zato6, based on Ubuntu 18.04.
  • Created the zato6 user and group and installed Zato inside /opt/zato6/zato by cloing the Git repo.
  • Tested access to PostgreSQL zato6 and Redis from inside the container.
  • Created the cluster using quickstart:
mkdir --parents /opt/zato6/env/qs-1
/opt/zato/zato/code/bin/zato quickstart create --odb_host ip6-localhost --odb_port 5432 --odb_user zato6 --odb_db_name zato6 --odb_password '' --kvdb_password '' /opt/zato6/env/qs-1/ postgresql ip6-localhost 6379```

Seemed to go okay but I realised those INFO - 992:MainThread - Create bits there, which are not supposed to appear:

[1/9] Certificate authority created
2020-04-15 18:53:58,582 - INFO - 992:MainThread - Create:319 - [1/9] Certificate authority created
[2/9] ODB schema created
2020-04-15 18:54:01,560 - INFO - 992:MainThread - Create:329 - [2/9] ODB schema created
[3/9] ODB initial data created
2020-04-15 18:54:03,293 - INFO - 992:MainThread - Create:345 - [3/9] ODB initial data created
[4/9] server1 created
2020-04-15 18:54:03,374 - INFO - 992:MainThread - Create:377 - [4/9] server1 created
[5/9] server2 created
2020-04-15 18:54:03,424 - INFO - 992:MainThread - Create:377 - [5/9] server2 created
[6/9] Load-balancer created
2020-04-15 18:54:03,427 - INFO - 992:MainThread - Create:399 - [6/9] Load-balancer created
Superuser created successfully.
[7/9] Web admin created
[8/9] Scheduler created
[9/9] Management scripts created
Quickstart cluster quickstart-1021774 created
Web admin user:[admin], password:[vP18F9xj5--jB942lOWgwSltdSfuBi0F]
Start the cluster by issuing the /opt/zato6/env/qs-1/zato-qs-start.sh command
Visit https://zato.io/support for more information and support options

Tried to start the cluster, but still got the same connection error:

  File "/opt/zato6/zato/code/lib/python3.6/site-packages/pg8000/core.py", line 1178, in __init__
    raise InterfaceError("communication error", e)
sqlalchemy.exc.InterfaceError: (pg8000.core.InterfaceError) ('communication error', ConnectionRefusedError(111, 'Connection refused'))

Checked the /opt/zato6/env/qs-1/server1/config/repo/server.conf file:

[odb]
db_name=zato6
engine=postgresql+pg8000
extra=echo=False
host=ip6-localhost
port=5432
password=zato+secret://zato.server_conf.odb.password
pool_size=15
username=zato6
use_async_driver=True

Everything seems okay, doesn’t it?

Any idea?

I am now gonna disable IPv6 and do the same using a zato4 username, database, group et al. and test the same version of Zato only through IPv4 in a different container, see how it goes…

Can you try it out with square brackets, such as below?

host=[::1]

So everything worked fine with the IPv4 version, as it used to be, and I managed to start the cluster. But I noticed these kind of warnings when setting up the cluster via zato quickstart create, so I am gonna leave them here for you to check if you think that something may be not entirely right:

zato4@myhostname:~/zato$ /opt/zato4/zato/code/bin/zato quickstart create --odb_host localhost --odb_port 5432 --odb_user zato4 --odb_db_name zato
4 --odb_password '' --kvdb_password '' /opt/zato4/env/qs-1/ postgresql localhost 6379
[1/9] Certificate authority created
2020-04-15 20:40:18,590 - INFO - 9688:MainThread - Create:319 - [1/9] Certificate authority created
[2/9] ODB schema created
2020-04-15 20:40:21,039 - INFO - 9688:MainThread - Create:329 - [2/9] ODB schema created
[3/9] ODB initial data created
2020-04-15 20:40:22,540 - INFO - 9688:MainThread - Create:345 - [3/9] ODB initial data created
[4/9] server1 created
2020-04-15 20:40:22,608 - INFO - 9688:MainThread - Create:377 - [4/9] server1 created
[5/9] server2 created
2020-04-15 20:40:22,641 - INFO - 9688:MainThread - Create:377 - [5/9] server2 created
[6/9] Load-balancer created
2020-04-15 20:40:22,643 - INFO - 9688:MainThread - Create:399 - [6/9] Load-balancer created
Superuser created successfully.
[7/9] Web admin created
[8/9] Scheduler created
[9/9] Management scripts created
Quickstart cluster quickstart-853630 created
Web admin user:[admin], password:[SjGMnfXmiSoZ8TpyaAhsFd7u_uXZgKKF]
Start the cluster by issuing the /opt/zato4/env/qs-1/zato-qs-start.sh command
Visit https://zato.io/support for more information and support options

Please note that the user, group, database name and database username are not zato but instead zato4. I did that on purpose just to poke the system, see what happened… :slight_smile:

Just checked my old tutorial and those INFO messages weren’t there.

So I changed the host key inside the [odb] stanza in both server.conf files on the IPv6 container and tried to start the cluster:

zato6@ranma:~$ /opt/zato6/env/qs-1/zato-qs-start.sh
Starting Zato cluster quickstart-1021774
Checking configuration
File "/opt/zato6/zato/code/bin/zato", line 11, in <module>
    load_entry_point('zato-cli', 'console_scripts', 'zato')()
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/zato_command.py", line 449, in main
    return run_command(args)
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/__init__.py", line 385, in run_command
    command_class[args.command](args).run(args)
  Traceback (most recent call last):
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/pg8000/core.py", line 1165, in __init__
    self._usock.connect((host, port))
socket.gaierror: [Errno -9] Address family for hostname not supported

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2276, in _wrap_pool_connect
    return fn()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 363, in connect
    return _ConnectionFairy._checkout(self)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
    rec = pool._do_get()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
    self._dec_overflow()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
    raise value
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
    return self._create_connection()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
    return _ConnectionRecord(self)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
    self.__connect(first_connect_check=True)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
    connection = pool._invoke_creator(self)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 482, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/pg8000/__init__.py", line 50, in connect
    application_name, max_prepared_statements, tcp_keepalive)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/pg8000/core.py", line 1178, in __init__
    raise InterfaceError("communication error", e)
pg8000.core.InterfaceError: ('communication error', gaierror(-9, 'Address family for hostname not supported'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/__init__.py", line 663, in run
    return_code = self.execute(args)
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/__init__.py", line 945, in execute
    return self._get_dispatch()[json_data['component']](args)
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/check_config.py", line 238, in _on_server
    self.check_sql_odb_server_scheduler(cm, server_conf, fs_sql_config, False)
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/check_config.py", line 88, in check_sql_odb_server_scheduler
    self.ping_sql(cm, engine_params, get_ping_query(fs_sql_config, engine_params))
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/check_config.py", line 68, in ping_sql
    session = create_pool(cm, engine_params, ping_query)
  File "/opt/zato6/zato/code/zato-common/src/zato/common/odb/__init__.py", line 65, in create_pool
    engine.execute(ping_query)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2181, in execute
    connection = self._contextual_connect(close_with_result=True)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2242, in _contextual_connect
    self._wrap_pool_connect(self.pool.connect, None),
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2280, in _wrap_pool_connect
    e, dialect, self
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1547, in _handle_dbapi_exception_noconnection
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
    raise value.with_traceback(tb)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2276, in _wrap_pool_connect
    return fn()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 363, in connect
    return _ConnectionFairy._checkout(self)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
    rec = pool._do_get()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
    self._dec_overflow()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
    raise value
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
    return self._create_connection()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
    return _ConnectionRecord(self)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
    self.__connect(first_connect_check=True)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
    connection = pool._invoke_creator(self)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 482, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/pg8000/__init__.py", line 50, in connect
    application_name, max_prepared_statements, tcp_keepalive)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/pg8000/core.py", line 1178, in __init__
    raise InterfaceError("communication error", e)
sqlalchemy.exc.InterfaceError: (pg8000.core.InterfaceError) ('communication error', gaierror(-9, 'Address family for hostname not supported'))
(Background on this error at: http://sqlalche.me/e/rvf5)

2020-04-15 23:28:09,377 - ERROR - 68:MainThread - CheckConfig:675 - File "/opt/zato6/zato/code/bin/zato", line 11, in <module>
    load_entry_point('zato-cli', 'console_scripts', 'zato')()
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/zato_command.py", line 449, in main
    return run_command(args)
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/__init__.py", line 385, in run_command
    command_class[args.command](args).run(args)
  Traceback (most recent call last):
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/pg8000/core.py", line 1165, in __init__
    self._usock.connect((host, port))
socket.gaierror: [Errno -9] Address family for hostname not supported

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2276, in _wrap_pool_connect
    return fn()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 363, in connect
    return _ConnectionFairy._checkout(self)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
    rec = pool._do_get()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
    self._dec_overflow()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
    raise value
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
    return self._create_connection()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
    return _ConnectionRecord(self)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
    self.__connect(first_connect_check=True)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
    connection = pool._invoke_creator(self)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 482, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/pg8000/__init__.py", line 50, in connect
    application_name, max_prepared_statements, tcp_keepalive)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/pg8000/core.py", line 1178, in __init__
    raise InterfaceError("communication error", e)
pg8000.core.InterfaceError: ('communication error', gaierror(-9, 'Address family for hostname not supported'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/__init__.py", line 663, in run
    return_code = self.execute(args)
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/__init__.py", line 945, in execute
    return self._get_dispatch()[json_data['component']](args)
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/check_config.py", line 238, in _on_server
    self.check_sql_odb_server_scheduler(cm, server_conf, fs_sql_config, False)
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/check_config.py", line 88, in check_sql_odb_server_scheduler
    self.ping_sql(cm, engine_params, get_ping_query(fs_sql_config, engine_params))
  File "/opt/zato6/zato/code/zato-cli/src/zato/cli/check_config.py", line 68, in ping_sql
    session = create_pool(cm, engine_params, ping_query)
  File "/opt/zato6/zato/code/zato-common/src/zato/common/odb/__init__.py", line 65, in create_pool
    engine.execute(ping_query)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2181, in execute
    connection = self._contextual_connect(close_with_result=True)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2242, in _contextual_connect
    self._wrap_pool_connect(self.pool.connect, None),
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2280, in _wrap_pool_connect
    e, dialect, self
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1547, in _handle_dbapi_exception_noconnection
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
    raise value.with_traceback(tb)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2276, in _wrap_pool_connect
    return fn()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 363, in connect
    return _ConnectionFairy._checkout(self)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
    rec = pool._do_get()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
    self._dec_overflow()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
    raise value
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
    return self._create_connection()
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
    return _ConnectionRecord(self)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
    self.__connect(first_connect_check=True)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
    connection = pool._invoke_creator(self)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 482, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/pg8000/__init__.py", line 50, in connect
    application_name, max_prepared_statements, tcp_keepalive)
  File "/opt/zato6/zato/code/lib/python3.6/site-packages/pg8000/core.py", line 1178, in __init__
    raise InterfaceError("communication error", e)
sqlalchemy.exc.InterfaceError: (pg8000.core.InterfaceError) ('communication error', gaierror(-9, 'Address family for hostname not supported'))
(Background on this error at: http://sqlalche.me/e/rvf5)

FYI, I had already tried the zato quickstart create command by using both ::1 and [::1] before this current trial with ip6-localhost.