Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open SSL Issue with Python 3.9 container #2281

Closed
parikshitmukherjee11 opened this issue Mar 1, 2024 · 6 comments
Closed

Open SSL Issue with Python 3.9 container #2281

parikshitmukherjee11 opened this issue Mar 1, 2024 · 6 comments
Assignees
Labels
connection issue in-review In review pending close Closed soon without new activity

Comments

@parikshitmukherjee11
Copy link

parikshitmukherjee11 commented Mar 1, 2024

My app works fine on Mac OS , but in python 3.9 image I get open SSL error:

6919ms SPX_TRACE_ERROR: AZ_LOG_ERROR: tlsio_openssl.c:691 error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
[473490]: 6919ms SPX_TRACE_ERROR: AZ_LOG_ERROR: tlsio_openssl.c:2464 FORCE-Closing tlsio instance.
[473490]: 6919ms SPX_TRACE_SCOPE_ENTER: uws_web_socket.cpp:247 OnWebSocketOpened
[473490]: 6919ms SPX_TRACE_ERROR: web_socket.cpp:907 WS open operation failed with result=1(WS_OPEN_ERROR_UNDERLYING_IO_OPEN_FAILED), code=2573[0x00000a0d], time=2024-03-01T13:27:48.9143037Z
[473490]: 6919ms SPX_TRACE_INFO: usp_connection.cpp:933 TS:533, TransportError: connection:0x8c01b800, code=5, string=Connection failed (no connection to the remote host). Internal error: 1. Error details: Failed with error: WS_OPEN_ERROR_UNDERLYING_IO_OPEN_FAILED
wss://westeurope.stt.speech.microsoft.com/speech/universal/v2
X-ConnectionId: ca429b9e33bd4f06b922f25d9b435d47
[473490]: 6919ms SPX_TRACE_ERROR: usp_reco_engine_adapter.cpp:2008 Response: On Error: Code:5, Message: Connection failed (no connection to the remote host). Internal error: 1. Error details: Failed with error: WS_OPEN_ERROR_UNDERLYING_IO_OPEN_FAILED
wss://westeurope.stt.speech.microsoft.com/speech/universal/v2
X-ConnectionId: ca429b9e33bd4f06b922f25d9b435d47.
[473490]: 6919ms SPX_DBG_TRACE_VERBOSE: usp_reco_engine_adapter.cpp:3022 TryChangeState; audioState/uspState: 1/0 => 1/-1 USP-ERRORERROR
[473490]: 6919ms SPX_TRACE_ERROR: usp_reco_engine_adapter.cpp:2022 OnError: site->Error() ... error='Connection failed (no connection to the remote host). Internal error: 1. Error details: Failed with error: WS_OPEN_ERROR_UNDERLYING_IO_OPEN_FAILED
wss://westeurope.stt.speech.microsoft.com/speech/universal/v2
X-ConnectionId: ca429b9e33bd4f06b922f25d9b435d47'
[473490]: 6919ms SPX_DBG_TRACE_VERBOSE: usp_reco_engine_adapter_retry.cpp:153 ShouldReconnect: Should Reconnect: 1
[473490]: 7170ms SPX_DBG_TRACE_VERBOSE: usp_reco_engine_adapter_retry.cpp:127 CleanupAdapterAndAudio: Trying to reset the engine adapter
[473490]: 7170ms SPX_DBG_TRACE_VERBOSE: create_object_helpers.h:78 SpxTerm: ptr=0x0xffff8c01a748
[473490]: 7170ms SPX_DBG_TRACE_SCOPE_ENTER: usp_reco_engine_adapter.cpp:97 Terminating CSpxUspRecoEngineAdapter...
[473490]: 7170ms SPX_DBG_TRACE_VERBOSE: usp_reco_engine_adapter.cpp:98 Term: this=0x0xffff8c01a700
[473490]: 7170ms SPX_DBG_TRACE_VERBOSE: usp_reco_engine_adapter.cpp:3022 TryChangeState; audioState/uspState: 1/-1 => 1/9998 USP-TERMINATING
[473490]: 7170ms SPX_DBG_TRACE_VERBOSE: usp_reco_engine_adapter.cpp:102 Term: Terminating USP Connection (0x0xffff8c01b838)
[473490]: 7170ms SPX_DBG_TRACE_VERBOSE: create_object_helpers.h:78 SpxTerm: ptr=0x0xffff8c001eb8
[473490]: 7170ms SPX_DBG_TRACE_VERBOSE: usp_reco_engine_adapter.cpp:3022 TryChangeState; audioState/uspState: 1/9998 => 1/9999 USP-ZOMBIE
[473490]: 7170ms SPX_DBG_TRACE_SCOPE_EXIT: usp_reco_engine_adapter.cpp:97 Terminating CSpxUspRecoEngineAdapter... Done!

DOCKER FILE:

FROM python:3.9

Set the working directory to /app

WORKDIR /app

Copy the current directory contents into the container at /app

COPY . .

ENV PYTHONFAULTHANDLER=1
PYTHONUNBUFFERED=1
PIP_NO_CACHE_DIR=off

#RUN apt update && apt install -y build-essential gcc ffmpeg libsm6 libxext6 wget nano unzip gdebi -y \

&& pip install --upgrade pip \

&& pip install -r requirements.txt

RUN pip install -r requirements.txt

RUN pip install openssl==1.1.1

RUN apt-get clean && rm -rf /var/lib/apt/lists/*

set display port to avoid crash

ENV DISPLAY=:99

Create a uwsgi log directory and files

RUN mkdir /var/log/uwsgi
RUN touch /var/log/uwsgi/uwsgi_access.log
RUN touch /var/log/uwsgi/uwsgi_error.log

Expose the port your FastAPI application runs on

EXPOSE 80

Command to run the FastAPI application

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]

@jhakulin
Copy link

jhakulin commented Mar 1, 2024

@parikshitmukherjee11 What is the Linux version in use in the container?

@parikshitmukherjee11
Copy link
Author

@jhakulin Its Debian 12.5 Bookworm

@pankopon
Copy link
Contributor

pankopon commented Mar 7, 2024

@parikshitmukherjee11 With Debian 12 you will need to install libssl 1.x in the container either from an old package (see Ubuntu example) or (recommended) latest sources. Yes, you need to install native system libraries, not just pip.

@lumpidu
Copy link

lumpidu commented Mar 7, 2024

OpenSSL 1.1.1 was released on 11th September 2018, and though being an LTS release, is now considered EOL since 11th September 2023. Azure-Team: please upgrade your dependencies.

@pankopon
Copy link
Contributor

pankopon commented Mar 7, 2024

Closed as answered. OpenSSL upgrade status is followed up in #2048

@pankopon pankopon closed this as completed Mar 7, 2024
@waveBoom
Copy link

python temporary solution : #2204 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connection issue in-review In review pending close Closed soon without new activity
Projects
None yet
Development

No branches or pull requests

5 participants