Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
Other
167.49k stars 44.24k forks source link

ResourceWarning: unclosed <ssl.SSLSocket #2401

Closed emilrueh closed 1 year ago

emilrueh commented 1 year ago

⚠️ Search for existing issues first ⚠️

GPT-3 or GPT-4

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
ntindle commented 1 year ago

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?

emilrueh commented 1 year ago

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 commented 1 year ago

@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
ntindle commented 1 year ago

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

emilrueh commented 1 year ago

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)

ntindle commented 1 year ago

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

dhruv-anand-aintech commented 9 months ago

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

emilrueh commented 9 months ago

@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!