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

support for PostgeSQL 10.0+ #100

Open
ghost opened this issue May 24, 2018 · 2 comments
Open

support for PostgeSQL 10.0+ #100

ghost opened this issue May 24, 2018 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented May 24, 2018

Traceback (most recent call last):
  File "/usr/bin/pg_view", line 11, in <module>
    load_entry_point('pg-view==1.4.1', 'console_scripts', 'pg_view')()
  File "/usr/lib/python3.6/site-packages/pg_view.py", line 3474, in main
    postmasters = get_postmasters_directories()
  File "/usr/lib/python3.6/site-packages/pg_view.py", line 3038, in get_postmasters_directories
    postmasters[pg_dir] = [pid, version, dbname]
UnboundLocalError: local variable 'version' referenced before assignment
PG_VERSION_FILENAME:
# cat /proc/<PG PID>/cwd/PG_VERSION
10
fp = open(PG_VERSION_FILENAME, 'rU')
  val = fp.read().strip()
  if val is not None and len(val) >= 3:
      version = float(val)

I do not understand why "len(val) >= 3"
"len(val) >= 1" should be enought.

Unable to read free space information for the pg_xlog and data directories for the directory /pg: [Errno 2] No such file or directory: '/pg/pg_xlog/'
ERROR: 2018-05-24 23:25:55,870 Unable to read free space information for the pg_xlog and data directories for the directory /pg: [Errno 2] No such file or directory: '/pg/pg_xlog/'
Process DetachedDiskStatCollector-1:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/site-packages/pg_view.py", line 3560, in run
df_data = self.get_df_data(wd)
File "/usr/lib/python3.6/site-packages/pg_view.py", line 3615, in get_df_data
xlog_dev = self.get_mounted_device(self.get_mount_point(work_directory + '/pg_xlog/'))
File "/usr/lib/python3.6/site-packages/pg_view.py", line 3679, in get_mount_point
parent_device = path_device = os.stat(pathname).st_dev
FileNotFoundError: [Errno 2] No such file or directory: '/pg/pg_xlog'

@hjacobs hjacobs added the bug label May 25, 2018
@hjacobs
Copy link
Contributor

hjacobs commented May 25, 2018

@nri-pl thanks for reporting!

@alexeyklyukin
Copy link
Contributor

File "/usr/lib/python3.6/site-packages/pg_view.py", line 3474, in main

This looks like an old (one single file) version of pg_view. We moved one for more than a year.

I do not understand why "len(val) >= 3"
"len(val) >= 1" should be enought.

It's a valid point. That has been fixed at #89
Feel free to give it a spin

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

No branches or pull requests

2 participants