Re: Syntax error on pgAdmin4 start

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Marco Azzalini <mark(dot)azzalini(at)gmail(dot)com>
Cc: Aditya Toshniwal <aditya(dot)toshniwal(at)enterprisedb(dot)com>, "pgadmin-support lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: Re: Syntax error on pgAdmin4 start
Date: 2020-10-05 12:10:41
Message-ID: CA+OCxozhd2LpNSoiAgmRx8EB59qx79Y_mBJ6Yim_4OVC2Vx=GA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On Mon, Oct 5, 2020 at 1:05 PM Marco Azzalini <mark(dot)azzalini(at)gmail(dot)com>
wrote:

> so, I don't have to follow these steps? The ones suggested by Aditya, I
> mean.
>

Well those steps are for the "official" RPMs that the pgAdmin development
team produce, but we don't support Suse. Given the way your RPM
installation seems to be installed (such as the presence of
config_system.py and the inclusion of a corrupted test script, which
shouldn't even be distributed in it's uncorrupted form), the Suse RPMs are
built in a different way which we have no knowledge of. I think your only
option is to contact the maintainer of those RPMs, or use one of the other
distributions from pgadmin.org, such as the Python package.

>
> Please, let me know.
> Marco
>
> Il giorno lun 5 ott 2020 alle ore 12:06 Dave Page <dpage(at)pgadmin(dot)org> ha
> scritto:
>
>>
>>
>> On Mon, Oct 5, 2020 at 11:04 AM Aditya Toshniwal <
>> aditya(dot)toshniwal(at)enterprisedb(dot)com> wrote:
>>
>>> Hi Marco,
>>>
>>> Please follow the steps here -
>>> https://www.pgadmin.org/download/pgadmin-4-rpm/ and install the desktop
>>> mode of pgAdmin. You must have installed the web mode, which is generally
>>> used for server deployment and has users who can log in.
>>>
>>
>> Those steps are for our repos, which do not include Suse support.
>>
>> It seems like the Suse RPMs are basically broken. They shouldn't blindly
>> set a username/password.
>>
>>
>>>
>>> On Mon, Oct 5, 2020 at 3:14 PM Marco Azzalini <mark(dot)azzalini(at)gmail(dot)com>
>>> wrote:
>>>
>>>> I installed pgAdmin, as usual using Suse YAST Software manager. I just
>>>> reinstalled it manually (ie, rpm -i pgadmin4-4.26-2.1.x86_64.rpm) with same
>>>> result.
>>>> I checked the documentation page you mentioned and, yes, I have a file
>>>> /etc/pgAdmin/config_system.py.
>>>> It has one single line: SERVER_MODE = True
>>>>
>>>> Do I have to switch it to false?
>>>>
>>>> Marco
>>>>
>>>> Il giorno lun 5 ott 2020 alle ore 11:13 Aditya Toshniwal <
>>>> aditya(dot)toshniwal(at)enterprisedb(dot)com> ha scritto:
>>>>
>>>>> Hi Marco,
>>>>>
>>>>> How did you install pgAdmin ? Your application is running under server
>>>>> mode - https://www.pgadmin.org/docs/pgadmin4/4.26/config_py.html
>>>>>
>>>>> On Mon, Oct 5, 2020 at 2:20 PM Marco Azzalini <mark(dot)azzalini(at)gmail(dot)com>
>>>>> wrote:
>>>>>
>>>>>> Hi, the bug is that now pgAdmin4 start page is the following
>>>>>> [image: image.png]
>>>>>> and it asks for a login name and password, both related to an account
>>>>>> of which I have no idea and there seems to be no way to create one.
>>>>>>
>>>>>> I am going to remove it and reinstall through command line to see if
>>>>>> it ask me for create a new account.
>>>>>>
>>>>>> Marco
>>>>>>
>>>>>> Il giorno lun 5 ott 2020 alle ore 10:41 Aditya Toshniwal <
>>>>>> aditya(dot)toshniwal(at)enterprisedb(dot)com> ha scritto:
>>>>>>
>>>>>>> Hi Marco,
>>>>>>>
>>>>>>> Can you give more details on the bug and screenshot ?
>>>>>>> There is no major change between 4.22 to 4.26 related to this.
>>>>>>>
>>>>>>> On Mon, Oct 5, 2020 at 1:58 PM Marco Azzalini <
>>>>>>> mark(dot)azzalini(at)gmail(dot)com> wrote:
>>>>>>>
>>>>>>>> hi Aditya, thanks a lot. It worked! :-) But... :-(
>>>>>>>> I hit a bug related to the fact that pgAdmin4 now is asking for a
>>>>>>>> username and password, as described here:
>>>>>>>>
>>>>>>>> https://forums.opensuse.org/showthread.php/545053-How-to-get-pgadmin4-working-while-waiting-for-a-new-update
>>>>>>>> The proposed workaround seem a little bit tricky so I think I am
>>>>>>>> going to try to downgrade to 4.22 version...
>>>>>>>>
>>>>>>>> Do you know if is there a way to create the account that pgAdmin4
>>>>>>>> is asking for?
>>>>>>>> thanks,
>>>>>>>> Marco
>>>>>>>>
>>>>>>>> Il giorno lun 5 ott 2020 alle ore 09:40 Aditya Toshniwal <
>>>>>>>> aditya(dot)toshniwal(at)enterprisedb(dot)com> ha scritto:
>>>>>>>>
>>>>>>>>> Hi Marco,
>>>>>>>>>
>>>>>>>>> The file has contents which are not shipped with pgAdmin
>>>>>>>>> installation. It is tampered somehow in your installation. I would suggest
>>>>>>>>> uninstall and install again.
>>>>>>>>>
>>>>>>>>> On Mon, Oct 5, 2020 at 12:57 PM Marco Azzalini <
>>>>>>>>> mark(dot)azzalini(at)gmail(dot)com> wrote:
>>>>>>>>>
>>>>>>>>>> Thanks Aditya, attached you can find the file __init__.py
>>>>>>>>>>
>>>>>>>>>> many thanks,
>>>>>>>>>> Marco
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Il giorno lun 5 ott 2020 alle ore 07:02 Aditya Toshniwal <
>>>>>>>>>> aditya(dot)toshniwal(at)enterprisedb(dot)com> ha scritto:
>>>>>>>>>>
>>>>>>>>>>> Hi Marco,
>>>>>>>>>>>
>>>>>>>>>>> Can you share the contents of file - /usr/lib/python3.8/site-
>>>>>>>>>>> packages/pgadmin4-web/pgadmin/browser/server_groups/servers/
>>>>>>>>>>> databases/schemas/tables/row_security_policies/tests/__init__.py
>>>>>>>>>>> ?
>>>>>>>>>>> There is no such select statement in the original source code.
>>>>>>>>>>>
>>>>>>>>>>> On Fri, Oct 2, 2020 at 10:29 PM Marco Azzalini <
>>>>>>>>>>> mark(dot)azzalini(at)gmail(dot)com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi, this is my first message here.
>>>>>>>>>>>> Today my pgAdmin4 console doesn't start anymore... it takes
>>>>>>>>>>>> lots of time and then a pop up appears complaining that pgAdmin server
>>>>>>>>>>>> could not be contacted
>>>>>>>>>>>>
>>>>>>>>>>>> at the end of the log there is this error:
>>>>>>>>>>>>
>>>>>>>>>>>> * File
>>>>>>>>>>>> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/__init__.py",
>>>>>>>>>>>> line 1*
>>>>>>>>>>>>
>>>>>>>>>>>> * SELECT rel.oid, rel.relname AS name,*
>>>>>>>>>>>>
>>>>>>>>>>>> * ^*
>>>>>>>>>>>>
>>>>>>>>>>>> *SyntaxError: invalid syntax*
>>>>>>>>>>>>
>>>>>>>>>>>> My system is Linux OpenSuse Tumbleweed and the pgAdmin version
>>>>>>>>>>>> is 4.26-2.1 (the latest available for my system)
>>>>>>>>>>>> Recently I got some updates for python subsystem... now I have
>>>>>>>>>>>> Python 3.8.5
>>>>>>>>>>>>
>>>>>>>>>>>> may be this be the source of the problem?
>>>>>>>>>>>> How can I fix it?
>>>>>>>>>>>>
>>>>>>>>>>>> thanks in advance for any hint
>>>>>>>>>>>> Marco
>>>>>>>>>>>>
>>>>>>>>>>>> Full log :
>>>>>>>>>>>> ----------------------------------------
>>>>>>>>>>>>
>>>>>>>>>>>> Traceback (most recent call last):
>>>>>>>>>>>>
>>>>>>>>>>>> File
>>>>>>>>>>>> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgAdmin4.py", line 93, in
>>>>>>>>>>>> <module> app = create_app()
>>>>>>>>>>>>
>>>>>>>>>>>> File
>>>>>>>>>>>> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/__init__.py", line
>>>>>>>>>>>> 618, in create_app app.register_blueprint(module)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98,
>>>>>>>>>>>> in wrapper_func return f(self, *args, **kwargs)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line
>>>>>>>>>>>> 1168, in register_blueprint blueprint.register(self, options,
>>>>>>>>>>>> first_registration)
>>>>>>>>>>>>
>>>>>>>>>>>> File
>>>>>>>>>>>> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py",
>>>>>>>>>>>> line 71, in register app.register_blueprint(module)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98,
>>>>>>>>>>>> in wrapper_func return f(self, *args, **kwargs)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line
>>>>>>>>>>>> 1168, in register_blueprint blueprint.register(self, options,
>>>>>>>>>>>> first_registration)
>>>>>>>>>>>>
>>>>>>>>>>>> File
>>>>>>>>>>>> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py",
>>>>>>>>>>>> line 71, in register app.register_blueprint(module)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98,
>>>>>>>>>>>> in wrapper_func return f(self, *args, **kwargs)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line
>>>>>>>>>>>> 1168, in register_blueprint blueprint.register(self, options,
>>>>>>>>>>>> first_registration)
>>>>>>>>>>>>
>>>>>>>>>>>> File
>>>>>>>>>>>> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/browser/server_groups/servers/__init__.py",
>>>>>>>>>>>> line 309, in register super(ServerModule, self).register(app, options,
>>>>>>>>>>>> first_registration)
>>>>>>>>>>>>
>>>>>>>>>>>> File
>>>>>>>>>>>> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py",
>>>>>>>>>>>> line 71, in register app.register_blueprint(module)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98,
>>>>>>>>>>>> in wrapper_func return f(self, *args, **kwargs)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line
>>>>>>>>>>>> 1168, in register_blueprint blueprint.register(self, options,
>>>>>>>>>>>> first_registration)
>>>>>>>>>>>>
>>>>>>>>>>>> File
>>>>>>>>>>>> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py",
>>>>>>>>>>>> line 71, in register app.register_blueprint(module)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98,
>>>>>>>>>>>> in wrapper_func return f(self, *args, **kwargs)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line
>>>>>>>>>>>> 1168, in register_blueprint blueprint.register(self, options,
>>>>>>>>>>>> first_registration)
>>>>>>>>>>>>
>>>>>>>>>>>> File
>>>>>>>>>>>> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py",
>>>>>>>>>>>> line 71, in register app.register_blueprint(module)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98,
>>>>>>>>>>>> in wrapper_func return f(self, *args, **kwargs)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line
>>>>>>>>>>>> 1168, in register_blueprint blueprint.register(self, options,
>>>>>>>>>>>> first_registration)
>>>>>>>>>>>>
>>>>>>>>>>>> File
>>>>>>>>>>>> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py",
>>>>>>>>>>>> line 71, in register app.register_blueprint(module)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98,
>>>>>>>>>>>> in wrapper_func return f(self, *args, **kwargs)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib/python3.8/site-packages/flask/app.py", line
>>>>>>>>>>>> 1168, in register_blueprint blueprint.register(self, options,
>>>>>>>>>>>> first_registration)
>>>>>>>>>>>>
>>>>>>>>>>>> File
>>>>>>>>>>>> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py",
>>>>>>>>>>>> line 64, in register self.submodules =
>>>>>>>>>>>> list(app.find_submodules(self.import_name))
>>>>>>>>>>>>
>>>>>>>>>>>> File
>>>>>>>>>>>> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/__init__.py", line
>>>>>>>>>>>> 67, in find_submodules module = import_module(module_name)
>>>>>>>>>>>>
>>>>>>>>>>>> File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in
>>>>>>>>>>>> import_module return _bootstrap._gcd_import(name[level:], package, level)
>>>>>>>>>>>>
>>>>>>>>>>>> File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
>>>>>>>>>>>>
>>>>>>>>>>>> File "<frozen importlib._bootstrap>", line 991, in
>>>>>>>>>>>> _find_and_load
>>>>>>>>>>>>
>>>>>>>>>>>> File "<frozen importlib._bootstrap>", line 975, in
>>>>>>>>>>>> _find_and_load_unlocked
>>>>>>>>>>>>
>>>>>>>>>>>> File "<frozen importlib._bootstrap>", line 671, in
>>>>>>>>>>>> _load_unlocked
>>>>>>>>>>>>
>>>>>>>>>>>> File "<frozen importlib._bootstrap_external>", line 779, in
>>>>>>>>>>>> exec_module
>>>>>>>>>>>>
>>>>>>>>>>>> File "<frozen importlib._bootstrap_external>", line 916, in
>>>>>>>>>>>> get_code
>>>>>>>>>>>>
>>>>>>>>>>>> File "<frozen importlib._bootstrap_external>", line 846, in
>>>>>>>>>>>> source_to_code
>>>>>>>>>>>>
>>>>>>>>>>>> File "<frozen importlib._bootstrap>", line 219, in
>>>>>>>>>>>> _call_with_frames_removed
>>>>>>>>>>>>
>>>>>>>>>>>> File
>>>>>>>>>>>> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/__init__.py",
>>>>>>>>>>>> line 1
>>>>>>>>>>>>
>>>>>>>>>>>> SELECT rel.oid, rel.relname AS name,
>>>>>>>>>>>>
>>>>>>>>>>>> ^
>>>>>>>>>>>>
>>>>>>>>>>>> SyntaxError: invalid syntax
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> Thanks,
>>>>>>>>>>> Aditya Toshniwal
>>>>>>>>>>> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
>>>>>>>>>>> <http://edbpostgres.com>
>>>>>>>>>>> "Don't Complain about Heat, Plant a TREE"
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>>
>>>>>>>>>> https://ilmilione.org
>>>>>>>>>> ----
>>>>>>>>>> Anche sogliono essere odiatissimi i buoni e i generosi perché ordinariamente sono sinceri, e chiamano le cose coi loro nomi.
>>>>>>>>>> Colpa non perdonata dal genere umano, il quale non odia mai tanto chi fa male, né il male stesso, quanto chi lo nomina.
>>>>>>>>>> - Leopardi -
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Thanks,
>>>>>>>>> Aditya Toshniwal
>>>>>>>>> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
>>>>>>>>> <http://edbpostgres.com>
>>>>>>>>> "Don't Complain about Heat, Plant a TREE"
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>> https://ilmilione.org
>>>>>>>> ----
>>>>>>>> Anche sogliono essere odiatissimi i buoni e i generosi perché ordinariamente sono sinceri, e chiamano le cose coi loro nomi.
>>>>>>>> Colpa non perdonata dal genere umano, il quale non odia mai tanto chi fa male, né il male stesso, quanto chi lo nomina.
>>>>>>>> - Leopardi -
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Thanks,
>>>>>>> Aditya Toshniwal
>>>>>>> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
>>>>>>> <http://edbpostgres.com>
>>>>>>> "Don't Complain about Heat, Plant a TREE"
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> https://ilmilione.org
>>>>>> ----
>>>>>> Anche sogliono essere odiatissimi i buoni e i generosi perché ordinariamente sono sinceri, e chiamano le cose coi loro nomi.
>>>>>> Colpa non perdonata dal genere umano, il quale non odia mai tanto chi fa male, né il male stesso, quanto chi lo nomina.
>>>>>> - Leopardi -
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Thanks,
>>>>> Aditya Toshniwal
>>>>> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
>>>>> <http://edbpostgres.com>
>>>>> "Don't Complain about Heat, Plant a TREE"
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> https://ilmilione.org
>>>> ----
>>>> Anche sogliono essere odiatissimi i buoni e i generosi perché ordinariamente sono sinceri, e chiamano le cose coi loro nomi.
>>>> Colpa non perdonata dal genere umano, il quale non odia mai tanto chi fa male, né il male stesso, quanto chi lo nomina.
>>>> - Leopardi -
>>>>
>>>>
>>>
>>> --
>>> Thanks,
>>> Aditya Toshniwal
>>> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
>>> <http://edbpostgres.com>
>>> "Don't Complain about Heat, Plant a TREE"
>>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EDB: http://www.enterprisedb.com
>>
>>
>
> --
>
> https://ilmilione.org
> ----
> Anche sogliono essere odiatissimi i buoni e i generosi perché ordinariamente sono sinceri, e chiamano le cose coi loro nomi.
> Colpa non perdonata dal genere umano, il quale non odia mai tanto chi fa male, né il male stesso, quanto chi lo nomina.
> - Leopardi -
>
>

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

EDB: http://www.enterprisedb.com

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Le-DOC 2020-10-05 13:14:16 Pgadmin with active directory.
Previous Message Marco Azzalini 2020-10-05 12:05:35 Re: Syntax error on pgAdmin4 start