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

2017-10-10 Thread Harshal Dhumal
Hi Dave,

Please find attached patch (old RM2713).
Also for server group and server module login required checks were missing,
I have added them in same patch

-- 
*Harshal Dhumal*
*Sr. Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Tue, Oct 10, 2017 at 11:39 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi David,
>
> Thanks for you input. Session was not invalidated (otherwise execution
> would not have reached to connection manager); Only value of '_id' was
> changed for session.
>
> If we look at code
> 
> how '_id' is generated then we can see it uses remote address and user-agent
> to generate it. I thing we should use another session identifier (sid -
> session id) to map user connection from connection manager.
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Mon, Oct 9, 2017 at 10:18 PM, David Gilman 
> wrote:
>
>> You can probably stand down on this one. The issue was that my PC was
>> switching back and forth between IPv4 and IPv6 for whatever reason and when
>> that happened the cookie and my session would get invalidated. Maybe it is
>> worth making code changes so you don't get Python tracebacks dumped to the
>> error logs every time this happens but I have been able to resolve the
>> issue by turning off IPv6 temporarily. That was an interesting one to
>> troubleshoot!
>>
>> On Mon, Oct 9, 2017 at 4:30 AM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> sure Dave
>>>
>>> --
>>> *Harshal Dhumal*
>>> *Sr. Software Engineer*
>>>
>>> EnterpriseDB India: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>> On Mon, Oct 9, 2017 at 1:16 PM, Dave Page  wrote:
>>>
 Harshal, can you help with this please?

 On Sun, Oct 8, 2017 at 12:39 AM, David Gilman 
 wrote:

> 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/pgA
> dmin4.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/pga
> dmin/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.  N

PGAdmin4 - Shortcuts Mac

2017-10-10 Thread Ladislav Gallay
Hello,

 

I would like to request a feature to be able to customize shortcuts (for Mac) 
or make more user-friendly shortcuts, e.g.:

 

Cmd+R – Execute command

Cmd+Arrow Left/Right – Move caret to beginning/end of line

Cmd+Arrow Up/Down – Move caret to top/bottom of text

Alt+Arrow Left/Right – Move caret to previous/next word

 

These are standard shortcuts used across all other editors on Mac.

 

If there is already such request/ticket, can you please share link or status of 
this feature? Thank you very much

 

I really appreciate your work and help in this matter

 

Ing. Ladislav Gallay

CTO, Projektový manažér / Project manager

 

SoftPoint s.r.o.


Softvér pre Váš biznis / Software for your business

Tel./Phone: +421 904 239 193

E-mail: ladislav.gal...@softpoint.sk| i...@softpoint.sk


Web: https://softpoint.tech

 

Office Nitra: Štefánikova trieda 37, 949 01 Nitra

Office Bratislava: Vajnorská 142, 831 04 Bratislava



pgAdmin 4 commit: Ensure HTMLMIN is only used with Python 2.7+

2017-10-10 Thread Dave Page
Ensure HTMLMIN is only used with Python 2.7+

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=91406d2879d2b6a4952d2073727f3771a558f952
Author: Khushboo Vashi 

Modified Files
--
requirements.txt| 2 +-
web/pgadmin/__init__.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)



pgAdmin 4 commit: Remove panels for www.pgadmin.org and www.postgresql.

2017-10-10 Thread Dave Page
Remove panels for www.pgadmin.org and www.postgresql.org as they won't work 
with X-Frame-Options: SAMEORIGIN which is used now.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=63103c7a4869a6594eabde098b527315fefb8df2
Author: Murtuza Zabuawala 

Modified Files
--
web/pgadmin/help/__init__.py | 18 ++
1 file changed, 2 insertions(+), 16 deletions(-)



Re: [pgAdmin4][Patch]: Remove external links from Panel's context menu

2017-10-10 Thread Dave Page
Thanks, applied.

On Mon, Oct 9, 2017 at 1:44 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> ​Hi,
>
> PFA minor patch to remove external links from Panel's context menu.
> RM#2772​
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgAdmin4][Patch]: Enable/Disable passfile filed based on supported libpq version

2017-10-10 Thread Dave Page
Thanks, applied.

On Tue, Oct 10, 2017 at 6:18 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to enable/disable the passfile filed on Create/Edit Server
> dialog based on supported libpq version.
> RM#2768
>
> *Issue:*
> passfile connection parameter is only available with latest version of
> libpq which is libpq10+
> Ref: Link
> 
>
> Please review.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgAdmin 4 commit: Only allow specification of a pgpass file if libpq >=

2017-10-10 Thread Dave Page
Only allow specification of a pgpass file if libpq >= 10. Fixes #2768

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=2f5a2b23920032a05700d921ff955cb69ef275c9
Author: Murtuza Zabuawala 

Modified Files
--
docs/en_US/server_dialog.rst |  6 --
web/pgadmin/browser/__init__.py  | 12 +++-
.../browser/server_groups/servers/static/js/server.js| 10 +-
web/pgadmin/browser/templates/browser/js/utils.js|  1 +
web/pgadmin/utils/driver/abstract.py |  7 +++
web/pgadmin/utils/driver/psycopg2/__init__.py| 12 
6 files changed, 44 insertions(+), 4 deletions(-)



Jenkins build is back to normal : pgadmin4-master-python26 #475

2017-10-10 Thread pgAdmin 4 Jenkins
See 





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

2017-10-10 Thread Dave Page
Thanks, applied.

On Tue, Oct 10, 2017 at 8:13 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi Dave,
>
> Please find attached patch (old RM2713).
> Also for server group and server module login required checks were missing,
> I have added them in same patch
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Tue, Oct 10, 2017 at 11:39 AM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi David,
>>
>> Thanks for you input. Session was not invalidated (otherwise execution
>> would not have reached to connection manager); Only value of '_id' was
>> changed for session.
>>
>> If we look at code
>> 
>> how '_id' is generated then we can see it uses remote address and user-agent
>> to generate it. I thing we should use another session identifier (sid -
>> session id) to map user connection from connection manager.
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Mon, Oct 9, 2017 at 10:18 PM, David Gilman 
>> wrote:
>>
>>> You can probably stand down on this one. The issue was that my PC was
>>> switching back and forth between IPv4 and IPv6 for whatever reason and when
>>> that happened the cookie and my session would get invalidated. Maybe it is
>>> worth making code changes so you don't get Python tracebacks dumped to the
>>> error logs every time this happens but I have been able to resolve the
>>> issue by turning off IPv6 temporarily. That was an interesting one to
>>> troubleshoot!
>>>
>>> On Mon, Oct 9, 2017 at 4:30 AM, Harshal Dhumal <
>>> harshal.dhu...@enterprisedb.com> wrote:
>>>
 sure Dave

 --
 *Harshal Dhumal*
 *Sr. Software Engineer*

 EnterpriseDB India: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company

 On Mon, Oct 9, 2017 at 1:16 PM, Dave Page  wrote:

> Harshal, can you help with this please?
>
> On Sun, Oct 8, 2017 at 12:39 AM, David Gilman 
> wrote:
>
>> 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/pgA
>> dmin4.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/pga
>> dmin/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
>> fo

pgAdmin 4 commit: Fix various issues that could cause an exception on s

2017-10-10 Thread Dave Page
Fix various issues that could cause an exception on startup. Fixes #2713

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=04beec1309d3672576d15c67d9767e9a7ece2976
Author: Harshal Dhumal 

Modified Files
--
web/pgadmin/browser/server_groups/__init__.py | 15 +--
web/pgadmin/browser/server_groups/servers/__init__.py | 16 ++--
web/pgadmin/dashboard/__init__.py |  5 ++---
web/pgadmin/utils/driver/psycopg2/__init__.py | 18 +-
4 files changed, 38 insertions(+), 16 deletions(-)



Jenkins build is back to normal : pgadmin4-master-python36 #349

2017-10-10 Thread pgAdmin 4 Jenkins
See 





Fwd: pgAdmin4 never loading

2017-10-10 Thread Surinder Kumar
Hi Pavel,

Please don't send email personally, instead send to pgadmin-hackers.

Hi

On Tue, Oct 10, 2017 at 12:53 PM, Pavel Klimenko  wrote:

> Thanks, I'll try to do this when there is an opportunity.
>
> What about desktop version, how to fix the same error?
>
T
​he same steps will fix the issue for Desktop version as well.​

>
>
> 2017-10-10 8:12 GMT+03:00 Surinder Kumar 
> :
>
>> Hi
>>
>> 1) Please update the nodeJS to the latest version. v4.2.6 is an older
>> version.
>>
>> 2) Run following commands from '/pgadmin4/web' directory:
>>
>>   a) yarn install
>>   b) yarn run bundle
>>
>> 3) Then run pgAdmin4.
>>
>> and Let us know If you still get an error.
>>
>> Thanks,
>> Surinder
>>
>> On Tue, Oct 10, 2017 at 1:49 AM, Pavel Klimenko 
>> wrote:
>>
>>> My pgadmin4.log is empty. It's empty while I'm rum runtime version
>>> (~/.pgadmin/pgadmin4.log) and in the server (/var/log/pgadmin4/pgadmin4.lo
>>> g).
>>> Error in stdout (runtime version):
>>> "[26404:26874:1009/221031.330527:ERROR:nss_util.cc(808)] After loading
>>> Root Certs, loaded==false: NSS error code: -8018"
>>> Documented steps not help in my desktop case.
>>>
>>> On my servers old node
>>> #node -v
>>> v0.10.29
>>> on debian and
>>> node -v
>>> v4.2.6
>>> on ubuntu. This is a reason of problem?
>>>
>>> 2017-10-09 11:43 GMT+03:00 Surinder Kumar >> om>:
>>>
 Hi Pavel,

 If you are building pgAdmin4 from the source, then you don't need to
 install pgAdmin4 from the wheel.

 After taking the pgAdmin4 source from git HEAD, you need to install
 nodeJS, Yarn to build JS/CSS modules. the error you are getting is possibly
 due to this. For more help, you can follow the steps documented here
 

 It seems QtWekbit compilation went well. so just run pgAdmin4. it
 should work.

 Also, can you share logs generated at location 
 '/var/log/pgadmin4/pgadmin4.log'
 ?

 Thanks,
 Surinder


 On Mon, Oct 9, 2017 at 1:10 PM, Dave Page  wrote:

> Surinder, can you help out with this please?
>
> On Fri, Oct 6, 2017 at 9:00 PM, Pavel Klimenko 
> wrote:
>
>> Hi.
>> I'm get last sources from git.
>> Make runtime application, create virtualenv as  "virtualenv pga4venv"
>> do:
>> source pga4venv/bin/activate
>> pip install -r ../requirements.txt
>> pip install backports.weakref # not run with out it
>> pip install https://ftp.postgresql.org/pub
>> /pgadmin/pgadmin4/v2.0/pip/pgadmin4-2.0-py2.py3-none-any.whl
>> export PYTHONPATH=/pgadmin4/runtime/pga4ven
>> v/lib/python2.7/site-packages/te-packages/
>> make app with QT5:
>> /opt/Qt/5.5/gcc_64/bin/qmake CONFIG+=release
>> do make
>> and run it.
>> App run byt I'm see only "Loading pgAdmin 4 v2.0..."
>> and it's never load.
>> How to fix it?
>>
>> My pip freeze in attachment.
>>
>> $uname -a
>> Linux lptp 4.13.0-12-generic #13-Ubuntu SMP Sat Sep 23 03:40:16 UTC
>> 2017 x86_64 x86_64 x86_64 GNU/Linux
>>
>> $cat /etc/os-release
>> NAME="Ubuntu"
>> VERSION="17.10 (Artful Aardvark)"
>> ID=ubuntu
>> ID_LIKE=debian
>> PRETTY_NAME="Ubuntu Artful Aardvark (development branch)"
>> VERSION_ID="17.10"
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


>>>
>>>
>>> --
>>> Спасибо
>>>
>>
>>
>
>
> --
> Спасибо
>


Re: pgAdmin 4 v1.6 Released!

2017-10-10 Thread Alasdair Campbell
On Fri 14 Jul 2017 14:04:53 GMT, Christoph Berg wrote:
> Am 14. Juli 2017 12:48:16 MESZ schrieb Raymond O'Donnell :
> >Hi all,
> >
> >I'm trying to install pgAdmin4 in server mode on my laptop (Debian 
> >Jessie), and I've got as far as:
> >
> >python setup.py
> >
> >I don't have a python environment set up, so I'm apt-getting my way 
> >through various unmet dependencies, and one has defeated me:
> >
> >Traceback (most recent call last):
> >   File "setup.py", line 23, in 
> > from pgadmin import create_app
> >   File "/var/www/pgadmin/pgadmin/__init__.py", line 19, in 
> > from flask_htmlmin import HTMLMIN
> >ImportError: No module named flask_htmlmin
> >
> >
> >I can't find any corresponding Debian package for flask_htmlmin - what 
> >should I be looking for?
> >
> >Thanks,
> >
> >Ray.
> >
> >-- 
> >Raymond O'Donnell :: Galway :: Ireland
> >r...@iol.ie
> 
> We are working on packaging the missing Python modules for Debian stretch and 
> Jessie. Should be ready over the next weeks, including pgadmin4 packages on 
> apt.postgresql.org.

Hi,

I was just wondering if packaging the missing Python modules for Debian
had been abandoned / forgotten about with the release of pgAdmin4 v2 and
PostgreSQL 10. Trent was trying to build a deb for pgAdmin4 and ran into
the same issue.  I suspect you've seen it Christoph due to the Debian
bug report, but for anyone else:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=834129#23

Al.




pgAdmin 4 commit: Branch refs/heads/WEBPACK_DEVEL was removed

2017-10-10 Thread git
Branch refs/heads/WEBPACK_DEVEL was removed.

pgAdmin 4 commit: Branch refs/heads/WEBPACK_DEVEL2 was created

2017-10-10 Thread git
Branch refs/heads/WEBPACK_DEVEL2 was created.

View: 
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=shortlog;h=refs/heads/WEBPACK_DEVEL2