AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

ResourceWarning: unclosed <ssl.SSLSocket

Open emilrueh opened this issue 2 years ago • 5 comments
trafficstars

⚠️ Search for existing issues first ⚠️

  • [X] I have searched the existing issues, and there is no existing issue for my problem

GPT-3 or GPT-4

  • [X] I am using Auto-GPT with GPT-3 (GPT-3.5)

Steps to reproduce 🕹

After successfully setting up weaviate with autogpt I keep on getting the error:

Current behavior 😯

ResourceWarning: unclosed <ssl.SSLSocket fd=1252, family=2, type=1, proto=0, laddr=('IPA.DRE.S.SX', IPIPI), raddr=('IPA.DR.E.SSX', 443)>

Expected behavior 🤔

The error should probably not show.

Wondering whether this can be prevented as it seems rather unsafe.

Your prompt 📝

ai_goals:
- research the most profitable and sucessful trading strategies and learn how to optimize
  them to maximize profitability when used as pine scipts algorithm
- write a pine script version 5 algorithm implementing everything that was learned
  from researching strategies
- backtest and evaluate the algorithm and the trading strategy to make sure it performs
  well and generates high returns in the future
- optimize the algorithm from what was learned during the testing phase
- save the algorithm to a file called auto_trading_v1.pine and let me know once the
  task is completed and shut down
ai_name: Helper
ai_role: an AI designed to write a highly profitable trading bot that works for crypto
  and stocks

emilrueh avatar Apr 18 '23 15:04 emilrueh

Generally, an error like that isn't terrible but bad for the longevity of the running program.

What were the full logs? Are you running a proxy?

ntindle avatar Apr 20 '23 07:04 ntindle

As an amateur an error like this just looks like a leak so possibly not important. I am neither a ware whether I am running a proxy nor was there more log than this.

emilrueh avatar Apr 20 '23 11:04 emilrueh

@ntindle in fact after going for pinecone instead I am getting the same issue where I can now provide you with a full log but also encountered another issue that I do not understand even though I followed the easy autogpt documentation for setting up pinecone:

C:\Users\emilr\Documents\AutoGPT\auto-gpt\venv\Lib\site-packages\pinecone\core\client\rest.py:45: DeprecationWarning: HTTPResponse.getheader() is deprecated and will be removed in urllib3 v2.1.0. Instead use HTTPResponse.headers.get(name, default).
  return self.urllib3_response.getheader(name, default)
C:\Users\emilr\Documents\AutoGPT\auto-gpt\autogpt\memory\pinecone.py:40: ResourceWarning: unclosed <ssl.SSLSocket fd=1004, family=2, type=1, proto=0, laddr=('IPAddress', Port), raddr=('34.146.254.58', 443)>
  if table_name not in pinecone.list_indexes():
ResourceWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\emilr\Documents\AutoGPT\auto-gpt\venv\Lib\site-packages\pinecone\manage.py:133: ResourceWarning: unclosed <ssl.SSLSocket fd=1124, family=2, type=1, proto=0, laddr=('IPAddress', Port), raddr=('34.146.254.58', 443)>
  status = _get_status(name)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\emilr\Documents\AutoGPT\auto-gpt\venv\Lib\site-packages\pinecone\manage.py:133: ResourceWarning: unclosed <ssl.SSLSocket fd=1008, family=2, type=1, proto=0, laddr=('IPAddress', Port), raddr=('34.146.254.58', 443)>
  status = _get_status(name)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\emilr\Documents\AutoGPT\auto-gpt\venv\Lib\site-packages\pinecone\manage.py:133: ResourceWarning: unclosed <ssl.SSLSocket fd=1308, family=2, type=1, proto=0, laddr=('IPAddress', Port), raddr=('34.146.254.58', 443)>
  status = _get_status(name)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\emilr\Documents\AutoGPT\auto-gpt\venv\Lib\site-packages\pinecone\manage.py:133: ResourceWarning: unclosed <ssl.SSLSocket fd=1104, family=2, type=1, proto=0, laddr=('IPAddress', Port), raddr=('34.146.254.58', 443)>
  status = _get_status(name)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\emilr\Documents\AutoGPT\auto-gpt\venv\Lib\site-packages\pinecone\manage.py:133: ResourceWarning: unclosed <ssl.SSLSocket fd=1080, family=2, type=1, proto=0, laddr=('IPAddress', Port), raddr=('34.146.254.58', 443)>
  status = _get_status(name)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\emilr\Documents\AutoGPT\auto-gpt\autogpt\__main__.py", line 4, in <module>      
    from autogpt.agent.agent import Agent
  File "C:\Users\emilr\Documents\AutoGPT\auto-gpt\autogpt\agent\__init__.py", line 1, in <module>
    from autogpt.agent.agent import Agent
  File "C:\Users\emilr\Documents\AutoGPT\auto-gpt\autogpt\agent\agent.py", line 2, in <module>   
    from autogpt.app import execute_command, get_command
  File "C:\Users\emilr\Documents\AutoGPT\auto-gpt\autogpt\app.py", line 12, in <module>
    from autogpt.commands.web_requests import scrape_links, scrape_text
  File "C:\Users\emilr\Documents\AutoGPT\auto-gpt\autogpt\commands\web_requests.py", line 16, in <module>
    memory = get_memory(CFG)
             ^^^^^^^^^^^^^^^
  File "C:\Users\emilr\Documents\AutoGPT\auto-gpt\autogpt\memory\__init__.py", line 50, in get_memory
    memory = PineconeMemory(cfg)
             ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\emilr\Documents\AutoGPT\auto-gpt\autogpt\config\singleton.py", line 15, in __call__
    cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\emilr\Documents\AutoGPT\auto-gpt\autogpt\memory\pinecone.py", line 41, in __init__
    pinecone.create_index(
  File "C:\Users\emilr\Documents\AutoGPT\auto-gpt\venv\Lib\site-packages\pinecone\manage.py", line 141, in create_index
    time.sleep(5)
KeyboardInterrupt
sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=836, family=2, type=1, proto=0, laddr=('IPAddress', Port), raddr=('IPAddress', 443)>
ResourceWarning: Enable tracemalloc to get the object allocation traceback

emilrueh avatar Apr 20 '23 12:04 emilrueh

What os are you using? Where are you located geographically (roughly)

ntindle avatar Apr 21 '23 04:04 ntindle

I am on Windows 10 and located in Central Europe.

Been wondering about the locations of pinecone but couldn't find a setting to change east-asia.


(just changed the error log to exclude some IPs)

emilrueh avatar Apr 21 '23 06:04 emilrueh

Try and use the #tech-support channel in discord for these issues. We don’t have the capacity to help debug in GitHub issues for problems like this with the required back and forth they deserve

ntindle avatar Apr 23 '23 03:04 ntindle

@emilrueh did you figure this out? Getting the same error. I wonder if I should be closing the pinecone client somehow

dhruv-anand-aintech avatar Dec 19 '23 08:12 dhruv-anand-aintech

@dhruv-anand-aintech sadly I have never figured it out as I went to other projects since then, sorry. However a comment above stated to ask the question in their discord so perhaps that might help? Good luck!

emilrueh avatar Dec 19 '23 09:12 emilrueh