Patroni (kazoo) timeout but Zookeeper cluster working - apache-zookeeper

Run
[root#centos81-01 ~]# patroni pgsql11-0.yml
to setup PostgreSQL Cluste
and got an error
2020-03-27 15:59:18,498 ERROR: Unhandled exception in connection loop
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/kazoo/protocol/connection.py", line 565, in _connect_attempt
read_timeout, connect_timeout = self._connect(host, hostip, port)
TypeError: _kazoo_connect() takes 3 positional arguments but 4 were given
2020-03-27 15:59:18,499 INFO: Zookeeper session closed, state: CLOSED
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib64/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.6/site-packages/kazoo/protocol/connection.py", line 497, in zk_loop
if retry(self._connect_loop, retry) is STOP_CONNECTING:
File "/usr/local/lib/python3.6/site-packages/kazoo/retry.py", line 126, in __call__
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/kazoo/protocol/connection.py", line 537, in _connect_loop
status = self._connect_attempt(host, hostip, port, retry)
File "/usr/local/lib/python3.6/site-packages/kazoo/protocol/connection.py", line 565, in _connect_attempt
read_timeout, connect_timeout = self._connect(host, hostip, port)
TypeError: _kazoo_connect() takes 3 positional arguments but 4 were given
Traceback (most recent call last):
File "/usr/local/bin/patroni", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/patroni/__init__.py", line 224, in main
return patroni_main()
File "/usr/local/lib/python3.6/site-packages/patroni/__init__.py", line 186, in patroni_main
patroni = Patroni(conf)
File "/usr/local/lib/python3.6/site-packages/patroni/__init__.py", line 31, in __init__
self.dcs = get_dcs(self.config)
File "/usr/local/lib/python3.6/site-packages/patroni/dcs/__init__.py", line 89, in get_dcs
return item(config[name])
File "/usr/local/lib/python3.6/site-packages/patroni/dcs/zookeeper.py", line 77, in __init__
self._client.start()
File "/usr/local/lib/python3.6/site-packages/kazoo/client.py", line 635, in start
raise self.handler.timeout_exception("Connection time-out")
kazoo.handlers.threading.KazooTimeoutError: Connection time-out
[root#centos81-01 ~]#
On el8 CentOS Linux release 8.1.1911 (Core)
with
cdiff (1.0)
click (7.1.1)
kazoo (2.7.0)
patroni (1.6.4)
pip (9.0.3)
prettytable (0.7.2)
psutil (5.7.0)
psycopg2 (2.8.3)
psycopg2-binary (2.8.4)
python-dateutil (2.6.1)
pytz (2019.3)
PyYAML (5.3.1)
setuptools (39.2.0)
six (1.11.0)
tzlocal (2.0.0)
urllib3 (1.25.8)
i can add any ENV/libs info if needed.

Problem solved with downgrading kazoo to v2.6.1:
pip3 uninstall kazoo
pip3 install kazoo==2.6.1
Patroni CONNECTED to Apache Zookeeper DCS Claster:
[root#centos81-01 ~]# patroni pgsql11-0.yml
2020-03-27 16:59:52,539 INFO: Connecting to 192.168.56.103:2181, use_ssl: False
2020-03-27 16:59:52,566 INFO: Zookeeper connection established, state: CONNECTED
2020-03-27 16:59:52,582 INFO: No PostgreSQL configuration items changed, nothing to reload.
2020-03-27 16:59:52,936 INFO: Lock owner: None; I am pg01
2020-03-27 16:59:53,010 INFO: trying to bootstrap a new cluster
pg_ctl: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will
own the server process.
2020-03-27 16:59:53,038 INFO: removing initialize key after failed attempt to bootstrap the cluster
2020-03-27 16:59:53,369 INFO: Lock owner: None; I am pg01

Related

Overwrite anaconda3 unsuccessful installation

I deleted the anaconda directory under the home and bashrc configurations.
Now, I need to install it again, but it occurs a problem evenif overwrites unsuccessful installation on Linux.
Should I delete some additional config files? How can I handle this?
sh Downloads/Anaconda3-2022.10-Linux-x86_64.sh -u -p /home/user/anaconda3/
PREFIX=/home/user/anaconda3
Unpacking payload ...
concurrent.futures.process._RemoteTraceback:
'''
Traceback (most recent call last):
File "concurrent/futures/process.py", line 384, in wait_result_broken_or_wakeup
File "multiprocessing/connection.py", line 256, in recv
TypeError: __init__() missing 1 required positional argument: 'msg'
'''
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "entry_point.py", line 69, in <module>
File "concurrent/futures/process.py", line 559, in _chain_from_iterable_of_lists
File "concurrent/futures/_base.py", line 608, in result_iterator
File "concurrent/futures/_base.py", line 445, in the result
File "concurrent/futures/_base.py", line 390, in __get_result
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
[8382] Failed to execute script entry_point
Make sure deleted .conda directory under home and have enough disk space.
No need to delete .cache or any bin libraries.

AWX-Web error when installing awx-operator on Kubernetes

I am currently installing the awx-operator and I have come across an issue while I am trying to expose the application to the outside world.
But I have come across an error with the awx-web container within the awx-5b58db49c-9r4hp. When I run kubectl logs pod/awx-5b58db49c-9r4hp -c awx-web, I get the following output:
Traceback (most recent call last):
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/conf/settings.py", line 81, in _ctit_db_wrapper
yield
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/conf/settings.py", line 411, in __getattr__
value = self._get_local(name)
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/awx/conf/settings.py", line 355, in _get_local
setting = Setting.objects.filter(key=name, user__isnull=True).order_by('pk').first()
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/models/query.py", line 653, in first
for obj in (self if self.ordered else self.order_by('pk'))[:1]:
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/models/query.py", line 274, in __iter__
self._fetch_all()
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/models/query.py", line 1242, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/models/query.py", line 55, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/models/sql/compiler.py", line 1140, in execute_sql
cursor = self.connection.cursor()
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 256, in cursor
return self._cursor()
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 233, in _cursor
self.ensure_connection()
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
self.connect()
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
self.connect()
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 195, in connect
self.connection = self.get_new_connection(conn_params)
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/backends/postgresql/base.py", line 178, in get_new_connection
connection = Database.connect(**conn_params)
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/psycopg2/__init__.py", line 126, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: FATAL: password authentication failed for user "awx"
2021-05-12 14:28:54,478 ERROR [-] awx.conf.settings Database settings are not available, using defaults.
Traceback (most recent call last):
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/oauth2_provider/settings.py", line 138, in __getattr__
val = self.user_settings[attr]
KeyError: 'OAUTH2_VALIDATOR_CLASS'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
self.connect()
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 195, in connect
self.connection = self.get_new_connection(conn_params)
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/django/db/backends/postgresql/base.py", line 178, in get_new_connection
connection = Database.connect(**conn_params)
File "/var/lib/awx/venv/awx/lib64/python3.8/site-packages/psycopg2/__init__.py", line 126, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL: password authentication failed for user "awx"
I am not too sure whether this is a big deal or just a red-herring. I am just in need of some clarification. If I need to get any more information to aide troubleshooting, please let me know!
As per AWX 19.0.0: password authentication failed for user "awx" issue is not anymore in minikube v1.20.0, awx-operator 0.9.0 so advice is try use this version for now
I was also observing the same error message => password authentication failed for user "awx".
I was running the awx-operator version 0.10.0 on my kubernetes cluster created using kubeadm and not using minikube.
I hosted my postgres persistent volume needed for awx postgres pod on my worker node which already had some stale previously migrated data from a different kubernetes cluster. I had to cleanup that already lying data on my worker node hostPath where i mounted my persistent volume and make a fresh install with fresh data from postgres pod and the password authentication error never come back.

Odoo 14 Installation : Connection to the database failed and no password supplied

I am trying to install the openERP Odoo 14 on macOS Catalina version 10.15.7. I have installed python3, postgreSQL, pgAdmin4 just as demanded and cloned odoo 14 from here but when I type this command python3 odoo-bin -d odoo14 which should create the database, it didn't work whereas it gives this error saying Connection to the database failed and no password supplied:
2021-04-15 11:46:20,236 79206 INFO ? odoo: Odoo version 14.0
2021-04-15 11:46:20,236 79206 INFO ? odoo: addons paths: ['/Users/mac/Desktop/odoo/odoo/odoo/addons', '/Users/mac/Library/Application Support/Odoo/addons/14.0', '/Users/mac/Desktop/odoo/odoo/addons']
2021-04-15 11:46:20,237 79206 INFO ? odoo: database: default#default:default
2021-04-15 11:46:20,262 79206 INFO ? odoo.sql_db: Connection to the database failed
Traceback (most recent call last):
File "odoo-bin", line 8, in <module>
odoo.cli.main()
File "/Users/mac/Desktop/odoo/odoo/odoo/cli/command.py", line 61, in main
o.run(args)
File "/Users/mac/Desktop/odoo/odoo/odoo/cli/server.py", line 178, in run
main(args)
File "/Users/mac/Desktop/odoo/odoo/odoo/cli/server.py", line 142, in main
odoo.service.db._create_empty_database(db_name)
File "/Users/mac/Desktop/odoo/odoo/odoo/service/db.py", line 99, in _create_empty_database
with closing(db.cursor()) as cr:
File "/Users/mac/Desktop/odoo/odoo/odoo/sql_db.py", line 675, in cursor
return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
File "/Users/mac/Desktop/odoo/odoo/odoo/sql_db.py", line 248, in __init__
self._cnx = pool.borrow(dsn)
File "/Users/mac/Desktop/odoo/odoo/odoo/sql_db.py", line 558, in _locked
return fun(self, *args, **kwargs)
File "/Users/mac/Desktop/odoo/odoo/odoo/sql_db.py", line 626, in borrow
**connection_info)
File "/Users/mac/opt/miniconda3/lib/python3.7/site-packages/psycopg2/__init__.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: fe_sendauth: no password supplied
I am using python3 of the system not a virtual environment.
Could anyone please help me figure out what's wrong and get Odoo 14 working?
Thanks in advance.
When you first install PostgreSQL on MacOS with brew it creates a db user
with the same name as your MacOS user with no password.
Can you try launching with these flags?
python3 odoo-bin -d odoo14 --db_user=yourusername --db_password=False

Connection to local postgresql database fails after upgrade to Big Sur

I use IntelliJ IDEA's bundled database client (DataGrip) to manage my database connections, both local and remote. And using docker to connect to postgres with following settings:
services:
postgresql:
image: postgres:11
ports:
- "5432:5432"
expose:
- "5432"
environment:
- POSTGRES_USER=$user
- POSTGRES_PASSWORD=$pass
- POSTGRES_DB=k$db
After upgrading from Catalina to Big Sur, connection to local db fails and it just shows a connection error message as follows:
[08001] Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
java.net.ConnectException: Connection refused (Connection refused).
When I run docker-compose up, I get the following error:
Traceback (most recent call last):
File "site-packages/urllib3/connectionpool.py", line 677, in urlopen
File "site-packages/urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1252, in request
File "http/client.py", line 1298, in _send_request
File "http/client.py", line 1247, in endheaders
File "http/client.py", line 1026, in _send_output
File "http/client.py", line 966, in send
File "site-packages/docker/transport/unixconn.py", line 43, in connect
ConnectionRefusedError: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages/requests/adapters.py", line 449, in send
File "site-packages/urllib3/connectionpool.py", line 727, in urlopen
File "site-packages/urllib3/util/retry.py", line 403, in increment
File "site-packages/urllib3/packages/six.py", line 734, in reraise
File "site-packages/urllib3/connectionpool.py", line 677, in urlopen
File "site-packages/urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1252, in request
File "http/client.py", line 1298, in _send_request
File "http/client.py", line 1247, in endheaders
File "http/client.py", line 1026, in _send_output
File "http/client.py", line 966, in send
File "site-packages/docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages/docker/api/client.py", line 205, in _retrieve_server_version
File "site-packages/docker/api/daemon.py", line 181, in version
File "site-packages/docker/utils/decorators.py", line 46, in inner
File "site-packages/docker/api/client.py", line 228, in _get
File "site-packages/requests/sessions.py", line 543, in get
File "site-packages/requests/sessions.py", line 530, in request
File "site-packages/requests/sessions.py", line 643, in send
File "site-packages/requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose/cli/main.py", line 67, in main
File "compose/cli/main.py", line 123, in perform_command
File "compose/cli/command.py", line 69, in project_from_options
File "compose/cli/command.py", line 132, in get_project
File "compose/cli/docker_client.py", line 43, in get_client
File "compose/cli/docker_client.py", line 170, in docker_client
File "site-packages/docker/api/client.py", line 188, in __init__
File "site-packages/docker/api/client.py", line 213, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))
[1269] Failed to execute script docker-compose
Connecting to remote db's are not broken somehow, they work. Is there anyone came across this problem?
After Big Sur upgrade, I also had a warning whenever I open a new terminal:
zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]?
I did not think they are related but the solution to this problem, explained in this thread, also solved the main postgresql connection issue for me. But my computer keeps restarting occasionally and after this restart, I again get the main problem when I run docker-compose up inside IDE's terminal. I then manually restart and it works. Although not being a permanent soluiton, this solved my problem for now.

elasticsearch-curator for elasticsearch-v7.2.0

I am trying to run elasticsearch curator on kubernetes using helm install stable/elasticsearch-curator but pctestcontainerregistry.azurecr.io/eic-curator:5.5.4 is not compatible with elasticsearch-v7.2.0. Refer error below. Does anyone has any alternate of running es-curator on kubernetes for elasticsearch-v7.2.0?
2019-08-12 21:14:05,422 INFO Preparing Action ID: 1, "delete_indices"
2019-08-12 21:14:05,433 ERROR Elasticsearch version 7.2.0 incompatible with this version of Curator (5.5.4)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/curator/utils.py", line 900, in get_client
check_version(client)
File "/usr/local/lib/python3.6/site-packages/curator/utils.py", line 701, in check_version
'({1})'.format(".".join(map(str,version_number)), __version__)
curator.exceptions.CuratorException: Elasticsearch version 7.2.0 incompatible with this version of Curator (5.5.4)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/curator", line 11, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/curator/cli.py", line 213, in cli
run(config, action_file, dry_run)
File "/usr/local/lib/python3.6/site-packages/curator/cli.py", line 160, in run
client = get_client(**client_args)
File "/usr/local/lib/python3.6/site-packages/curator/utils.py", line 907, in get_client
'Error: {0}'.format(e)
elasticsearch.exceptions.ElasticsearchException: Unable to create client connection to Elasticsearch. Error: Elasticsearch version 7.2.0 incompatible with this version of Curator (5.5.4)
Curator version 5.7.6 works with all Elasticsearch 7.x series. You will just have to update the helm chart and/or image to use it.