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

AttributeError: 'PgstatCollector' object has no attribute 'format' #66

Open
sebastianwebber opened this issue Sep 3, 2016 · 2 comments
Labels

Comments

@sebastianwebber
Copy link

Hi There,

There is some configuration to fix this error? pg_view work by less than 30 seconds, then crash:

[root@server ~]# pg_view -U postgres -p 9999
Traceback (most recent call last):
  File "/bin/pg_view", line 3432, in main
    loop(collectors, consumer, groups, output_method)
  File "/bin/pg_view", line 2748, in loop
    curses.wrapper(do_loop, groups, output_method, collectors, consumer)
  File "/usr/lib64/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/bin/pg_view", line 2816, in do_loop
    process_single_collector(st)
  File "/bin/pg_view", line 2845, in process_single_collector
    st.refresh()
  File "/bin/pg_view", line 1196, in refresh
    proc_data = self._read_proc(pid, is_backend, is_active)
  File "/bin/pg_view", line 1253, in _read_proc
    result['uss'] = self._get_memory_usage(pid)
  File "/bin/pg_view", line 1275, in _get_memory_usage
    self.format(pid), e))
AttributeError: 'PgstatCollector' object has no attribute 'format'

About my enviroment:

[root@server ~]# python --version
Python 2.7.5
[root@server ~]# rpm -qa | grep postgresql
postgresql93-libs-9.3.14-1PGDG.rhel7.x86_64
postgresql93-contrib-9.3.14-1PGDG.rhel7.x86_64
postgresql93-9.3.14-1PGDG.rhel7.x86_64
postgresql93-server-9.3.14-1PGDG.rhel7.x86_64
[root@server ~]# rpm -qa | grep pg_view
pg_view-1.3.0-1.el7.noarch

Any ideias?

@a1exsh
Copy link
Member

a1exsh commented Sep 5, 2016

@sebastianwebber this is a typo, thank you for spotting it. The fix is in #67.

@hjacobs hjacobs added the bug label Aug 7, 2017
@hjacobs
Copy link
Contributor

hjacobs commented Aug 7, 2017

@a1exsh I ran into the same bug today in one of our data centers... 😞

postgres@xxxx01:~$ pg_view
Traceback (most recent call last):
  File "/data/postgres/bin/pg_view.py", line 3525, in main
    loop(collectors, consumer, groups, output_method)
  File "/data/postgres/bin/pg_view.py", line 2823, in loop
    curses.wrapper(do_loop, groups, output_method, collectors, consumer)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/data/postgres/bin/pg_view.py", line 2891, in do_loop
    process_single_collector(st)
  File "/data/postgres/bin/pg_view.py", line 2921, in process_single_collector
    st.refresh()
  File "/data/postgres/bin/pg_view.py", line 1215, in refresh
    proc_data = self._read_proc(pid, is_backend, is_active)
  File "/data/postgres/bin/pg_view.py", line 1272, in _read_proc
    result['uss'] = self._get_memory_usage(pid)
  File "/data/postgres/bin/pg_view.py", line 1294, in _get_memory_usage
    self.format(pid), e))
AttributeError: 'PgstatCollector' object has no attribute 'format'

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

3 participants