Chainlit / chainlit

Build Conversational AI in minutes ⚡️
https://docs.chainlit.io
Apache License 2.0
7.04k stars 925 forks source link

Upgrading from 1.1 to 1.3 - App not reachable #1475

Closed rv59-njit closed 1 hour ago

rv59-njit commented 3 hours ago

Our chat app using chainlit is running perfectly fine with version 1.1. When I try to upgrade to 1.3, the app gets up and running according to log file, but the requests no longer reach the server and we not longer see any trace of the requests on the logs when I hit the url at http://localhost:3001. The same issue happens on our production servers as well.

I serve the application like this:

docker run -it --rm -p 3001:7000 --env-file .env transparent-bot-image

and I do see the app being served on the logs:

2024-10-23 22:18:51 - Your app is available at http://localhost:7000

P.S. inside docker file, we serve the chat app like this:

chainlit run bot.py --port 7000

The only change that causes this issue is upgrading from chainlit==1.1 to chainlit==1.3. No other change.

Please help! Thank you so much.

dosubot[bot] commented 3 hours ago

Hello @rv59-njit! I'm here to help you with any bugs, questions, or contributions you might have. Let's work together to solve the issue you're experiencing.

It seems like the issue might be related to the port configuration. In your setup, you're mapping port 3001 on your host to port 7000 in the Docker container. However, the logs indicate that the app is being served on port 7000 inside the container, which is correct.

To resolve this, ensure that you are accessing the app through the correct port on your host. Since you are mapping port 3001 to 7000, you should access the app at http://localhost:3001, not http://localhost:7000.

If you are already doing this and still facing issues, double-check your Docker and network settings to ensure there are no firewall or network policies blocking the connection. Additionally, verify that there are no changes in the default port configuration in Chainlit version 1.3 that might affect this setup, although I couldn't find specific information on port changes in the available data.

To continue talking to Dosu, mention @dosu.

rv59-njit commented 1 hour ago

Thanks for your quick response. I double checked the port mappings and there is no issue there. I ran the command with -d debug mode in both 1.1 and 1.3 versions and I do overserve some differences. The logs with 1.3 is much shorter. Does this hint at anything? I do not see any socket logs in the 1.3 version vs 1.1. Is that expected?

This is the startup log with 1.3

INFO:     Started server process [10]
INFO:     Waiting for application startup.
2024-10-24 00:07:13 - Your app is available at http://localhost:7000
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:7000 (Press CTRL+C to quit)

And here is the startup log with 1.1:

INFO:     Started server process [9]
INFO:     Waiting for application startup.
2024-10-24 00:08:24 - Your app is available at http://localhost:7000
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:7000 (Press CTRL+C to quit)
INFO:     192.168.65.1:58078 - "GET /ws/socket.io/?EIO=4&transport=polling&t=PAxscm2 HTTP/1.1" 200 OK
INFO:     192.168.65.1:58078 - "POST /ws/socket.io/?EIO=4&transport=polling&t=PAxscmi&sid=W8KsfxfkGvKorfOOAAAA HTTP/1.1" 200 OK
INFO:     ('192.168.65.1', 58079) - "WebSocket /ws/socket.io/?EIO=4&transport=websocket&sid=W8KsfxfkGvKorfOOAAAA" [accepted]
INFO:     192.168.65.1:58080 - "GET /ws/socket.io/?EIO=4&transport=polling&t=PAxscn5&sid=W8KsfxfkGvKorfOOAAAA HTTP/1.1" 200 OK
INFO:     192.168.65.1:58078 - "GET /ws/socket.io/?EIO=4&transport=polling&t=PAxscnF&sid=W8KsfxfkGvKorfOOAAAA HTTP/1.1" 200 OK
INFO:     192.168.65.1:58078 - "GET /ws/socket.io/?EIO=4&transport=polling&t=PAxsdNi HTTP/1.1" 200 OK
INFO:     192.168.65.1:58078 - "POST /ws/socket.io/?EIO=4&transport=polling&t=PAxsdOT&sid=lEIESmtJsFShReEEAAAC HTTP/1.1" 200 OK
INFO:     192.168.65.1:58080 - "GET /ws/socket.io/?EIO=4&transport=polling&t=PAxsdOV&sid=lEIESmtJsFShReEEAAAC HTTP/1.1" 200 OK
INFO:     ('192.168.65.1', 58081) - "WebSocket /ws/socket.io/?EIO=4&transport=websocket&sid=lEIESmtJsFShReEEAAAC" [accepted]
INFO:     192.168.65.1:58078 - "GET /ws/socket.io/?EIO=4&transport=polling&t=PAxsdOg&sid=lEIESmtJsFShReEEAAAC HTTP/1.1" 200 OK
INFO:     192.168.65.1:58078 - "POST /ws/socket.io/?EIO=4&transport=polling&t=PAxsdOh&sid=lEIESmtJsFShReEEAAAC HTTP/1.1" 200 OK
INFO:     192.168.65.1:58078 - "GET /ws/socket.io/?EIO=4&transport=polling&t=PAxsdPs&sid=lEIESmtJsFShReEEAAAC HTTP/1.1" 200 OK
INFO:     192.168.65.1:58078 - "GET /ws/socket.io/?E
rv59-njit commented 1 hour ago

It looks like in 1.1 this works:

chainlit run bot.py --port 7000

But in 1.3 this works:

chainlit run bot.py  --host 0.0.0.0 --port 7000

So, in 1.3 you have to specify --host 0.0.0.0 in order for it to work.