Re: dpage/pgadmin4 container failed in rancher/kubernetes , but works directly from dockerd

From: Dave Page <dpage(at)pgadmin(dot)org>
To: dmitry(dot)zhirkov(at)gmail(dot)com, "pgadmin-support lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: Re: dpage/pgadmin4 container failed in rancher/kubernetes , but works directly from dockerd
Date: 2019-07-17 08:06:46
Message-ID: CA+OCxow+t2KZCbh1ztfKp+n2UHezZmugZdLZNu6RWrDrU28ZgA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Hi

[Please keep replies on the mailing list]

The code where the error is happening (pgAdmin4.py, line 131 per your
report) looks like this:

port = os.environ['PGADMIN_PORT']
app.logger.debug(
'Not running under the desktop runtime, port: %s',
port
)
server_port = int(port)

It's setting the 'port' variable to the value of the PGADMIN_PORT
environment variable, and then trying to convert it to an integer and store
that in the server_port variable. That last line is where the error occurs,
and it's reporting that it cannot convert 'tcp://10.43.151.247:80'
(obviously a string) to an integer. The only possible way I can see this
happening is if *something* is setting the PGADMIN_PORT environment
variable to 'tcp://10.43.151.247:80'. pgAdmin never sets that variable in
the environment, so it must be coming from somewhere else. Perhaps Rancher
is setting that environment variable, based on the container name or
something?

On Tue, Jul 16, 2019 at 4:59 PM Dmitry Zhirkov <dmitry(dot)zhirkov(at)gmail(dot)com>
wrote:

> Hi Dave,
>
> here are my environment settings for the container :
> ...
> allowPrivilegeEscalation": false,
> "environment": {
>
> "PGADMIN_DEFAULT_EMAIL": "<my email>",
> "PGADMIN_DEFAULT_PASSWORD": "secret",
> "PGADMIN_LISTEN_PORT": "80"
>
> },
> ...
> and log is the same - please, see below. What is wrong ?
> ....
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *NOTE: Configuring authentication for SERVER mode.Traceback (most recent
> call last): File "run_pgadmin.py", line 4, in <module> from pgAdmin4
> import app File "/pgadmin4/pgAdmin4.py", line 131, in <module>
> server_port = int(port)ValueError: invalid literal for int() with base 10:
> 'tcp://10.43.151.247:80 <http://10.43.151.247:80>'postfix/postfix-script:
> starting the Postfix mail system[2019-07-16 15:56:29 +0000] [1] [INFO]
> Starting gunicorn 19.9.0[2019-07-16 15:56:29 +0000] [1] [INFO] Listening
> at: http://[::]:80 (1)[2019-07-16 15:56:29 +0000] [1] [INFO] Using worker:
> threads[2019-07-16 15:56:29 +0000] [80] [INFO] Booting worker with pid:
> 80[2019-07-16 15:56:37 +0000] [80] [ERROR] Exception in worker
> processTraceback (most recent call last): File
> "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in
> spawn_worker worker.init_process() File
> "/usr/local/lib/python3.7/site-packages/gunicorn/workers/gthread.py", line
> 104, in init_process super(ThreadWorker, self).init_process() File
> "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line
> 129, in init_process self.load_wsgi() File
> "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line
> 138, in load_wsgi self.wsgi = self.app.wsgi() File
> "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in
> wsgi self.callable = self.load() File
> "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52,
> in load return self.load_wsgiapp() File
> "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41,
> in load_wsgiapp return util.import_app(self.app_uri) File
> "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in
> import_app __import__(module) File "/pgadmin4/run_pgadmin.py", line 4,
> in <module> from pgAdmin4 import app File "/pgadmin4/pgAdmin4.py", line
> 131, in <modu*le>
>
>
>
>
> * server_port = int(port)ValueError: invalid literal for int() with
> base 10: 'tcp://10.43.151.247:80 <http://10.43.151.247:80>'[2019-07-16
> 15:56:37 +0000] [80] [INFO] Worker exiting (pid: 80)[2019-07-16 15:56:37
> +0000] [1] [INFO] Shutting down: Master[2019-07-16 15:56:37 +0000] [1]
> [INFO] Reason: Worker failed to boot.*
>
> пт, 12 июл. 2019 г. в 16:21, Dave Page <dpage(at)pgadmin(dot)org>:
>
>> Hi
>>
>> On Fri, Jul 12, 2019 at 2:11 PM Dmitry Zhirkov <dmitry(dot)zhirkov(at)gmail(dot)com>
>> wrote:
>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *Traceback (most recent call last): File "run_pgadmin.py", line 4, in
>>> <module> from pgAdmin4 import app File "/pgadmin4/pgAdmin4.py", line
>>> 131, in <module> server_port = int(port)ValueError: invalid literal for
>>> int() with base 10: 'tcp://10.43.151.247:80 <http://10.43.151.247:80>'*
>>>
>>
>> That would suggest that PGADMIN_PORT is set in the environment to 'tcp://
>> 10.43.151.247:80'. If you set that environment variable (and in a
>> containerised environment, I cannot think of a compelling reason to do so -
>> you should use PGADMIN_LISTEN_PORT), it must be set to a valid port number
>> only.
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
> --
> С уважением,
> Дмитрий Жирков
>

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

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

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Dmitry Zhirkov 2019-07-17 08:49:13 Re: dpage/pgadmin4 container failed in rancher/kubernetes , but works directly from dockerd
Previous Message Dave Page 2019-07-12 13:21:22 Re: dpage/pgadmin4 container failed in rancher/kubernetes , but works directly from dockerd