Re: Problem with pl/python procedure connecting to the internet

From: Dave Potts <dave(dot)potts(at)pinan(dot)co(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem with pl/python procedure connecting to the internet
Date: 2015-08-23 20:10:03
Message-ID: 55DA289B.2060405@pinan.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In cases like this I normally restart the progresql under strace/truss
etc and then wade through the output, it will normally tell me which
process was invoked.

On 23/08/15 18:49, Tom Lane wrote:
> Igor Sosa Mayor <joseleopoldo1792(at)gmail(dot)com> writes:
>> Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> writes:
>>> Or more to the point how where they built?
>> just installed with postgresql which comes with archlinux. I did not
>> built anything. But, really: I dont think the problem is plpython2u o 3:
>> 1. I have in my system both and both have the same libraries (in this
>> case, geopy);
>> 2. other procedures with plpython (2 or 3) which DO NOT CONNECT to the
>> internet work perfectly.
> Well, that hardly proves that Python code that *does* connect to the net
> would work. The possibility that you're using a different Python version
> inside Postgres and it's broken for network access is one you should take
> very seriously.
>
> However, what this smells like to me is a permissions problem. I think
> you were way too quick to dismiss the idea that SELinux (or something
> just like it) is restricting outbound internet connections from Postgres.
> It's standard for SELinux to be configured so that network-accessible
> daemons like Postgres are locked down harder than the very same code
> would be treated when being invoked from the command line --- and network
> access would be one of the prime candidates to be disabled by default.
>
> Have you poked around under /var/log/ to see if the kernel logs anything
> when the connection attempt doesn't work? For that matter, have you
> checked the postmaster log to see what Postgres logs about it?
>
> regards, tom lane
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igor Sosa Mayor 2015-08-23 20:15:30 Re: Problem with pl/python procedure connecting to the internet
Previous Message Pande, Nitin 2015-08-23 18:32:09 AIX 7.1 compile and initdb startup error TRAP: FailedAssertion