Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pghoard-2.2.2a does not start due to wrong package called in walreceiver.py #579

Open
dsoren89 opened this issue Jan 11, 2023 · 2 comments

Comments

@dsoren89
Copy link

dsoren89 commented Jan 11, 2023

I am trying to install pghoard-2.2.2a with postgresql 14.6. As pghoard-2.2.2a requires psycopg2 whl files.
It is present in the system but pghoard is failing to start with the below error:

Jan 11 05:37:34 fo23-pg systemd[1]: Started PostgreSQL streaming backup service.
Jan 11 05:37:34 fo23-pg pghoard[99181]: Traceback (most recent call last):
Jan 11 05:37:34 fo23-pg pghoard[99181]:  File "/usr/local/bin/pghoard", line 11, in <module>
Jan 11 05:37:34 fo23-pg pghoard[99181]:    load_entry_point('pghoard===-shell.git.describe..dev', 'console_scripts', 'pghoard')()
Jan 11 05:37:34 fo23-pg pghoard[99181]:  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 479, in load_entry_point
Jan 11 05:37:34 fo23-pg pghoard[99181]:    return get_distribution(dist).load_entry_point(group, name)
Jan 11 05:37:34 fo23-pg pghoard[99181]:  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2861, in load_entry_point
Jan 11 05:37:34 fo23-pg pghoard[99181]:    return ep.load()
Jan 11 05:37:34 fo23-pg pghoard[99181]:  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2465, in load
Jan 11 05:37:34 fo23-pg pghoard[99181]:    return self.resolve()
Jan 11 05:37:34 fo23-pg pghoard[99181]:  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2471, in resolve
Jan 11 05:37:34 fo23-pg pghoard[99181]:    module = __import__(self.module_name, fromlist=['__name__'], level=0)
Jan 11 05:37:34 fo23-pg pghoard[99181]:  File "/usr/local/lib/python3.6/site-packages/pghoard/pghoard.py", line 46, in <module>
Jan 11 05:37:34 fo23-pg pghoard[99181]:    from pghoard.walreceiver import WALReceiver
Jan 11 05:37:34 fo23-pg pghoard[99181]:  File "/usr/local/lib/python3.6/site-packages/pghoard/walreceiver.py", line 16, in <module>
Jan 11 05:37:34 fo23-pg pghoard[99181]:    import psycopg2.errors
Jan 11 05:37:34 fo23-pg pghoard[99181]: ModuleNotFoundError: No module named 'psycopg2.errors'

What did you expect to happen?

/usr/local/lib/python3.6/site-packages/pghoard/walreceiver.py is expecting for psycopg2.errors package to be present but in /usr/local/lib64/python3.6/site-packages/psycopg2 errorcodes.py is present.

What else do we need to know?

After updating the /usr/local/lib/python3.6/site-packages/pghoard/walreceiver.py with psycopg2.errorcodes, pghoard was up and running.

The psycopg2 2.7.7 is installed in my system.
Could you kindly comment on this error ? if this change will be committed in the pghoard code ? or please put your comment on the error.

@dsoren89 dsoren89 changed the title pghoard-2.2.2a pghoard-2.2.2a does not start due to wrong package called in walreceiver.py Jan 11, 2023
@rdunklau
Copy link
Contributor

Hello !
The psycopg2.errors package has been introduced in psycopg2 2.8, released in 2019. I also see that you are using python 3.6, which has been EOL'ed one year ago.

You should probably upgrade your whole python installation. Which linux distribution are you using ?

@dsoren89
Copy link
Author

I tried installing with python 3.8 and psycpog2 2.9.5 on Rocky 8.6 OS and pghoard was installed successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants