question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Patroni python3 watchdog problem

See original GitHub issue

Centos 7, python3 Using watchdog in configuration, the supposed to be leader does not properly start. Issue can be repeated by patronictl failover too.

Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: Traceback (most recent call last):
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/bin/patroni", line 11, in <module>
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: sys.exit(main())
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/lib/python3.4/site-packages/patroni/__init__.py", line 173, in main
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: return patroni_main()
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/lib/python3.4/site-packages/patroni/__init__.py", line 142, in patroni_main
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: patroni.run()
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/lib/python3.4/site-packages/patroni/__init__.py", line 114, in run
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: logger.info(self.ha.run_cycle())
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/lib/python3.4/site-packages/patroni/ha.py", line 1056, in run_cycle
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: info = self._run_cycle()
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/lib/python3.4/site-packages/patroni/ha.py", line 1027, in _run_cycle
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: return self.process_unhealthy_cluster()
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/lib/python3.4/site-packages/patroni/ha.py", line 657, in process_unhealthy_cluster
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: 'promoted self to leader by acquiring session lock')
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/lib/python3.4/site-packages/patroni/ha.py", line 345, in enforce_master_role
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: if not self.watchdog.activate():
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/lib/python3.4/site-packages/patroni/watchdog/base.py", line 36, in wrapped
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: return func(self, *args, **kwargs)
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/lib/python3.4/site-packages/patroni/watchdog/base.py", line 124, in activate
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: return self._activate()
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/lib/python3.4/site-packages/patroni/watchdog/base.py", line 144, in _activate
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: actual_timeout = self._set_timeout()
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/lib/python3.4/site-packages/patroni/watchdog/base.py", line 172, in _set_timeout
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: self.impl.set_timeout(self.config.timeout)
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/lib/python3.4/site-packages/patroni/watchdog/linux.py", line 202, in set_timeout
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: self._ioctl(WDIOC_SETTIMEOUT, ctypes.c_int(timeout))
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: File "/usr/lib/python3.4/site-packages/patroni/watchdog/linux.py", line 163, in _ioctl
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: if result < 0:
Sep 22 08:39:02 pgdron002d1vteo patroni[2707]: TypeError: unorderable types: bytes() < int()

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
antscommented, Sep 22, 2017

Pythons HTML documentation and source code don’t match. Fix coming up soon, I need to dig through source history to see how this has changed over the versions.

Until the fix is available the workaround is to just disable watchdog in config:

watchdog:
  mode: off
0reactions
antscommented, Sep 22, 2017

Taking a look at it now. fcntl.ioctl() is somehow returning a bytes object. Python’s documentation says that it is supposed to return an int…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Patroni python3 watchdog problem - Bountysource
Using watchdog in configuration, the supposed to be leader does not properly start. Issue can be repeated by patronictl failover too. Sep 22...
Read more >
Watchdog support — Patroni 2.1.5 documentation
Patroni has crashed due to a bug, out-of-memory condition or by being accidentally killed by a system administrator. · Shutting down PostgreSQL is...
Read more >
Patroni fails to start with MemoryError (#6184) · Issues - GitLab
When Omnibus starts Patroni, it fails to start with the following error, and this repeats frequently as Omnibus keeps trying to start it...
Read more >
Setting Up a Patroni Cluster with VMware Postgres
This topic describes how to set up an HA three-node cluster using Patroni and etcd. If a host becomes unavailable, this configuration provides...
Read more >
Release notes - Patroni - Crunchy Data
This release fixes a critical issue with Patroni API /master endpoint returning 200 for the non-master node. ... Fix watchdog on Python 3...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found