Re: Can't install pgadmin4 on linux (flask required)

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Mark Murawski <markm-lists(at)intellasoft(dot)net>
Cc: "pgadmin-support(at)postgresql(dot)org" <pgadmin-support(at)postgresql(dot)org>
Subject: Re: Can't install pgadmin4 on linux (flask required)
Date: 2016-11-02 15:12:42
Message-ID: CA+OCxoyjS33r=+PbF7NVOyw9my8-fhUQGK5YdHqJuDH=7q8W0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Hi

On Wednesday, November 2, 2016, Mark Murawski <markm-lists(at)intellasoft(dot)net>
wrote:

> On 11/2/16 8:01 AM, Dave Page wrote:
>
> Hi
>
> On Tuesday, November 1, 2016, Mark Murawski <markm-lists(at)intellasoft(dot)net
> <javascript:_e(%7B%7D,'cvml','markm-lists(at)intellasoft(dot)net');>> wrote:
>
>> On 11/01/16 12:58, Mark Murawski wrote:
>>
>> ----------------------------
>>>
>> The above exception was the direct cause of the following exception:
>>
>> Traceback (most recent call last):
>> File "/home/markm/download/pgadmin4/web/pgAdmin4.py", line 46, in
>> <module>
>> app = create_app()
>> File "/home/markm/download/pgadmin4/web/pgadmin/__init__.py", line
>> 208, in create_app
>> version = Version.query.filter_by(name='ConfigDB').first()
>> File "/home/markm/.virtualenvs/pgadmin4/lib/python3.4/site-packages/sqlalchemy/orm/query.py",
>> line 2659, in first
>> ret = list(self[0:1])
>> File "/home/markm/.virtualenvs/pgadmin4/lib/python3.4/site-packages/sqlalchemy/orm/query.py",
>> line 2457, in __getitem__
>> return list(res)
>> File "/home/markm/.virtualenvs/pgadmin4/lib/python3.4/site-packages/sqlalchemy/orm/query.py",
>> line 2761, in __iter__
>> return self._execute_and_instances(context)
>> File "/home/markm/.virtualenvs/pgadmin4/lib/python3.4/site-packages/sqlalchemy/orm/query.py",
>> line 2776, in _execute_and_instances
>> result = conn.execute(querycontext.statement, self._params)
>> File "/home/markm/.virtualenvs/pgadmin4/lib/python3.4/site-packages/sqlalchemy/engine/base.py",
>> line 914, in execute
>> return meth(self, multiparams, params)
>> File "/home/markm/.virtualenvs/pgadmin4/lib/python3.4/site-packag
>> es/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
>> return connection._execute_clauseelement(self, multiparams, params)
>> File "/home/markm/.virtualenvs/pgadmin4/lib/python3.4/site-packages/sqlalchemy/engine/base.py",
>> line 1010, in _execute_clauseelement
>> compiled_sql, distilled_params
>> File "/home/markm/.virtualenvs/pgadmin4/lib/python3.4/site-packages/sqlalchemy/engine/base.py",
>> line 1146, in _execute_context
>> context)
>> File "/home/markm/.virtualenvs/pgadmin4/lib/python3.4/site-packages/sqlalchemy/engine/base.py",
>> line 1341, in _handle_dbapi_exception
>> exc_info
>> File "/home/markm/.virtualenvs/pgadmin4/lib/python3.4/site-packages/sqlalchemy/util/compat.py",
>> line 202, in raise_from_cause
>> reraise(type(exception), exception, tb=exc_tb, cause=cause)
>> File "/home/markm/.virtualenvs/pgadmin4/lib/python3.4/site-packages/sqlalchemy/util/compat.py",
>> line 185, in reraise
>> raise value.with_traceback(tb)
>> File "/home/markm/.virtualenvs/pgadmin4/lib/python3.4/site-packages/sqlalchemy/engine/base.py",
>> line 1139, in _execute_context
>> context)
>> File "/home/markm/.virtualenvs/pgadmin4/lib/python3.4/site-packag
>> es/sqlalchemy/engine/default.py", line 450, in do_execute
>> cursor.execute(statement, parameters)
>> sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such
>> table: version [SQL: 'SELECT version.name AS version_name, version.value
>> AS version_value \nFROM version \nWHERE version.name = ?\n LIMIT ?
>> OFFSET ?'] [parameters: ('ConfigDB', 1, 0)]
>> "Failed to launch the application server, server thread exiting."
>>
>
> Sounds like your earlier attempt created a broken config database. Try 'rm
> ~/.pgadmin/pgadmin4.db' (or whatever would be appropriate for the settings
> you have) and then start pgAdmin again. It should recreate the database and
> start up if all is well.
>
> Regards, Dave.
>
>
> Cool. Deleted the DB and now it started up. Seems to be working now.
>

Great. FYI, I just committed a change to better detect and handle issues
where the config database isn't properly created.

>
> Is there a way to import my db connection list from pgadmin3?
>

No, sorry.

>
> I'm sure you already know, in this day and age, users want things to 'just
> work'. I know pgadmin4 is a young project, but here's a number of things
> that will help boost adoption and make for an overall better experience.
>
> Suggestions so far:
> - Update requirements_py3.txt -- django-htmlmin==0.10.0
> - Pre or post-make, check for dependencies on virtualenv and all that. if
> on debian environment, recommend install of virtualenvwrapper
>

Yeah, I'd like to figure out how to automatically check the environment at
startup. It wouldn't be tied to make - we don't really want users to have
to deal with that at all, but would rather have packages built.

>
> - Post-build auto setup script for virtualenv
> -- Detect default python version based on the qmake results
> -- Detect path if possible of virtualenvwrapper based on host-distro,
> if path not detected, bail or attempt to download/install automatically?
> -- create virtual env for pgadmin4
> -- pip install dependencies for pgadmin4 in the new virtualenv
> -- create wrapper script to start pgadmin4 using this new virtualenv,
> instruct users to use this for launching app
>

Most of that should really be handled by packagers - it's very
system/distro specific and would be quite difficult for us to automate.

> -- Detect broken database (if core schema parts are missing) and ask
> user if it's okay to rebuild
>

That's essentially what I just committed. If the config database seems to
be broken, it will move it out of the way (telling you where it put it) and
ask you to restart pgAdmin to recreate it. Fully automating that is
somewhat non-trivial, and not really worth the effort for such a corner
case.

Thanks, Dave.

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

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

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Albin, Lloyd P 2016-11-02 19:00:32 Editing View Bug
Previous Message Mark Murawski 2016-11-02 14:54:51 Re: pgAdmin 4 1.1, query error while browsing columns