Closed asheesh89 closed 2 years ago
@tfoldi could you please help here.
This is a current challenge with docker containers and remote TabPy, functions have to be deployed locally and it has to be able to change local files. This is an issue we're considering working on for the future.
I am deploying the functions locally. Everything works fine if tabpy server is not secure. As soon as i secure the server using basic authentication, deployment starts failing with this error.
Are you using the most current version of TabPy and following the instructions for deploying functions with auth: https://github.com/tableau/TabPy/blob/master/docs/tabpy-tools.md#authentication
I am using tabpy 2.5.0. I followed same documentation for authentication. It is working in local setup but not working when deploying AKS using dockerfile.
Is this still an issue @asheesh89 ?
It is resolved and can be closed now. Thank you.
@asheesh89 just for documentation purposes, what was the fix or change?
Error was connection refused. Issue was in the docker file. I was using separate RUN commands. So in my case i was doing something like this- RUN su -c "tabpy" RUN su -c "python3 mycustomfun.py && killall tabpy"
Here first RUN command starts the tabpy server and now when second RUN command is run to deploy the function, tabpy server will obviously be unreachable. To resolve this issue, I merged both these RUN commands using && operator.
Thanks, closing the issue!
Environment information:
Describe the issue **I am deploying a custom function in tabpy which is enabled by basic authentication. I am doing everything using Dockerfile where python3, related packages and tabpy are insalled. It gives Connection Refused error while deploying the function in secured tabpy. Credentials are correct. Even if those are incorrect, 401 error should come instead of connection refused. However, function gets deployed successfully if tabpy is not secured.
mycustomfun.py looks like as below- -------mycustomfun.py-----
Portion from Dockerfile as below- -------Dockerfile-------
Everything works fine if tabpy is not secured and we do not use "client.set_credentials". but it gives following error when it goes to deploy the "sum" function on secured tabpy server. I checked the credentials also, thse are correct. Even if those are incorrect, it should give 401 error as per documentation but it is giving connection refused. [91mTraceback (most recent call last): 2022-03-04T06:34:42.4887870Z File "/usr/lib/python3.8/site-packages/urllib3/connection.py", line 174, in _new_conn 2022-03-04T06:34:42.4888321Z conn = connection.create_connection( 2022-03-04T06:34:42.4889000Z File "/usr/lib/python3.8/site-packages/urllib3/util/connection.py", line 95, in create_connection 2022-03-04T06:34:42.4889403Z raise err 2022-03-04T06:34:42.4889999Z File "/usr/lib/python3.8/site-packages/urllib3/util/connection.py", line 85, in create_connection 2022-03-04T06:34:42.4890420Z sock.connect(sa) 2022-03-04T06:34:42.4890775Z ConnectionRefusedError: [Errno 111] Connection refused .... ... ..... File "/usr/lib/python3.8/site-packages/urllib3/connection.py", line 186, in _new_conn 2022-03-04T06:34:42.4901488Z raise NewConnectionError( 2022-03-04T06:34:42.4902048Z urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fbb91402100>: Failed to establish a new connection: [Errno 111] Connection refused 2022-03-04T06:34:42.4908495Z 2022-03-04T06:34:42.4908930Z During handling of the above exception, another exception occurred: 2022-03-04T06:34:42.4909134Z 2022-03-04T06:34:42.4909420Z Traceback (most recent call last): 2022-03-04T06:34:42.4910215Z File "/usr/lib/python3.8/site-packages/requests/adapters.py", line 440, in send 2022-03-04T06:34:42.4910618Z resp = conn.urlopen( 2022-03-04T06:34:42.4911433Z File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 785, in urlopen 2022-03-04T06:34:42.4911858Z retries = retries.increment( 2022-03-04T06:34:42.4912449Z File "/usr/lib/python3.8/site-packages/urllib3/util/retry.py", line 592, in increment 2022-03-04T06:34:42.4912933Z raise MaxRetryError(_pool, url, error or ResponseError(cause)) 2022-03-04T06:34:42.4914115Z urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=9004): Max retries exceeded with url: /endpoints (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fbb91402100>: Failed to establish a new connection: [Errno 111] Connection refused'))