agentic
agentic copied to clipboard
Regression: ExaClient (@agentic/exa >= 7.6.3) Causes Timeouts in Docker Environment (Node 18 Alpine / DigitalOcean)
Hi Team,
I've encountered a regression issue with @agentic/exa (and potentially related @agentic/* packages) starting from version ^7.6.3. Calls using ExaClient consistently time out when the application is deployed within a specific Docker environment, whereas they worked perfectly fine with version 7.3.3.
Bug Description:
When using a tool that utilizes ExaClient.search() and potentially ExaClient.getContents() (like a web search tool), the operation times out after upgrading @agentic/exa and related @agentic/* packages from version 7.3.3 to ^7.6.3.
- Working Scenario: With all
@agentic/*packages at version7.3.3, the tool executes successfully within the Docker container deployed on DigitalOcean. - Failing Scenario: After upgrading the
@agentic/*packages to^7.6.3(or the latest resolved version), the exact same tool code deployed in the exact same environment consistently results in a timeout during theExaClientoperation. - The tool works correctly with the newer versions (
^7.6.3) when deployed locally or on Vercel. The issue seems specific to the Docker/DigitalOcean environment combination after the library upgrade.
Environment:
@agentic/exaFailing Version:^7.6.3(and related@agentic/*packages)@agentic/exaWorking Version:7.3.3(and related@agentic/*packages)- Node.js Version:
18(specificallynode:18-alpineDocker base image) - Deployment Environment: Docker container running on DigitalOcean Droplet (1vCPU / 1GB RAM)
- Operating System (Host): Ubuntu (assumed, typical for DO)
- Reverse Proxy: Nginx (Configuration reviewed, seems unlikely to be the cause)
Steps to Reproduce:
- Create a Next.js application using
@agentic/[email protected]. Include a tool that makes calls toExaClient.search()and/orExaClient.getContents(). - Build a Docker image using
node:18-alpineas the base. - Deploy the container to a DigitalOcean Droplet (or similar resource-constrained Linux environment). Ensure the
EXA_API_KEYenvironment variable is correctly passed to the container. - Trigger the tool -> Expected: It should work.
- Update
@agentic/*packages inpackage.jsonto^7.6.3. - Rebuild the Docker image and redeploy to the same environment.
- Trigger the tool -> Actual: The
ExaClientoperation times out.
Troubleshooting Steps Taken:
- Confirmed network connectivity from within the Docker container to
api.exa.aiusingnode -e "fetch(...)". Directfetchcalls (using the correctx-api-keyheader andEXA_API_KEYenv var) succeed with a 200 status code, even within the failing container. - Verified DNS resolution within the container works for
api.exa.ai. - Confirmed the
EXA_API_KEYenvironment variable is correctly set and accessible within the container usingprocess.env. - Reviewed Nginx configuration; it doesn't seem related as it handles inbound traffic.
- Reviewed DigitalOcean firewall rules; outbound TCP traffic on all ports is allowed.
- Implemented explicit timeouts (
Promise.racewithsetTimeout) around theExaClientcalls, which confirmed the operation is indeed hanging until the timeout triggers. - Isolated the issue specifically to the upgrade of the
@agentic/*packages by checking out a previous commit where version7.3.3was used (which worked correctly in the same Docker environment).
Expected Behavior:
The ExaClient operations (search, getContents) should complete successfully within the Docker environment using version ^7.6.3, just as they did with 7.3.3 and as they do in other deployment environments (local/Vercel).
Actual Behavior:
The ExaClient operations hang indefinitely until an implemented application-level timeout is reached when using version ^7.6.3 in the specified Docker environment.
Possible Cause:
It seems likely that a change introduced between 7.3.3 and ^7.6.3 in @agentic/exa or its dependencies interacts negatively with the specific Docker (node:18-alpine) or networking environment on DigitalOcean, despite basic network connectivity being functional (as proven by direct fetch tests). This could relate to internal handling of HTTP requests, connection pooling, timeouts, TLS, or dependencies within the library.
Workaround:
Pinning @agentic/* packages to version 7.3.3 resolves the issue for now.
Hi @steveoon thank you for expressing this issue and with such thorough detail ❤️ I'll be helping this project out, but just getting ramped up. Here just leaving a comment that I hear you and will return shortly to address this issue fully 🙏