Closed w2404 closed 12 months ago
At first, my autogpt was not able to use selenium, So I tried to pack selenium related code to a separated web service, where I can debug selenium alone.
Within autogpt's web_selenium.py, I would use urllib.request to call this web service.
Then I figured out, all the urllib requests failed with 502 errors, and that is why the selenium itself failed at the beginning, as selenium also calls urllib requests.
If I run the following code as a standalone script, no error occurs, just like it should be.
import urllib.request
urllib.request.urlopen('http://localhost:8123')
So what could be the reason, that inside autogpt's web_selenium.py, urllib requests fail with 502 errors?
A walk around for my own problem, is to replace the http service with a socket service. A socket connection is able work inside my autogpt.
def readnum(sock):
s=b''
ss=sock.recv(1)
while not ss==b' ':
s+=ss
ss=sock.recv(1)
return int(s)
def sendcmd(obj):
HOST, PORT = "localhost", 12723
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
sock.connect((HOST, PORT))
s=json.dumps(obj)
print(len(s))
s=f'{len(s)} {s}'.encode()
sock.sendall(s)
size=readnum(sock)
print('size',size)
received = sock.recv(size).decode()
o=json.loads(received )
How are you getting a 502 locally??
How are you getting a 502 locally??
Yes, that is what I want to know.
This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.
This issue was closed automatically because it has been stale for 10 days with no activity.
⚠️ Search for existing issues first ⚠️
Which Operating System are you using?
Linux
Which version of Auto-GPT are you using?
Master (branch)
GPT-3 or GPT-4?
GPT-3.5
Steps to reproduce 🕹
python -m http.server 8123
python -m autogpt
Current behavior 😯
Expected behavior 🤔
no error occurs
Your prompt 📝
N/A
Your Logs 📒
N/A