Re: pgAdmin 4.1.6 can't backup

2017-09-15 Thread Murtuza Zabuawala
Hi,

Could you provide us pgAdmin4 log file named 'pgadmin4.log'?
*Log Location:* "C:\Users\**\AppData\Roaming\pgAdmin"

Set the log level to debug (Ref: https://www.pgadmin.org/faq/#8),
Rename/Delete the old log file, restart pgAdmin4 and try to re-produce the
issue again and then send us log file.




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

[image: https://community.postgresrocks.net/]


On Fri, Sep 15, 2017 at 5:32 AM, Julio Aguilar  wrote:

> pgAdmin 4  1.6
> Desktop mode
> Windows 10 (es_mx regional configuration if that matters)
> Postgresql 9.6
>
>
>
> If I start a local backup (Custom type, default options in everything) I
> get a small dialog with the error
>
> object of type 'bool' has no len()
>
>
> If I try a remote backup with the same options, the program crashes with a
> "Python stopped working" dialog.
>
> Both backups worked if done on command line with pg_dump.
>
>
> I have Pyhton 3.6 on the PATH recently installed. Could that be the
> problem?
>


Re: Hosting pgAdmin4 with Apache/WSGI

2017-09-15 Thread Gabriel Sánchez
On Thu, Sep 14, 2017 at 2:33 PM, Dave Page  wrote:

>
>
> On Thu, Sep 14, 2017 at 5:59 PM, Mike Surcouf  wrote:
>
>> I share your pain.
>>
>> I do have it working but as a root app and it took me a while to work
>> through the docs and fill in the blanks.
>>
>> I think Dave was looking at making server install much easier but not
>> sure if anything was implemented in the next version.
>>
>
> It has been, and the docs are updated on the website and in the test
> builds.
>

>
>> Regarding issue #2 running the app as a subdirectory this was broken in
>> 1.6
>>
>> As you have found the docs won’t give you a working solution.
>>
>> You can work around this by running the app in the root of apache but
>> that’s not a great solution.
>>
>> I am waiting on 1.7 to fix this but there is no info on release as of yet.
>>
>
> https://developer.pgadmin.org/~dpage/2.0-rc1/
>
> I'm probably not going to release that as there have been a few fixes
> since then, but that build includes the "server mode out of the box" config
> (though, if using the wheel or source, you will need to create
> /var/log/pgadmin and /var/lib/pgadmin and change the owner to whoever you
> run the server as), and webpacking of all the code which makes it *much*
> faster.
>
>

Thanks.  I installed RC1 in as before (in a virtual environment and with
the modification on pgadmin.wsgi to activate the virtual environment (see
Issue #1 in the original post)), and I'm trying to run it on the web root,
but I'm getting the following in the apache error log:

[mod_wsgi (pid=12596): Target WSGI script
'/opt/pgadmin4_2/virtualenv/lib/python2.7/site-packages/pgadmin4/pgAdmin4.wsgi'
cannot be loaded as Python module.
mod_wsgi (pid=12596): Exception occurred processing WSGI script
'/opt/pgadmin4_2/virtualenv/lib/python2.7/site-packages/pgadmin4/pgAdmin4.wsgi'.
 Traceback (most recent call last):
   File
"/opt/pgadmin4_2/virtualenv/lib/python2.7/site-packages/pgadmin4/pgAdmin4.wsgi",
line 20, in 
 import config
   File
"/opt/pgadmin4_2/virtualenv/lib/python2.7/site-packages/pgadmin4/config.py",
line 118, in 
 if builtins.SERVER_MODE is None:
 AttributeError: 'module' object has no attribute 'SERVER_MODE'

Any suggestions on what to try next?

I also tried it without the modification to pgadmin.wsgi, but I was getting
an error similar to before, with "ImportError: No module named
flask_paranoid", and the activation of the virtual environment seems to
have addressed that.

Is the modification to pgadmin.wsgi to activate the virtual environment a
good fix?  Or is there an option I could add in config_local.py with a path
to the virtual environment?

And, just to confirm, does v2 RC1 run from a subdirectory as well as on web
root?




>
>>
>> *From:* Gabriel Sánchez [mailto:gabrielesanc...@gmail.com]
>> *Sent:* 14 September 2017 17:32
>> *To:* pgadmin-supp...@postgresql.org
>> *Subject:* Hosting pgAdmin4 with Apache/WSGI
>>
>>
>>
>> Hi team,
>>
>>
>>
>> Thanks for the hard work you've put in to develop pgAdmin4 and provide
>> support to the community.  I'm writing to ask for your help to set up
>> pgAdmin4 in server mode under Apache with WSGI.  I'm running Ubuntu 16.04
>> Server and installing pgAdmin4 version 1.6 with Python 2.7.12.  A couple of
>> issues are getting in the way.
>>
>>
>>
>> *Issue #1  Installation*
>>
>>
>>
>> I struggled to install pgAdmin4 with the online documentation, being
>> unfamiliar with Python and WSGI.  I followed the instructions on the
>> pgAdmin website but I was not getting the pgAdmin page on my browser.
>>
>>
>>
>> I turned on debug logging in apache and was getting the following
>> (details redacted):
>>
>>
>>
>> 
>>
>> mod_wsgi (pid): Target WSGI script '/opt/pgadmin4/virtualenv/lib/
>> python2.7/site-packages/pgadmin4/pgAdmin4.wsgi' cannot be loaded as
>> Python module.
>>
>> mod_wsgi (pid): Exception occurred processing WSGI script
>> '/opt/pgadmin4/virtualenv/lib/python2.7/site-packages/pgadmin4/pgAdmin4.wsgi'.
>>
>>
>> Traceback (most recent call last):
>>
>> File 
>> "/opt/pgadmin4/virtualenv/lib/python2.7/site-packages/pgadmin4/pgAdmin4.wsgi",
>> line 17, in 
>>
>>  import config
>>
>>File 
>> "/opt/pgadmin4/virtualenv/lib/python2.7/site-packages/pgadmin4/config.py",
>> line 24, in 
>>
>>  from pgadmin.utils import env, IS_PY2, IS_WIN, fs_short_path
>>
>>File 
>> "/opt/pgadmin4/virtualenv/lib/python2.7/site-packages/pgadmin4/pgadmin/__init__.py",
>> line 17, in 
>>
>>  from flask import Flask, abort, request, current_app, session
>>
>>  ImportError: No module named flask
>>
>> 
>>
>>
>>
>> But flask *was* installed in the virtual environment!  I also ran
>> setup.py within the virtual environment.  After hours of reading forum and
>> mailing list posts, scanning error logs, and trying things, I was able to
>> get to the pgAdmin4 landing page.  As best I can tell, the issue was that I
>> installed pgAdmin4 in a virtual environment, under
>> /opt/pgadmin4/virtualenv, but apache2 wasn't using