Re: import upload file to pgadmin get CSRF error

From: Murtuza Zabuawala <murtuza(dot)zabuawala(at)enterprisedb(dot)com>
To: Where is Where <whisere(at)gmail(dot)com>
Cc: Khushboo Vashi <khushboo(dot)vashi(at)enterprisedb(dot)com>, "pgadmin-support lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: Re: import upload file to pgadmin get CSRF error
Date: 2019-06-28 03:55:28
Message-ID: CAKKotZSz5RT7WiM85r3=8f6dUx76YFkYNK10Uvn2xTXOtV-p7A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On Fri, Jun 28, 2019 at 6:31 AM Where is Where <whisere(at)gmail(dot)com> wrote:

> Is there a way to apply this bug fix on a installation on redhat?The 4.9
> redhat yum package is not available yet. Thanks!
>

No, Release version of JS files are bundled by webpacker, so it is not
feasible to patch them.
You have to wait until the yum repo gets the updated version.

-- Murtuza

>
> On Tue, Jun 25, 2019 at 9:30 AM Where is Where <whisere(at)gmail(dot)com> wrote:
>
>> Thank you! I will wait for the release on Thursday. Will the redhat yum
>> package be updated too? Or can I download the tar file and use some file
>> from it to replace the file on the server?
>>
>> Thanks.
>>
>> On Mon, Jun 24, 2019 at 4:25 PM Khushboo Vashi <
>> khushboo(dot)vashi(at)enterprisedb(dot)com> wrote:
>>
>>>
>>>
>>> On Mon, Jun 24, 2019 at 11:42 AM Where is Where <whisere(at)gmail(dot)com>
>>> wrote:
>>>
>>>> Thank you! I just saw that too. I tried to apply that diff only:
>>>> https://redmine.postgresql.org/projects/pgadmin4/repository/revisions/08b78fb6a11283731cdf59d2a29fdc75e459582e/diff/web/pgadmin/misc/file_manager/static/js/utility.js
>>>> But it doesn't seem to fix the problem.
>>>>
>>>> It will require bundling of the static files after applying the patch.
>>> Instead, you can install the pgAdmin from the nightly builds having the
>>> latest code.
>>> https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2019-06-24/
>>>
>>> * // We need to append our csrf token with dropzone's ajax request header
>>>> *
>>>>
>>>> * let csrfToken = {};
>>>> *
>>>>
>>>> * csrfToken[pgAdmin.csrf_token_header] = pgAdmin.csrf_token;
>>>> *
>>>>
>>>>
>>>> $('div#multiple-uploads').dropzone({
>>>>
>>>> paramName: 'newfile',
>>>>
>>>> url: pgAdmin.FileUtils.fileConnector,
>>>>
>>>> *headers: csrfToken,*
>>>>
>>>>
>>>> Thanks, Junran
>>>>
>>>> On Mon, Jun 24, 2019 at 3:47 PM Khushboo Vashi <
>>>> khushboo(dot)vashi(at)enterprisedb(dot)com> wrote:
>>>>
>>>>>
>>>>> On Mon, Jun 24, 2019 at 11:13 AM Where is Where <whisere(at)gmail(dot)com>
>>>>> wrote:
>>>>>
>>>>>> Hello, we are trying to import csv file to database from pgadmin, but
>>>>>> when uploading file it reports '
>>>>>> 400 Bad Request <h1>Bad Request</h1> <p>The CSRF token is
>>>>>> missing.</p> '
>>>>>> I looked at config.py but can't find any related setting.
>>>>>> Any idea is much appreciated.
>>>>>>
>>>>>> This issue has already been reported and fixed. (Ref:
>>>>> https://redmine.postgresql.org/issues/4350)
>>>>> You will get the fix in the upcoming release which is scheduled on
>>>>> coming Thursday.
>>>>>
>>>>> Thanks,
>>>>> Khushboo
>>>>>
>>>>

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Fernando Hevia 2019-06-28 04:12:39 Re: pgAdmin 4 v4.9 released
Previous Message Where is Where 2019-06-28 01:01:16 Re: import upload file to pgadmin get CSRF error