Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aniLS-0005iU-AC for pgadmin-hackers@arkaria.postgresql.org; Wed, 06 Apr 2016 07:57:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aniLR-0007Wo-NG for pgadmin-hackers@arkaria.postgresql.org; Wed, 06 Apr 2016 07:57:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aniLD-0007IA-HP for pgadmin-hackers@postgresql.org; Wed, 06 Apr 2016 07:57:31 +0000 Received: from mail-yw0-x235.google.com ([2607:f8b0:4002:c05::235]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1aniL8-00035T-VP for pgadmin-hackers@postgresql.org; Wed, 06 Apr 2016 07:57:31 +0000 Received: by mail-yw0-x235.google.com with SMTP id d68so46756246ywe.1 for ; Wed, 06 Apr 2016 00:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=X4sfBITasMG9KE59WQTH2TGIP3VV2bFyCmA4/lv/QQc=; b=0us3vHIdUzEdooWl+P4bNBrNt1/nGdH2UOhgV1q+ulo3CPpTC3qcqPJ71+/McK9cs3 SqYsljQghYTq9Zpn+MPn2HB+mz+jRpvKZtaGsJs5+XE8DW5J2n7gBf73wuM1cvyl+67t TQ5Rm0cdE2GLZfUtFPWel8Aaqb6uRvYYvb3UjtE5wUwFNL8teBgSAiK06BYenvjFjDfF p2nZ32p1FjvyZA4i/Zr/NPk4N4iT56W3I1IPnQrsSl3lpovxBLMf2As15e6vng3GOTL5 /pGkN3klA64aDWp1Qs9dzqV/6HaSpDVvOiUe8nzZY5lbu/XEsBiANKCdiNcqlARB5dqk RxGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=X4sfBITasMG9KE59WQTH2TGIP3VV2bFyCmA4/lv/QQc=; b=BpaiuMMLat48F6M+nsUghw2ccGU/iUxL54dzUqE75A9yJ99v+PwWfS2IytJM7X7IIj o6W6amKurahrhk+zLxpf572Uu5ypK7PadmK54805x8VG+miggB7VpKvKWxPCXEdOpBo9 +AbkURxxCNS2FwH8ZTTf2ISp5gKe4PM+JOEjYGBmB44ypw17rRyHNkUDi4F+xPVvTW/+ 8Wtc7xKAamYgm8oVWjgLxIXNXKITv7ji5Knu2o1f5B0wrNZkKjoah1wFNVI23KKpUACu yUg00y/6e5jabkTDuC5ltqwWFpPY+tcpBWSwKL//rfQlbl6SmUuC8Rb74++tvj9AGOf6 g30g== X-Gm-Message-State: AD7BkJKs94QgSydPhgQkb9OdXwe13hayOOaU6OvwEzo/MH84641NxP1ia1tKimfE3jQmrliPC9vISgbOeTqc2AAk MIME-Version: 1.0 X-Received: by 10.129.79.65 with SMTP id d62mr14714009ywb.194.1459929445096; Wed, 06 Apr 2016 00:57:25 -0700 (PDT) Received: by 10.37.218.76 with HTTP; Wed, 6 Apr 2016 00:57:24 -0700 (PDT) In-Reply-To: References: Date: Wed, 6 Apr 2016 13:27:24 +0530 Message-ID: Subject: Re: [pgAdmin4][Debugger]: Initial Patch From: Neel Patel To: Dave Page Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary=001a114da808f91017052fcc4f0b X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --001a114da808f91017052fcc4f0b Content-Type: text/plain; charset=UTF-8 Hi Dave, I got the root cause. Issue will reproduce when we applied Akshay's query tool patch. Issue was once the panel was initialized, HTML file was not getting loaded in to the panel due to the change in frame.js. Both query tool and debugger patch file contains the change in "frame.js" file. Once you applied the query tool patch and after that debugger then debugger patch should fail but i don't know why you do not get any error. *Solution:-* - Open "frame.js" file and add the below line in "setTimeout" function which is required by debugger. pgBrowser.Events.trigger('pgadmin-browser:frame:urlloaded:' + that.name, frame, that.url, self); Do let us know if you still face the same issue. Thanks, Neel Patel On Wed, Apr 6, 2016 at 12:07 PM, Neel Patel wrote: > Hi Dave, > > Updated above information. > We want this pgadmin4 log information to debug the debugger blank tab open > issue. > > Thanks, > Neel Patel > > On Wed, Apr 6, 2016 at 11:50 AM, Neel Patel > wrote: > >> One more additional information. >> >> Follow the below steps and send us pgAdmin4.log file. >> >> - Browse till function which we want to debug. Do not click on the >> "Debug" context menu. >> - Stop the server >> >> Stop the web server. > >> >> - Enable the "Debug" option in the config file under "web" folder. >> >> Set the Log setting to "Debug" and save the log to files and > send the updated debug log information. > >> >> - Start the server. >> >> Start the Web Server. > >> >> - Now click on the "Debug" context menu and add requirement input. >> After clicking on the debug button on the input dialog send us the >> pgAdmin4.log file. >> >> Thanks, >> Neel Patel >> >> On Wed, Apr 6, 2016 at 11:38 AM, Neel Patel >> wrote: >> >>> Hi Dave, >>> >>> We will fix the error "KeyError: 'session_id'" but regarding the blank >>> tab, we have tried with PostgreSQL 9.4 with both the version of python (2.7 >>> & 3.4) but we are not able to reproduce the issue. >>> >>> Below are some of the questions to debug the issue. >>> >>> - Is it only reproduce on PostgreSQL 9.4 ? Is it working on >>> PostgreSQL 9.5 ? >>> - Is it possible to know the debugger version ? >>> - The issue is reproduce on specific functions ? If yes, can you >>> please give definition of the function ? >>> - Are you able to see toolbar buttons ? Or nothing on the screen ? >>> Only blank panel ? >>> - Can you please share request/response of last request URL sent to >>> server in browser ? >>> >>> Thanks, >>> Neel Patel >>> >>> On Tue, Apr 5, 2016 at 9:59 PM, Dave Page wrote: >>> >>>> Hi >>>> >>>> On Tue, Apr 5, 2016 at 12:40 PM, Neel Patel < >>>> neel.patel@enterprisedb.com> wrote: >>>> > Hi, >>>> > >>>> > Please find attached debugger v1 patch. To test this patch we need to >>>> apply >>>> > the "function" module patch submitted by Khushboo. >>>> > >>>> > For the debugger functionality, direct and indirect debugging is >>>> working as >>>> > per pgadmin3 except below TODOs. >>>> > >>>> > Below are the TODOs which will be submitted in next patch along with >>>> the >>>> > fixed review comments. >>>> > >>>> > For the direct debugging, 'NULL' and 'Expression' column value should >>>> be >>>> > validated before pressing the debug button. >>>> > User can deposit the value of input arguments and local variable but >>>> need to >>>> > be >>>> > validated against respective data types. >>>> > Currently we have tested for plpgsql functions only, We need to test >>>> against >>>> > EDB SPL functions and trigger functions. >>>> > For the direct debugging, once the execution is completed, only >>>> > "Continue/Restart" button will be enabled and user should allow to >>>> restart >>>> > the debugging with same function and previous values. >>>> > Values entered by the user in input dialog during direct debugging >>>> should be >>>> > saved. >>>> > >>>> > >>>> > Currently we have tested this patch with PostgreSQL v9.5. >>>> > >>>> > Do review it and let us know for the comments. >>>> >>>> I just get a blank tab when I try to debug something. I do see the >>>> params dialogue, but then nothing. Note: >>>> >>>> - I have Akshay's Query Tool patch applied, and am running from git >>>> master >>>> >>>> - PostgreSQL 9.4, with the debugger plugin in the public schema. >>>> >>>> - Various functions in the pem schema tested, both with and without >>>> parameters. >>>> >>>> - Both direct and indirect debugging have the same issue. >>>> >>>> - No errors seen in the console, except when closing the debugger tab: >>>> >>>> 2016-04-05 17:27:37,720: INFO werkzeug: 127.0.0.1 - - [05/Apr/2016 >>>> 17:27:37] "GET /debugger/close/8569717 HTTP/1.1" 500 - >>>> Traceback (most recent call last): >>>> File >>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", >>>> line 1836, in __call__ >>>> return self.wsgi_app(environ, start_response) >>>> File >>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", >>>> line 1820, in wsgi_app >>>> response = self.make_response(self.handle_exception(e)) >>>> File >>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", >>>> line 1403, in handle_exception >>>> reraise(exc_type, exc_value, tb) >>>> File >>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", >>>> line 1817, in wsgi_app >>>> response = self.full_dispatch_request() >>>> File >>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", >>>> line 1477, in full_dispatch_request >>>> rv = self.handle_user_exception(e) >>>> File >>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", >>>> line 1381, in handle_user_exception >>>> reraise(exc_type, exc_value, tb) >>>> File >>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", >>>> line 1475, in full_dispatch_request >>>> rv = self.dispatch_request() >>>> File >>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py", >>>> line 1461, in dispatch_request >>>> return self.view_functions[rule.endpoint](**req.view_args) >>>> File >>>> "/Users/dpage/git/pgadmin4-demo/web/pgadmin/tools/debugger/__init__.py", >>>> line 397, in close >>>> session_id=obj['session_id']) >>>> KeyError: 'session_id' >>>> >>>> >>>> Thanks. >>>> >>>> -- >>>> Dave Page >>>> Blog: http://pgsnake.blogspot.com >>>> Twitter: @pgsnake >>>> >>>> EnterpriseDB UK: http://www.enterprisedb.com >>>> The Enterprise PostgreSQL Company >>>> >>> >>> >> > --001a114da808f91017052fcc4f0b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Dave,

I got the root cause. Issue wi= ll reproduce when we applied Akshay's query tool patch.
Issue= was once the panel was initialized, HTML file was not getting loaded in to= the panel due to the change in frame.js.

Both que= ry tool and debugger patch file contains the change in "frame.js"= file. Once you applied the query tool patch and after that debugger then d= ebugger patch should fail but i don't know why you do not get any error= .

Solution:-
  • Open "f= rame.js" =C2=A0file and add the below line in "setTimeout" f= unction which is required by debugger.
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pgBrowser.Events.trigger('pgad= min-browser:frame:urlloaded:' + that.name<= /a>, frame, that.url, self);



On Wed, Apr 6, 2016 at 12:07 PM, Neel Patel &l= t;neel.pat= el@enterprisedb.com> wrote:
Hi Dave,

Updated above information.
We want this pgadmin4 log information to debug the debugger blank t= ab open issue.

Thanks,
Neel Patel
<= div>

On Wed, Apr 6, 2016 at 11:50 AM, Neel Patel <neel.patel@en= terprisedb.com> wrote:
One more additional information.

Follow the= below steps and send us pgAdmin4.log file.
  • Browse till f= unction which we want to debug. Do not click on the "Debug" conte= xt menu.
  • Stop the server
<= div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Stop the web server.=C2=A0
  • Enable the "Debug" option in the config file under "we= b" folder.
  • =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Set the Log setting to "Debug"= and save the log to files and send the updated debug log information.
    • Start the ser= ver.
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0Start the Web Server.=C2=A0
    • Now click= on the "Debug" context menu and add requirement input. After cli= cking on the debug button on the input dialog send us the pgAdmin4.log file= .
    Thanks,
    Neel Patel

    On Wed, Apr 6, 2016 = at 11:38 AM, Neel Patel <neel.patel@enterprisedb.com> wrote:
    Hi Dave,
    =
    We will fix the error "KeyEr= ror: 'session_id'" but regarding the blank tab, we have= tried with PostgreSQL 9.4 with both the version of python (2.7 & 3.4) = but we are not able to reproduce the issue.

    =
    Below are some of the questions to debug the issue.
    • = Is it only reproduce on PostgreSQL 9.4 ? Is it working on PostgreSQL 9.5 ?<= /li>
    • Is it possible to know the debugger version ?
    • The issue is = reproduce on specific functions ? If yes, can you please give definition of= the function ?
    • Are you able to see toolbar buttons ? Or nothing on= the screen ? Only blank panel ?
    • Can you please share request/respo= nse of last request URL sent to server in browser ?
    Thanks,
    Neel Patel

    On Tue, Apr 5, 2016 at 9:59 PM, Dave Pa= ge <dpage@pgadmin.org> wrote:
    Hi

    On Tue, Apr 5, 2016 at 12:40 PM, Neel Patel <neel.patel@enterprisedb.com> w= rote:
    > Hi,
    >
    > Please find attached debugger v1 patch. To test this patch we need to = apply
    > the "function" module patch submitted by Khushboo.
    >
    > For the debugger functionality, direct and indirect debugging is worki= ng as
    > per pgadmin3 except below TODOs.
    >
    > Below are the TODOs which will be submitted in next patch along with t= he
    > fixed review comments.
    >
    > For the direct debugging, 'NULL' and 'Expression' colu= mn value should be
    > validated before pressing the debug button.
    > User can deposit the value of input arguments and local variable but n= eed to
    > be
    > validated against respective data types.
    > Currently we have tested for plpgsql functions only, We need to test a= gainst
    > EDB SPL functions and trigger functions.
    > For the direct debugging, once the execution is completed, only
    > "Continue/Restart" button will be enabled and user should al= low to restart
    > the debugging with same function and previous values.
    > Values entered by the user in input dialog during direct debugging sho= uld be
    > saved.
    >
    >
    > Currently we have tested this patch with PostgreSQL v9.5.
    >
    > Do review it and let us know for the comments.

    I just get a blank tab when I try to debug something. I do see the params dialogue, but then nothing. Note:

    - I have Akshay's Query Tool patch applied, and am running from git mas= ter

    - PostgreSQL 9.4, with the debugger plugin in the public schema.

    - Various functions in the pem schema tested, both with and without paramet= ers.

    - Both direct and indirect debugging have the same issue.

    - No errors seen in the console, except when closing the debugger tab:

    2016-04-05 17:27:37,720: INFO werkzeug: 127.0.0.1 - - [05/Apr/2016
    17:27:37] "GET /debugger/close/8569717 HTTP/1.1" 500 -
    Traceback (most recent call last):
    =C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-pac= kages/flask/app.py",
    line 1836, in __call__
    =C2=A0 =C2=A0 return self.wsgi_app(environ, start_response)
    =C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-pac= kages/flask/app.py",
    line 1820, in wsgi_app
    =C2=A0 =C2=A0 response =3D self.make_response(self.handle_exception(e))
    =C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-pac= kages/flask/app.py",
    line 1403, in handle_exception
    =C2=A0 =C2=A0 reraise(exc_type, exc_value, tb)
    =C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-pac= kages/flask/app.py",
    line 1817, in wsgi_app
    =C2=A0 =C2=A0 response =3D self.full_dispatch_request()
    =C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-pac= kages/flask/app.py",
    line 1477, in full_dispatch_request
    =C2=A0 =C2=A0 rv =3D self.handle_user_exception(e)
    =C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-pac= kages/flask/app.py",
    line 1381, in handle_user_exception
    =C2=A0 =C2=A0 reraise(exc_type, exc_value, tb)
    =C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-pac= kages/flask/app.py",
    line 1475, in full_dispatch_request
    =C2=A0 =C2=A0 rv =3D self.dispatch_request()
    =C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-pac= kages/flask/app.py",
    line 1461, in dispatch_request
    =C2=A0 =C2=A0 return self.view_functions[rule.endpoint](**req.view_args) =C2=A0 File "/Users/dpage/git/pgadmin4-demo/web/pgadmin/tools/debugger= /__init__.py",
    line 397, in close
    =C2=A0 =C2=A0 session_id=3Dobj['session_id'])
    KeyError: 'session_id'


    Thanks.

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

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




    --001a114da808f91017052fcc4f0b--