Second-Hand-Friends / kleinanzeigen-bot

A dilligent command line tool to publish ads on kleinanzeigen.de
GNU Affero General Public License v3.0
222 stars 46 forks source link

[BUG] Failed to connect to browser #315

Open apeltzer opened 5 months ago

apeltzer commented 5 months ago

✔️ Expected Behaviour

Connecting to Chrome works on OSX

🐞 Actual Behaviour

[ERROR] 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

📋 Steps to Reproduce

PDM or executable version, not running the app as root at all - so this should be t he problem.

📺 What browsers are you seeing the problem on? (if applicable)

Chrome

💻 What operating systems are you seeing the problem on? (if applicable)

MacOS

📃 Relevant log output (if applicable)

[ERROR] 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

Code of Conduct

Vel-San commented 5 months ago

FYI A quick fix for this is to open Chrome in debugging mode as well.

Chrome Launch from Terminal

open -a "Google Chrome" --args --remote-debugging-port=9222

Bot Config

arguments: ["-no-sandbox", "--remote-debugging-port=9222"]

benjidea commented 5 months ago

Same error for me too. I have tried Chrome and Edge. It seems like the script aborts too quickly to wait for the browser. Maybe it would be a possibility to make the timeout customizable in the config?

The suggested QuickFix has no success either.

provinzio commented 4 months ago

Duplicate of https://github.com/Second-Hand-Friends/kleinanzeigen-bot/issues/294

finnjung commented 3 months ago

I have the same problem was anyone able to solve it?

"FYI A quick fix for this is to open Chrome in debugging mode as well.

Chrome Launch from Terminal

open -a "Google Chrome" --args --remote-debugging-port=9222 Bot Config

arguments: ["-no-sandbox", "--remote-debugging-port=9222"]"

did not work for me or maybe I just did not completely understand what to do :D

nsotnikov commented 2 months ago

Same for me. Not working and the same error message. Also the quickfix does not work

0verEngineer commented 1 month ago

This bug still exists with the latest binary release for me on Fedora Linux 40 with chromium.

nico-i commented 4 weeks ago

FYI A quick fix for this is to open Chrome in debugging mode as well.

Chrome Launch from Terminal

open -a "Google Chrome" --args --remote-debugging-port=9222

Bot Config

arguments: ["-no-sandbox", "--remote-debugging-port=9222"]

This worked as a workaround for me (macOS 14.6.1 (23G93)), ty @Vel-San!

Also simplified it into one command:

open -a "Google Chrome" --args --remote-debugging-port=9222 && ./kleinanzeigen-bot <your-command>

And because there was some uncertainty on what exactly to do (see @finnjung's comment):

Add

browser:
  arguments:
    # https://stackoverflow.com/a/50725918/5116073
    - --disable-dev-shm-usage
    - --no-sandbox
    - --remote-debugging-port=9222

to your main configuration yaml file.

Esmax666 commented 1 day ago

FYI A quick fix for this is to open Chrome in debugging mode as well.

Chrome Launch from Terminal

open -a "Google Chrome" --args --remote-debugging-port=9222

Bot Config

arguments: ["-no-sandbox", "--remote-debugging-port=9222"]

This worked as a workaround for me (macOS 14.6.1 (23G93)), ty @Vel-San!

Also simplified it into one command:

open -a "Google Chrome" --args --remote-debugging-port=9222 && ./kleinanzeigen-bot <your-command>

And because there was some uncertainty on what exactly to do (see @finnjung's comment):

Add

browser:
  arguments:
    # https://stackoverflow.com/a/50725918/5116073
    - --disable-dev-shm-usage
    - --no-sandbox
    - --remote-debugging-port=9222

to your main configuration yaml file.

Hi, thx for the support :)

should i just add the line For emxemple after


 ad_files:
  - ./**/ad_*.{json,yml,yaml} 
```?

ok better begin or end ?

and if i want to refresh the items i just need to give the command "pdm run app download" ? -> i tried to give the command on powershell and also on dmd Windows 11 as admin but i receive this error
`PermissionError: [WinError 5] Access is denied`