Mintplex-Labs / anything-llm

The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, and more.
https://anythingllm.com
MIT License
27.33k stars 2.74k forks source link

[BUG]: MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. #1237

Closed ovizii closed 6 months ago

ovizii commented 6 months ago

How are you running AnythingLLM?

Docker (local)

What happened?

I tried using the agent as described below and got these errors in the docker logs:

 [36m[AgentHandler][0m Attached rag-memory plugin to Agent cluster                                                                                       │
│   [36m[AgentHandler][0m Attached document-summarizer plugin to Agent cluster                                                                              │
│   [36m[AgentHandler][0m Attached web-scraping plugin to Agent cluster                                                                                     │
│   [36m[AgentHandler][0m Attached save-file-to-browser plugin to Agent cluster                                                                             │
│   [36m[AgentHandler][0m Attached web-browsing plugin to Agent cluster                                                                                     │
│   [36m[AgentHandler][0m Attached create-chart plugin to Agent cluster                                                                                     │
│   -- Working URL https://www.accuweather.com/en/ro/sibiu/287746/july-weather/287746 --                                                                    │
│   getPageContent failed to be fetched by puppeteer - falling back to fetch! Error: net::ERR_HTTP2_PROTOCOL_ERROR at https://www.accuweather.com/en/ro/s   │
│   ibiu/287746/july-weather/287746                                                                                                                         │
│       at navigate (file:///app/collector/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js:173:27)                                               │
│       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)                                                                       │
│       at async Deferred.race (file:///app/collector/node_modules/puppeteer-core/lib/esm/puppeteer/util/Deferred.js:80:20)                                 │
│       at async CdpFrame.goto (file:///app/collector/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js:139:25)                                    │
│       at async CdpPage.goto (file:///app/collector/node_modules/puppeteer-core/lib/esm/puppeteer/api/Page.js:568:20)                                      │
│       at async PuppeteerWebBaseLoader._scrape (/app/collector/node_modules/langchain/dist/document_loaders/web/puppeteer.cjs:49:9)                        │
│       at async PuppeteerWebBaseLoader.load (/app/collector/node_modules/langchain/dist/document_loaders/web/puppeteer.cjs:74:22)                          │
│       at async getPageContent (/app/collector/processLink/convert/generic.js:71:18)                                                                       │
│       at async scrapeGenericUrl (/app/collector/processLink/convert/generic.js:11:19)                                                                     │
│       at async getLinkText (/app/collector/processLink/index.js:11:10)                                                                                    │
│   (node:103) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. Use events.setMaxListen   │
│   ers() to increase limit                                                                                                                                 │
│   (Use `node --trace-warnings ...` to show where the warning was created)                                                                                 │
│   -- Working URL https://www.accuweather.com/en/ro/sibiu/287501/daily-weather-forecast/287501 --                                                          │
│   getPageContent failed to be fetched by puppeteer - falling back to fetch! Error: net::ERR_HTTP2_PROTOCOL_ERROR at https://www.accuweather.com/en/ro/s   │
│   ibiu/287501/daily-weather-forecast/287501                                                                                                               │
│       at navigate (file:///app/collector/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js:173:27)                                               │
│       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)                                                                       │
│       at async Deferred.race (file:///app/collector/node_modules/puppeteer-core/lib/esm/puppeteer/util/Deferred.js:80:20)                                 │
│       at async CdpFrame.goto (file:///app/collector/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js:139:25)                                    │
│       at async CdpPage.goto (file:///app/collector/node_modules/puppeteer-core/lib/esm/puppeteer/api/Page.js:568:20)                                      │
│       at async PuppeteerWebBaseLoader._scrape (/app/collector/node_modules/langchain/dist/document_loaders/web/puppeteer.cjs:49:9)                        │
│       at async PuppeteerWebBaseLoader.load (/app/collector/node_modules/langchain/dist/document_loaders/web/puppeteer.cjs:74:22)                          │
│       at async getPageContent (/app/collector/processLink/convert/generic.js:71:18)                                                                       │
│       at async scrapeGenericUrl (/app/collector/processLink/convert/generic.js:11:19)                                                                     │
│       at async getLinkText (/app/collector/processLink/index.js:11:10)                                                        

Are there known steps to reproduce?

question:

I’d like to get a general overview of the predicted weather in Sibiu, Romania between 15th of July and 15th of September.

reply:

I can’t provide future weather predictions as the weather forecast changes regularly. However, you can check the weather forecast for Sibiu, Romania, between the 15th of July and 15th of September by visiting a reliable weather website or using a weather app like AccuWeather, The Weather Channel, or Meteored. These resources typically offer detailed forecasts, including temperature ranges, precipitation chances, and general weather conditions for the specified dates and location.

question:

Please search and scrape the results to present your answer to my question.

reply:

@agent: Scraping the content of https://www.accuweather.com/en/ro/sibiu/287746/july-weather/287746 @agent: This page's content is way too long. I will summarize it right now.

question after nothing happened:

I am waiting for your reply.

reply:

@agent: Scraping the content of https://www.accuweather.com/en/ro/sibiu/287501/daily-weather-forecast/287501 @agent: This page's content is way too long. I will summarize it right now.

reply:

After scraping the website, I found detailed information related to the daily weather forecast for Olesesti, Buzău, Romania, on the AccuWeather website. The website contains metadata, structured data, and scripts that provide various functionalities and configurations. Here is a summary of the key findings:

Metadata and Structured Data:

The website includes metadata such as title, description, canonical URL, and social media tags for Facebook and Twitter. Structured data in JSON-LD format defines organization, place, and website information for search engines. Weather Forecast Details:

The website displays the daily weather forecast for Olesesti, Buzău, Romania, with information on weather conditions, temperature, and possible alerts. Advertising Configuration:

The website has configurations for server ads, including sizes, bids, ad units, and placements for different ad types. JavaScript functions manage and display ads on the web page, including ad bidding, targeting, and lazy loading. User Location and Weather:

JavaScript variables handle user location data, weather events, and user consent for advertisements. Forecast Graphs and Controls:

HTML and SVG code create temperature graphs with axes, chart areas, and controls for weather visualization. Website Structure:

The footer section includes links to social media, legal information, privacy policy banners, and script references for user accessibility. This detailed analysis provides insights into the website’s functionality, advertising strategies, and weather forecasting features for Olesesti, Buzău, Romania. You can visit the AccuWeather website for real-time weather updates and accurate forecasts for the specified location.

timothycarambat commented 6 months ago

This is known and is temporary and does not impact the summary results. its a result of the Langchain summarization process from attaching too many listeners while summarization so we can .abort() them from a signal controller. There is unfortunately no way for us to reduce the amount of concurrent runners to block this error from occurring at this time.

if there is an option in the LC summarization tool, id like to implement it. I thought it was a crash too

ovizii commented 6 months ago

Thanks for having a look. My intention was simply to report it as a search did not yield any results here.

timothycarambat commented 6 months ago

@ovizii Of course, and I appreciate you doing so!