erajasekar
erajasekar
Explore posts from servers
RRailway
Created by erajasekar on 9/21/2024 in #✋|help
Getting CancelledError Python FastAPI application using openai chat completion
I have Python FastAPI application that uses openai's chat completion api with stream. I am getting CancelledError very frequently. I also added timeout middleware with 2 mins timeout and is still same error. The same prompts works fine on my local machine. It's happening only in Railway. I guess may have to tweak some timeout out setting in Railway. I will provide full stack trace below. Please let me know how to resolve it.
CancelledError('Cancelled by cancel scope 7fa0af45f910')Traceback (most recent call last):\n\n\n File \"/usr/local/lib/python3.10/site-packages/langchain_core/language_models/chat_models.py\", line 472, in astream\n async for chunk in self._astream(\n\n\n File \"/usr/local/lib/python3.10/site-packages/langchain_openai/chat_models/base.py\", line 1989, in astream\n async for chunk in super().astream(*args, **kwargs):\n\n\n File \"/usr/local/lib/python3.10/site-packages/langchain_openai/chat_models/base.py\", line 779, in astream\n async for chunk in response:\n\n\n File \"/usr/local/lib/python3.10/site-packages/openai/streaming.py\", line 147, in aiter\n async for item in self._iterator:\n\n\n File \"/usr/local/lib/python3.10/site-packages/openai/_streaming.py\", line 160, in stream\n async for sse in iterator:\n\n\n File \"/usr/local/lib/python3.10/site-packages/openai/_streaming.py\", line 151, in iterevents\n async for sse in self._decoder.aiter_bytes(self.response.aiter_bytes()):\n\n\n File \"/usr/local/lib/python3.10/site-packages/openai/_streaming.py
CancelledError('Cancelled by cancel scope 7fa0af45f910')Traceback (most recent call last):\n\n\n File \"/usr/local/lib/python3.10/site-packages/langchain_core/language_models/chat_models.py\", line 472, in astream\n async for chunk in self._astream(\n\n\n File \"/usr/local/lib/python3.10/site-packages/langchain_openai/chat_models/base.py\", line 1989, in astream\n async for chunk in super().astream(*args, **kwargs):\n\n\n File \"/usr/local/lib/python3.10/site-packages/langchain_openai/chat_models/base.py\", line 779, in astream\n async for chunk in response:\n\n\n File \"/usr/local/lib/python3.10/site-packages/openai/streaming.py\", line 147, in aiter\n async for item in self._iterator:\n\n\n File \"/usr/local/lib/python3.10/site-packages/openai/_streaming.py\", line 160, in stream\n async for sse in iterator:\n\n\n File \"/usr/local/lib/python3.10/site-packages/openai/_streaming.py\", line 151, in iterevents\n async for sse in self._decoder.aiter_bytes(self.response.aiter_bytes()):\n\n\n File \"/usr/local/lib/python3.10/site-packages/openai/_streaming.py
38 replies
NNuxt
Created by erajasekar on 4/22/2024 in #❓・help
The nuxt build is failing on my vercel recently with error [unhandled] [500] Element is not defined
[success] Server built in 5250ms
[info] [nitro] Initializing prerenderer
[info] [nitro] Prerendering 8 initial routes with crawler
[error] [nuxt] [request error] [unhandled] [500] Element is not defined
at ./.nuxt/prerender/chunks/build/server.mjs:1964:30
at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
at async ./.nuxt/prerender/chunks/_/renderer.mjs:141:24

This is using nuxt version 3.11.2.

The build was working fine few months ago on nuxt version 3.4.3 .
[success] Server built in 5250ms
[info] [nitro] Initializing prerenderer
[info] [nitro] Prerendering 8 initial routes with crawler
[error] [nuxt] [request error] [unhandled] [500] Element is not defined
at ./.nuxt/prerender/chunks/build/server.mjs:1964:30
at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
at async ./.nuxt/prerender/chunks/_/renderer.mjs:141:24

This is using nuxt version 3.11.2.

The build was working fine few months ago on nuxt version 3.4.3 .
Looks like some recent change on latest version is causing this error. I would appreciate any pointers on resolving this error. Thank you!
1 replies
RRailway
Created by erajasekar on 4/6/2023 in #✋|help
Using JSON File as Environment variable in Railway for Firebase
Railway only allows defining environment variables with values inline. But to authenticate with firebase, I need to use a json file like firebase-service-account.json and provide path to this file as value of env variable GOOGLE_APPLICATION_CREDENTIALS . How do I do this in build setup?
37 replies