xtekky / gpt4free

The official gpt4free repository | various collection of powerful language models
https://g4f.ai
GNU General Public License v3.0
59.03k stars 13.16k forks source link

Claude-3-Opus (You) error: Failed to connect to browser #1929

Open rqi14 opened 1 month ago

rqi14 commented 1 month ago

Bug description I asked a question using claude-3-opus model from You. It reports error:

An error occured: You: Exception: --------------------- Failed to connect to browser --------------------- One of the causes could be when you are running as root. In that case you need to pass no_sandbox=True

Environment

hlohaus commented 1 month ago

The browser won't open. Maybe it's out of memory or you're doing too many things at once.

rqi14 commented 1 month ago

The browser won't open. Maybe it's out of memory or you're doing too many things at once.

Hi. I have 128GB of memory and at least 100GB are free. It doesn't look like a memory issue. I run it using docker compose. Is it somehow related to that?

rqi14 commented 1 month ago

The browser won't open. Maybe it's out of memory or you're doing too many things at once.

By checking the noVNC for the VM, I found the browser was actually open but showed a blank page.

hlohaus commented 1 month ago

Please confirm if the following line is present in your docker-compose.yml file: shm_size: 2gb

It is important to note that Google Chrome requires a minimum amount of memory to function properly.

Alternatively, you can try restarting the container and running nodriver again.

rqi14 commented 1 month ago

Please confirm if the following line is present in your docker-compose.yml file: shm_size: 2gb

It is important to note that Google Chrome requires a minimum amount of memory to function properly.

Alternatively, you can try restarting the container and running nodriver again.

Hi.

I double checked and can confirm the 'shm_size: 2gb' option is present in the docker-compose file. I don't quite understand the nodriver thing. It does not seem to be present in any of the document.

Please see the below screenshot. I think the chrome is open but it shows a blank page.

image

g4f complaints it couldn't connect to the browser.

image

KGLongWang commented 1 month ago

I have the same question no_sandbox=True

daniilshamraev commented 3 weeks ago

I have the same question no_sandbox=True (Need for Heroku hosting)

Antom91 commented 2 weeks ago

I have the same question no_sandbox=True

rqi14 commented 1 week ago

Please confirm if the following line is present in your docker-compose.yml file: shm_size: 2gb

It is important to note that Google Chrome requires a minimum amount of memory to function properly.

Alternatively, you can try restarting the container and running nodriver again.

Hi. I probably found the cause of the issue. I cannot access you.com directly. It must happen via a proxy. Therefore, in addition to the G4F_PROXY environment varaible, I set HTTP_PROXY and HTTPS_PROXY. If these two are not set, the chromium window pops up with the url being you.com but it is inaccessible due to my network enviroment. If I set these two proxy options, I have the problem that the chromium window pops up with a empty blank page.