pgAdmin4 2.0 python wheel on Ubuntu

2017-10-07 Thread Richard Greenwood
With 1.6 I was running pgAdmin4.py as a standard user. With 2.0 I get a
permission denied on
/var/log/pgadmin/pgadmin4.log. If I run pgAdmin4.py as root it doesn't have
access to my .ssh/ and I end up in and endless cycle of failed OpehSSH
requests.

In my .ssh/config I have associated a SSL shared key file with a remote
database server. Obviously root doesn't have access to my .ssh/ but I don't
know why pgAdmin4 needs access to it in the first place. Maybe I've got a
connection to that server saved some place?

In 1.6 it looks like the pgAdmin log was saved in ~/.pgadmin/pgadmin4.log.
Is there a way in 2.0 to set the log directory?

Thanks
-- 
Richard W. Greenwood, PLS
www.greenwoodmap.com


Problem with shortcut

2017-10-07 Thread Charles Beaudette
Hello,

I just installed the new version of PGAdmin 4 (v 2.0) on Windows 10 and I
find it quick and responsive ! However, when trying to add a right angle
bracket (on my actual keyboard configuration, canadian multilingual
standard, it is mapped to alt + .) it uncomments the selected line of code,
which should be the ctrl + . shortcut according to the official
documentation. It is quite annoying and I was wondering if it was intended
to be so ?

Thank you for your time,

Charles Beaudette


pgadmin4 exception: session['_id'] not in self.managers

2017-10-07 Thread David Gilman
I'm trying out pgadmin4 v2.0 for the first time.  It seems that after only
a few minutes (maybe even less than five) my pgadmin4 session will get
logged out and I'll need to log in again and reopen everything from
scratch.  This exception is thrown in the mod_wsgi logs:

mod_wsgi (pid=5965): Exception occurred processing WSGI script
'/home/pgadmin/venv/lib/python2.7/site-packages/pgadmin4/pgAdmin4.wsgi'.
Traceback (most recent call last):
  File "/home/pgadmin/venv/local/lib/python2.7/site-packages/flask/app.py",
line 2000, in __call__
return self.wsgi_app(environ, start_response)
  File "/home/pgadmin/venv/local/lib/python2.7/site-packages/flask/app.py",
line 1991, in wsgi_app
response = self.make_response(self.handle_exception(e))
  File "/home/pgadmin/venv/local/lib/python2.7/site-packages/flask/app.py",
line 1567, in handle_exception
reraise(exc_type, exc_value, tb)
  File "/home/pgadmin/venv/local/lib/python2.7/site-packages/flask/app.py",
line 1988, in wsgi_app
response = self.full_dispatch_request()
  File "/home/pgadmin/venv/local/lib/python2.7/site-packages/flask/app.py",
line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
  File "/home/pgadmin/venv/local/lib/python2.7/site-packages/flask/app.py",
line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
  File "/home/pgadmin/venv/local/lib/python2.7/site-packages/flask/app.py",
line 1639, in full_dispatch_request
rv = self.dispatch_request()
  File "/home/pgadmin/venv/local/lib/python2.7/site-packages/flask/app.py",
line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
  File
"/home/pgadmin/venv/local/lib/python2.7/site-packages/flask_login.py", line
792, in decorated_view
return func(*args, **kwargs)
  File
"/home/pgadmin/venv/lib/python2.7/site-packages/pgadmin4/pgadmin/dashboard/__init__.py",
line 169, in wrap
kwargs['sid']
  File
"/home/pgadmin/venv/lib/python2.7/site-packages/pgadmin4/pgadmin/utils/driver/psycopg2/__init__.py",
line 2000, in connection_manager
if session['_id'] not in self.managers:
  File
"/home/pgadmin/venv/local/lib/python2.7/site-packages/werkzeug/local.py",
line 368, in 
__getitem__ = lambda x, i: x._get_current_object()[i]
KeyError: '_id'

My setup:
pgadmin4 v2.0 .  The configuration is all defaults except
for LOG_FILE/SQLITE_PATH/SESSION_DB_PATH/STORAGE_DIR.  That
means MAX_SESSION_IDLE_TIME is at its default of 60 (minutes).
pgadmin4 is in server mode with mod_wsgi as a host.
PostgreSQL 9.4.14 - from the postgres apt repository.  No changes made to
timeouts or anything in the postgresql.conf , it's all defaults.
Python 2.7
psycopg2 2.7.3.1

I can confirm that the apache process hosting pgadmin4 is running under the
right UNIX user account and that it seems to have good access/permissions
to its scratch files on disk.  I see updates being made to pgadmin4.db and
the sessions directory.

-- 
David Gilman
:DG<


Re: pgAdmin4 2.0 python wheel on Ubuntu

2017-10-07 Thread Murtuza Zabuawala
You can set customize the location as per your need,

Create a file named config_local.py (if not already present) at your
installation location ../pgadmin4/web/
and add below 3 lines in it,

import os
DATA_DIR = os.path.realpath(os.path.expanduser(u'~/.pgadmin/'))
LOG_FILE = os.path.join(DATA_DIR, 'pgadmin4.log')

restart pgAdmin4 and check if that solves your problem.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


On Sat, Oct 7, 2017 at 7:44 PM, Richard Greenwood <
richard.greenw...@gmail.com> wrote:

> With 1.6 I was running pgAdmin4.py as a standard user. With 2.0 I get a
> permission denied on
> /var/log/pgadmin/pgadmin4.log. If I run pgAdmin4.py as root it doesn't
> have access to my .ssh/ and I end up in and endless cycle of failed OpehSSH
> requests.
>
> In my .ssh/config I have associated a SSL shared key file with a remote
> database server. Obviously root doesn't have access to my .ssh/ but I don't
> know why pgAdmin4 needs access to it in the first place. Maybe I've got a
> connection to that server saved some place?
>
> In 1.6 it looks like the pgAdmin log was saved in ~/.pgadmin/pgadmin4.log.
> Is there a way in 2.0 to set the log directory?
>
> Thanks
> --
> Richard W. Greenwood, PLS
> www.greenwoodmap.com
>