Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running index.py fails with Failed to connect to browser #14

Closed
DUOLabs333 opened this issue Oct 18, 2024 · 6 comments
Closed

Running index.py fails with Failed to connect to browser #14

DUOLabs333 opened this issue Oct 18, 2024 · 6 comments

Comments

@DUOLabs333
Copy link

DUOLabs333 commented Oct 18, 2024

Interestingly, while the first time I ran it (in the course of solving iv-org/invidious#4947), the script ran successfully, when I tried to re-run it today, at the same commit, package versions, Python version, and chromium version (129.0.6668.58-1), I get the error message

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

Exception ignored in atexit callback: <function deconstruct_browser at 0xffffb8ecda80>
Traceback (most recent call last):
  File "/home/system/youtube-trusted-session-generator/venv/nodriver/core/util.py", line 124, in deconstruct_browser
    _.stop()
  File "/home/system/youtube-trusted-session-generator/venv/nodriver/core/browser.py", line 545, in stop
    asyncio.get_event_loop().create_task(self.connection.aclose())
                                         ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'aclose'

The Chromium browser does open though.

@DUOLabs333
Copy link
Author

DUOLabs333 commented Oct 18, 2024

Your patch that you mentioned here fixed the issue for me.

@hashamyounis9
Copy link

Hey @DUOLabs333!
hope you are doing well.
Can you please help me resolve this issue?

@DUOLabs333
Copy link
Author

If you are using the official Docker Image, you should already have the patch (it was committed in July). However, if you're running the tool locally (like I am), then you should open nodriver/core/browser.py (located in the relevant site-packages), and change await self.sleep(0.5) to await self.sleep(2).

@hashamyounis9
Copy link

Thank you so much @DUOLabs333 for this information. Really appreciate it.
Can you provide the link to official Docker image, couldn't find it on the docker hub.

@DUOLabs333
Copy link
Author

The instructions are in the README.md.

@unixfox
Copy link
Member

unixfox commented Oct 23, 2024

hello, I'm going to lock this github issue since the issue has been solved on docker for ages. The tutorial is located at https://docs.invidious.io/installation/#docker

@iv-org iv-org locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants