Error while connecting server on pgAdmin4 (KeyError: 'version')

2020-05-05 Thread Mishika Singh
I have cloned the pgAdmin4 project, while trying to connect to the server
on pgAdmin4, I am getting following error in the logs:

KeyError: 'version'
2020-05-01 13:04:19,608: ERROR flask.app: 'version'
Traceback (most recent call last):
File "/pgadmin4/web/pgadmin/browser/server_groups/servers/_init_.py",
line 828, in create
server_types=ServerType.types()
File "/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line
373, in connect
raise e
File "/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line
366, in connect
status, msg = self._initialize(conn_id, **kwargs)
File "/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line
489, in _initialize
manager.ver = row['version']
KeyError: 'version'


-- 
Regards
Mishika Singh


Re: Error while connecting server on pgAdmin4 (KeyError: 'version')

2020-05-05 Thread Khushboo Vashi
On Tue, May 5, 2020 at 12:33 PM Mishika Singh  wrote:

> I have cloned the pgAdmin4 project, while trying to connect to the server
> on pgAdmin4, I am getting following error in the logs:
>
> KeyError: 'version'
> 2020-05-01 13:04:19,608: ERROR flask.app: 'version'
> Traceback (most recent call last):
> File "/pgadmin4/web/pgadmin/browser/server_groups/servers/_init_.py", line 
> 828, in create
> server_types=ServerType.types()
> File "/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line 373, 
> in connect
> raise e
> File "/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line 366, 
> in connect
> status, msg = self._initialize(conn_id, **kwargs)
> File "/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line 489, 
> in _initialize
> manager.ver = row['version']
> KeyError: 'version'
>
>
> Which PostgreSQL version are you trying to connect?

> --
> Regards
> Mishika Singh
>


Re: [pgAdmin 4 - Housekeeping #5255] Implement Selenium Grid using multi-threading & solenoid using current test framework

2020-05-05 Thread Akshay Joshi
Hi Yogesh

Following are the review comments:

   - *pyjq* package is not required as we used it only in one place. A
   result is a normal dictionary that can be easily looped through.
   - Remove "*if (SUPPORT_SSH_TUNNEL is True and ...*" logic from
   config.py, we have already removed that.
   - Remove yarn.lock file.
   - Remove *pyperclip *from the regression/requirements.txt as we are not
   using it.
   - Please mentioned the value of *pgAdmin_default_server *should not be '
   *127.0.0.1*' in the README file even though everything runs on the same
   machine.
   - Please mentioned that if we set the value of the browser version is
   *null* then selenoid will take the latest available browser version.
   - Got the below error if selenoid_url is not provided:
  - list index out of range
  Unable to find Selenoid Status

*test_config.json.in *:

   - "selenoid_info" should be renamed to "selenoid_config". Proper
   alignment is required.
   - "cross_Browsers" should be renamed to "cross_browsers" or
   "run_on_browsers" or "run_tests_on_browsers". Provide entries for supported
   browsers with version set to null so that it will run on the latest browser
   version.
   - "selenoid_url": "Selenoid Url" should be changed to "selenoid_url":
   "http://:/wd/hub".

If you change the names in test_config.json.in then please update the same
in README as well.


On Mon, May 4, 2020 at 4:27 PM Yogesh Mahajan <
yogesh.maha...@enterprisedb.com> wrote:

> Hi Akshay,
>
> Please find the updated patch.
>
> Thanks,
> Yogesh Mahajan
> QA - Team
> EnterpriseDB Corporation
>
> Phone: +91-9741705709
>
>
> On Mon, May 4, 2020 at 2:51 PM Akshay Joshi 
> wrote:
>
>> Hi Yogesh
>>
>> The patch is not applied to the master branch. Can you please rebase and
>> send the patch again.
>>
>> On Fri, May 1, 2020 at 12:28 PM Yogesh Mahajan <
>> yogesh.maha...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find updated patch modified according to review comments -
>>> Patch implements below things -
>>> 1.Enable the current framework to provide option to execute Feature
>>> tests in parallel  on selenium grid set up.
>>>- Addition of new switch to start parallel features tests.
>>>- New parameters with respect to selenoid in test_config.json.in
>>>- Addition of new script to check solenoid updates.
>>>
>>>
>>>
>>> Thanks,
>>> Yogesh Mahajan
>>> QA - Team
>>> EnterpriseDB Corporation
>>>
>>> Phone: +91-9741705709
>>>
>>>
>>> On Tue, Apr 21, 2020 at 1:18 PM Shubham Agarwal <
>>> shubham.agar...@enterprisedb.com> wrote:
>>>
 Hi Yogesh,
 Below are the review comments-

 1. runtests.py
 a. The exception traceback logic at line number 653 in runtests.py
 is not correct since it is particular to the thread
 but there is much more code in that block which can throw some
 exception.
 b. line number 447 -> The drop_database function will only try to drop
 the database with the name which is newly created
 at 431 line number, its probability is 1% instead of this you can write
 a logic so that it will drop all the database which starts with name
 ‘acceptance_test_db'.
   c. line 584 - Why we are including resql test case execution in GUI
 execution logic.
 d. Change the function name run_test as script name is also
 runtests.py

 2. test_utils.py
 a. Remove the headless chrome code from get_remote_webdriver() in
 test_utils.py since we are using solenoid and it is not required
 anymore.
 b. Create separate functions to instantiate the firefox driver and
 chrome driver logic since the same code is used in multiple files.
 c. launch_url_in_browser() -> you can simplify the definition of the
 function like:
 retry = 60
 *while *retry > 0:
 try:
 driver.get(url)
 except WebDriverException:
  retry -= 1
 3. Execution logs are not printing as per the logic some time, I ran
 the suite for two servers and attached are the execution logs.
 4. Readme -
 Please provide the Valid selenoid URL to be provided in the
 test_config.json, with all the steps mentioned in the readme it is not
 clear.
 Revisit the readme and write the missing steps.
 5. copy_selected_query_results_feature_tests.py-
 Create the function to avoid duplicate code. The code for pasting the
 values is repeating 8 times in the test code.
 6. Provide the valid docstring in newly introduced functions and also
 valid comments while calling it. for ex.- _update_preference() function is
 introduced in pg_utilities_backup_restrore_test.py but from the
 function name, it is not clear what preferences are going to update in it.
 7. test_index_constraint_add test case is failing due to the latest
 change, please merge and update this test case

 On Thu, Apr 16,

[pgAdmin][RM5480]Background job creation failure.

2020-05-05 Thread Nagesh Dhope
Hi Hacke
The attached patch fixes background job creation failure when there is only
version-specific python binary available in $PATH.

-- 
Thanks,,
Nagesh


RM5480.patch
Description: Binary data


Contribute in pgAdmin to remove password length restrictions

2020-05-05 Thread Mishika Singh
Hi,

In pgAdmin4 there is a restriction on the password length while trying to
connect to the server, the limit is 255. I have a use case where password
length is more than that.

I want to contribute to the project for this change, please point me with
any documentation and procedure to be followed to contribute.

-- 
Regards
Mishika Singh


Re: Contribute in pgAdmin to remove password length restrictions

2020-05-05 Thread Aditya Toshniwal
Hi Mishika,

Please go to - https://www.pgadmin.org/development/resources/#list for more
information. All the steps to run pgAdmin in the dev environment is
mentioned in the README.
You can create a feature here -
https://redmine.postgresql.org/projects/pgadmin4/issues and start working
on it.

Let us know if you have any questions.

On Tue, May 5, 2020 at 7:23 PM Mishika Singh  wrote:

> Hi,
>
> In pgAdmin4 there is a restriction on the password length while trying to
> connect to the server, the limit is 255. I have a use case where password
> length is more than that.
>
> I want to contribute to the project for this change, please point me with
> any documentation and procedure to be followed to contribute.
>
> --
> Regards
> Mishika Singh
>


-- 
Thanks and Regards,
Aditya Toshniwal
pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"


wsgi:error AttributeError: module 'pkg_resources' has no attribute 'resource_filename'

2020-05-05 Thread Nagaraj Raj
Hella,

I'm trying to install pgAdmin on Redhat and end up with below error,

Wed May 06 00:53:35.157756 2020] [wsgi:error] [pid 6973] mod_wsgi (pid=6973): 
Failed to exec Python script file 
'/usr/lib/python3.6/site-packages/pgadmin4-web/pgAdmin4.wsgi'.
[Wed May 06 00:53:35.157820 2020] [wsgi:error] [pid 6973] mod_wsgi (pid=6973): 
Exception occurred processing WSGI script 
'/usr/lib/python3.6/site-packages/pgadmin4-web/pgAdmin4.wsgi'.
[Wed May 06 00:53:35.157959 2020] [wsgi:error] [pid 6973]  Traceback (most 
recent call last):
[Wed May 06 00:53:35.158001 2020] [wsgi:error] [pid 6973]   File 
"/usr/lib/python3.6/site-packages/pgadmin4-web/pgAdmin4.wsgi", line 36, in 

[Wed May 06 00:53:35.158009 2020] [wsgi:error] [pid 6973]  from pgAdmin4 
import app as application
[Wed May 06 00:53:35.158018 2020] [wsgi:error] [pid 6973]   File 
"/usr/lib/python3.6/site-packages/pgadmin4-web/pgAdmin4.py", line 109, in 

[Wed May 06 00:53:35.158023 2020] [wsgi:error] [pid 6973] app = create_app()
[Wed May 06 00:53:35.158031 2020] [wsgi:error] [pid 6973] File 
"/usr/lib/python3.6/site-packages/pgadmin4-web/pgadmin/__init__.py", line 379, 
in create_app
[Wed May 06 00:53:35.158036 2020] [wsgi:error] [pid 6973]
security.init_app(app, user_datastore)
[Wed May 06 00:53:35.158043 2020] [wsgi:error] [pid 6973]   File 
"/usr/lib/python3.6/site-packages/pgadmin4-web/flask_security/core.py", line 
503, in init_app
[Wed May 06 00:53:35.158048 2020] [wsgi:error] [pid 6973]  
anonymous_user=anonymous_user)
[Wed May 06 00:53:35.158055 2020] [wsgi:error] [pid 6973]   File 
"/usr/lib/python3.6/site-packages/pgadmin4-web/flask_security/core.py", line 
332, in _get_state
[Wed May 06 00:53:35.158060 2020] [wsgi:error] [pid 6973] 
i18n_domain=_get_i18n_domain(app),
[Wed May 06 00:53:35.158067 2020] [wsgi:error] [pid 6973]   File 
"/usr/lib/python3.6/site-packages/pgadmin4-web/flask_security/core.py", line 
303, in _get_i18n_domain
[Wed May 06 00:53:35.158073 2020] [wsgi:error] [pid 6973]   
pkg_resources.resource_filename('flask_security', 'translations'),
[Wed May 06 00:53:35.158089 2020] [wsgi:error] [pid 6973]  AttributeError: 
module 'pkg_resources' has no attribute 'resource_filename'


when I ran get_i18n_domain(app) fund in python console individually running 
fine, I wondered by it is throwing error while running app in web-browser. 

Is it a known issue or any solution to fix it?


pgAdmin4-4.21
Server version: Apache/2.4.6 (Red Hat Enterprise Linux)





Thanks,
Rj