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

It doesn't start at all in headless mode. #933

Open
bropines opened this issue Jan 26, 2025 · 2 comments
Open

It doesn't start at all in headless mode. #933

bropines opened this issue Jan 26, 2025 · 2 comments

Comments

@bropines
Copy link

System Details

  • OS: Debian 12 (bookworm)
  • Thorium Version:
❯ /home/bropines/fumo_player/parsejs/thorium/thorium --version
/home/bropines/fumo_player/parsejs/thorium/chromedriver --version
Thorium 120.0.6099.235
ChromeDriver 120.0.6099.235 (05823e77e625a88543a0643805a043a026755012-refs/branch-heads/6099@{#1782})

❯ /usr/bin/thorium-browser --version
/opt/chromium.org/thorium/chromedriver --version
Thorium 120.0.6099.235 stable, built on Linux
ChromeDriver 120.0.6099.235 (05823e77e625a88543a0643805a043a026755012-refs/branch-heads/6099@{#1782})

Problem
It doesn't start at all in headless mode. And even on new versions. Despite the fact that the build (/home/bropines/fumo_player/parsejs/thorium/thorium) that I installed a thousand years ago is not clear from which repository, it works, and the same version from releases gives the error `Multiple targets are not supported in headless mode'. Despite the fact that the versions are absolutely identical. I probably won't be able to find a link to that build, because it was a long time ago.

Did you read the FAQ?
CTRL+F "Healdess" - 0 result

LOG: /usr/bin/thorium-browser
[1737857915.993][INFO]: Starting ChromeDriver 120.0.6099.235 (05823e77e625a88543a0643805a043a026755012-refs/branch-heads/6099@{#1782}) on port 44125
[1737857915.993][INFO]: Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[1737857916.003][INFO]: [133a02b1102162388bcb40d63fa28df0] COMMAND InitSession {
   "capabilities": {
      "alwaysMatch": {
         "browserName": "chrome",
         "goog:chromeOptions": {
            "args": [ "--headless=new", "--no-sandbox", "--disable-dev-shm-usage", "--remote-debugging-port=9222" ],
            "binary": "/usr/bin/thorium-browser",
            "extensions": [  ]
         },
         "pageLoadStrategy": "normal"
      },
      "firstMatch": [ {
      } ]
   }
}
[1737857916.003][INFO]: Populating Preferences file: {
   "alternate_error_pages": {
      "enabled": false
   },
   "autofill": {
      "enabled": false
   },
   "browser": {
      "check_default_browser": false
   },
   "distribution": {
      "import_bookmarks": false,
      "import_history": false,
      "import_search_engine": false,
      "make_chrome_default_for_user": false,
      "skip_first_run_ui": true
   },
   "dns_prefetching": {
      "enabled": false
   },
   "profile": {
      "content_settings": {
         "pattern_pairs": {
            "https://*,*": {
               "media-stream": {
                  "audio": "Default",
                  "video": "Default"
               }
            }
         }
      },
      "default_content_setting_values": {
         "geolocation": 1
      },
      "default_content_settings": {
         "geolocation": 1,
         "mouselock": 1,
         "notifications": 1,
         "popups": 1,
         "ppapi-broker": 1
      },
      "password_manager_enabled": false
   },
   "safebrowsing": {
      "enabled": false
   },
   "search": {
      "suggest_enabled": false
   },
   "translate": {
      "enabled": false
   }
}
[1737857916.003][INFO]: Populating Local State file: {
   "background_mode": {
      "enabled": false
   },
   "ssl": {
      "rev_checking": {
         "enabled": false
      }
   }
}
[1737857916.004][INFO]: ChromeDriver supports communication with Chrome via pipes. This is more reliable and more secure.
[1737857916.004][INFO]: Use the --remote-debugging-pipe Chrome switch instead of the default --remote-debugging-port to enable this communication mode.
[1737857916.004][INFO]: Launching chrome: /usr/bin/thorium-browser --allow-pre-commit-input --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-logging --headless=new --log-level=0 --no-first-run --no-sandbox --no-service-autorun --password-store=basic --remote-debugging-port=9222 --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.org.chromium.Chromium.h45kRR data:,
[1737857916.007][DEBUG]: DevTools HTTP Request: http://localhost:9222/json/version
[1737857916.007][DEBUG]: DevTools HTTP Request failed
- [0126/051836.037866:ERROR:chrome_main.cc(164)] Multiple targets are not supported in headless mode.
[1737857916.057][DEBUG]: DevTools HTTP Request: http://localhost:9222/json/version
[1737857916.058][DEBUG]: DevTools HTTP Request failed

[1737857917.087][INFO]: [133a02b1102162388bcb40d63fa28df0] RESPONSE InitSession ERROR session not created: Chrome failed to start: exited normally.
  (chrome not reachable)
  (The process started from chrome location /usr/bin/thorium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
[1737857917.088][DEBUG]: Log type 'driver' lost 0 entries on destruction
[1737857917.088][DEBUG]: Log type 'browser' lost 0 entries on destruction
LOG: /home/bropines/fumo_player/parsejs/thorium/thorium
[1737858535.013][INFO]: Starting ChromeDriver 120.0.6099.235 (05823e77e625a88543a0643805a043a026755012-refs/branch-heads/6099@{#1782}) on port 48461
[1737858535.013][INFO]: Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[1737858535.022][INFO]: [5ee49c40def94563b2d07dbeea40d69c] COMMAND InitSession {
   "capabilities": {
      "alwaysMatch": {
         "browserName": "chrome",
         "goog:chromeOptions": {
            "args": [ "--headless=new", "--no-sandbox", "--disable-dev-shm-usage", "--remote-debugging-port=9222" ],
            "binary": "/home/bropines/fumo_player/parsejs/thorium/thorium",
            "extensions": [  ]
         },
         "pageLoadStrategy": "normal"
      },
      "firstMatch": [ {
      } ]
   }
}
[1737858535.022][INFO]: Populating Preferences file: {
   "alternate_error_pages": {
      "enabled": false
   },
   "autofill": {
      "enabled": false
   },
   "browser": {
      "check_default_browser": false
   },
   "distribution": {
      "import_bookmarks": false,
      "import_history": false,
      "import_search_engine": false,
      "make_chrome_default_for_user": false,
      "skip_first_run_ui": true
   },
   "dns_prefetching": {
      "enabled": false
   },
   "profile": {
      "content_settings": {
         "pattern_pairs": {
            "https://*,*": {
               "media-stream": {
                  "audio": "Default",
                  "video": "Default"
               }
            }
         }
      },
      "default_content_setting_values": {
         "geolocation": 1
      },
      "default_content_settings": {
         "geolocation": 1,
         "mouselock": 1,
         "notifications": 1,
         "popups": 1,
         "ppapi-broker": 1
      },
      "password_manager_enabled": false
   },
   "safebrowsing": {
      "enabled": false
   },
   "search": {
      "suggest_enabled": false
   },
   "translate": {
      "enabled": false
   }
}
[1737858535.022][INFO]: Populating Local State file: {
   "background_mode": {
      "enabled": false
   },
   "ssl": {
      "rev_checking": {
         "enabled": false
      }
   }
}
[1737858535.023][INFO]: ChromeDriver supports communication with Chrome via pipes. This is more reliable and more secure.
[1737858535.023][INFO]: Use the --remote-debugging-pipe Chrome switch instead of the default --remote-debugging-port to enable this communication mode.
[1737858535.023][INFO]: Launching chrome: /home/bropines/fumo_player/parsejs/thorium/thorium --allow-pre-commit-input --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-logging --headless=new --log-level=0 --no-first-run --no-sandbox --no-service-autorun --password-store=basic --remote-debugging-port=9222 --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.org.chromium.Chromium.Lo3tTM data:,
[1737858535.026][DEBUG]: DevTools HTTP Request: http://localhost:9222/json/version
[1737858535.026][DEBUG]: DevTools HTTP Request failed
[1737858535.077][DEBUG]: DevTools HTTP Request: http://localhost:9222/json/version
[1737858535.077][DEBUG]: DevTools HTTP Request failed
[1737858535.127][DEBUG]: DevTools HTTP Request: http://localhost:9222/json/version
[1737858535.128][DEBUG]: DevTools HTTP Request failed
[589780:589780:0126/052855.157265:ERROR:policy_logger.cc(156)] :components/enterprise/browser/controller/chrome_browser_cloud_management_controller.cc(161) Cloud management controller initialization aborted as CBCM is not enabled. Please use the `--enable-chrome-browser-cloud-management` command line flag to enable it if you are not using the official Google Chrome build.
[1737858535.178][DEBUG]: DevTools HTTP Request: http://localhost:9222/json/version
[1737858535.179][DEBUG]: DevTools HTTP Request failed
[1737858535.229][DEBUG]: DevTools HTTP Request: http://localhost:9222/json/version
[1737858535.229][DEBUG]: DevTools HTTP Request failed

DevTools listening on ws://127.0.0.1:9222/devtools/browser/f3f2a357-2e7f-48cd-a35f-900c800ec4b2
[1737858535.279][DEBUG]: DevTools HTTP Request: http://localhost:9222/json/version
[1737858535.357][DEBUG]: DevTools HTTP Response: {
   "Browser": "Chrome/120.0.6099.235",
   "Protocol-Version": "1.3",
   "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.0.0 Safari/537.36",
   "V8-Version": "12.0.267.17",
   "WebKit-Version": "537.36 (@05823e77e625a88543a0643805a043a026755012)",
   "webSocketDebuggerUrl": "ws://localhost:9222/devtools/browser/f3f2a357-2e7f-48cd-a35f-900c800ec4b2"
}

[1737858535.357][DEBUG]: DevTools HTTP Request: http://localhost:9222/json/list
[1737858535.394][DEBUG]: DevTools HTTP Response: [ {
   "description": "",
   "devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:9222/devtools/page/0739768DC194F2371E4AD64D5E74BCBD",
   "id": "0739768DC194F2371E4AD64D5E74BCBD",
   "title": "",
   "type": "page",
   "url": "data:,",
   "webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/0739768DC194F2371E4AD64D5E74BCBD"
} ]

[1737858535.394][INFO]: resolved localhost to ["127.0.0.1","::1"]
[1737858535.403][DEBUG]: DevTools WebSocket Command: Target.getTargets (id=1) (session_id=) browser {
}
[1737858535.405][DEBUG]: DevTools WebSocket Response: Target.getTargets (id=1) (session_id=) browser {
   "targetInfos": [ {
      "attached": false,
      "browserContextId": "A158C1D41B3EFD956FE5E6492082FB64",
      "canAccessOpener": false,
      "targetId": "0739768DC194F2371E4AD64D5E74BCBD",
      "title": "",
      "type": "page",
      "url": "data:,"
   } ]
}
[1737858535.405][DEBUG]: DevTools WebSocket Command: Target.attachToTarget (id=2) (session_id=) browser {
   "flatten": true,
   "targetId": "0739768DC194F2371E4AD64D5E74BCBD"
}
[1737858535.408][DEBUG]: DevTools WebSocket Event: Target.attachedToTarget (session_id=) browser {
   "sessionId": "49E262832CACCBCE86850DB20443B89C",
   "targetInfo": {
      "attached": true,
      "browserContextId": "A158C1D41B3EFD956FE5E6492082FB64",
      "canAccessOpener": false,
      "targetId": "0739768DC194F2371E4AD64D5E74BCBD",
      "title": "",
      "type": "page",
      "url": "data:,"
   },
   "waitingForDebugger": false
}
[1737858535.410][DEBUG]: DevTools WebSocket Response: Target.attachToTarget (id=2) (session_id=) browser {
   "sessionId": "49E262832CACCBCE86850DB20443B89C"
}
[1737858535.410][DEBUG]: DevTools WebSocket Command: Page.enable (id=3) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.410][DEBUG]: DevTools WebSocket Command: Page.addScriptToEvaluateOnNewDocument (id=4) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "source": "(function () {window.cdc_adoQpoasnfa76pfcZLmcfl_Array = window.Array;window.cdc_adoQpoasnfa76pfcZLmcfl_Object = window.Object;window.cdc_adoQpoasnfa76pfcZLmcfl_Promise = window.Promise;window.cdc_a..."
}
[1737858535.410][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=5) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "expression": "(function () {window.cdc_adoQpoasnfa76pfcZLmcfl_Array = window.Array;window.cdc_adoQpoasnfa76pfcZLmcfl_Object = window.Object;window.cdc_adoQpoasnfa76pfcZLmcfl_Promise = window.Promise;window.cdc_a..."
}
[1737858535.410][DEBUG]: DevTools WebSocket Command: Log.enable (id=6) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.410][DEBUG]: DevTools WebSocket Command: Target.setAutoAttach (id=7) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "autoAttach": true,
   "flatten": true,
   "waitForDebuggerOnStart": false
}
[1737858535.410][DEBUG]: DevTools WebSocket Command: Page.enable (id=8) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.410][DEBUG]: DevTools WebSocket Command: Page.enable (id=9) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[589821:589845:0126/052855.426258:ERROR:command_buffer_proxy_impl.cc(127)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[1737858535.445][DEBUG]: DevTools WebSocket Response: Page.enable (id=3) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.445][DEBUG]: DevTools WebSocket Response: Page.addScriptToEvaluateOnNewDocument (id=4) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "identifier": "1"
}
[1737858535.445][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=5) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "result": {
      "type": "undefined"
   }
}
[1737858535.445][DEBUG]: DevTools WebSocket Response: Log.enable (id=6) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.445][DEBUG]: DevTools WebSocket Response: Target.setAutoAttach (id=7) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.445][DEBUG]: DevTools WebSocket Response: Page.enable (id=8) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.445][DEBUG]: DevTools WebSocket Response: Page.enable (id=9) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.445][DEBUG]: DevTools WebSocket Command: Runtime.enable (id=10) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.446][DEBUG]: DevTools WebSocket Event: Page.domContentEventFired (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "timestamp": 987790.080055
}
[1737858535.446][DEBUG]: DevTools WebSocket Event: Page.loadEventFired (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "timestamp": 987790.086761
}
[1737858535.452][DEBUG]: DevTools WebSocket Event: Page.frameStoppedLoading (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "frameId": "0739768DC194F2371E4AD64D5E74BCBD"
}
[1737858535.452][DEBUG]: DevTools WebSocket Event: Page.frameResized (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.454][DEBUG]: DevTools WebSocket Event: Runtime.executionContextCreated (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "context": {
      "auxData": {
         "frameId": "0739768DC194F2371E4AD64D5E74BCBD",
         "isDefault": true,
         "type": "default"
      },
      "id": 1,
      "name": "",
      "origin": "://",
      "uniqueId": "448126844194599149.-3113763492983140939"
   }
}
[1737858535.454][DEBUG]: DevTools WebSocket Response: Runtime.enable (id=10) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.454][DEBUG]: DevTools WebSocket Command: Page.enable (id=11) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.454][DEBUG]: DevTools WebSocket Response: Page.enable (id=11) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.454][DEBUG]: DevTools WebSocket Command: Runtime.enable (id=12) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.455][DEBUG]: DevTools WebSocket Response: Runtime.enable (id=12) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.455][INFO]: [5ee49c40def94563b2d07dbeea40d69c] RESPONSE InitSession {
   "capabilities": {
      "acceptInsecureCerts": false,
      "browserName": "chrome",
      "browserVersion": "120.0.6099.235",
      "chrome": {
         "chromedriverVersion": "120.0.6099.235 (05823e77e625a88543a0643805a043a026755012-refs/branch-heads/6099@{#1782})",
         "userDataDir": "/tmp/.org.chromium.Chromium.Lo3tTM"
      },
      "fedcm:accounts": true,
      "goog:chromeOptions": {
         "debuggerAddress": "localhost:9222"
      },
      "networkConnectionEnabled": false,
      "pageLoadStrategy": "normal",
      "platformName": "linux",
      "proxy": {
      },
      "setWindowRect": true,
      "strictFileInteractability": false,
      "timeouts": {
         "implicit": 0,
         "pageLoad": 300000,
         "script": 30000
      },
      "unhandledPromptBehavior": "dismiss and notify",
      "webauthn:extension:credBlob": true,
      "webauthn:extension:largeBlob": true,
      "webauthn:extension:minPinLength": true,
      "webauthn:extension:prf": true,
      "webauthn:virtualAuthenticators": true
   },
   "sessionId": "5ee49c40def94563b2d07dbeea40d69c"
}
[1737858535.457][INFO]: [5ee49c40def94563b2d07dbeea40d69c] COMMAND Navigate {
   "url": "https://www.google.com"
}
[1737858535.457][INFO]: Waiting for pending navigations...
[1737858535.457][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=13) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "expression": "1"
}
[1737858535.457][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=13) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "result": {
      "description": "1",
      "type": "number",
      "value": 1
   }
}
[1737858535.457][INFO]: Done waiting for pending navigations. Status: ok
[1737858535.457][DEBUG]: DevTools WebSocket Command: Page.navigate (id=14) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "url": "https://www.google.com"
}
[1737858535.464][DEBUG]: DevTools WebSocket Event: Page.frameStartedLoading (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "frameId": "0739768DC194F2371E4AD64D5E74BCBD"
}
[1737858535.702][DEBUG]: DevTools WebSocket Response: Page.navigate (id=14) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "frameId": "0739768DC194F2371E4AD64D5E74BCBD",
   "loaderId": "A231BB87653D8E91AD2D46B697D97034"
}
[1737858535.702][INFO]: Waiting for pending navigations...
[1737858535.702][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=15) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "expression": "1"
}
[1737858535.710][DEBUG]: DevTools WebSocket Event: Runtime.executionContextsCleared (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.722][DEBUG]: DevTools WebSocket Event: Runtime.executionContextsCleared (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.722][DEBUG]: DevTools WebSocket Event: Page.frameNavigated (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "frame": {
      "adFrameStatus": {
         "adFrameType": "none"
      },
      "crossOriginIsolatedContextType": "NotIsolated",
      "domainAndRegistry": "google.com",
      "gatedAPIFeatures": [  ],
      "id": "0739768DC194F2371E4AD64D5E74BCBD",
      "loaderId": "A231BB87653D8E91AD2D46B697D97034",
      "mimeType": "text/html",
      "secureContextType": "Secure",
      "securityOrigin": "https://www.google.com",
      "url": "https://www.google.com/"
   },
   "type": "Navigation"
}
[1737858535.722][DEBUG]: DevTools WebSocket Event: Runtime.executionContextCreated (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "context": {
      "auxData": {
         "frameId": "0739768DC194F2371E4AD64D5E74BCBD",
         "isDefault": true,
         "type": "default"
      },
      "id": 1,
      "name": "",
      "origin": "https://www.google.com",
      "uniqueId": "5498727652018522778.6044701359604856849"
   }
}
[1737858535.732][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=15) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "result": {
      "description": "1",
      "type": "number",
      "value": 1
   }
}
[1737858535.850][DEBUG]: DevTools WebSocket Event: Log.entryAdded (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "entry": {
      "level": "info",
      "lineNumber": 94,
      "source": "rendering",
      "text": "Autofocus processing was blocked because a document already has a focused element.",
      "timestamp": 1.737858535849525e+12,
      "url": "https://www.google.com/"
   }
}
[1737858535.850][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=16) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "expression": "1"
}
[1737858535.867][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=16) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "result": {
      "description": "1",
      "type": "number",
      "value": 1
   }
}
[1737858535.946][DEBUG]: DevTools WebSocket Event: Page.frameResized (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858535.946][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=17) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "expression": "1"
}
[1737858535.951][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=17) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "result": {
      "description": "1",
      "type": "number",
      "value": 1
   }
}
[1737858536.456][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=18) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "expression": "1"
}
[1737858536.457][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=18) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "result": {
      "description": "1",
      "type": "number",
      "value": 1
   }
}
[1737858536.960][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=19) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "expression": "1"
}
[1737858536.961][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=19) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "result": {
      "description": "1",
      "type": "number",
      "value": 1
   }
}
[1737858537.464][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=20) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "expression": "1"
}
[1737858537.501][DEBUG]: DevTools WebSocket Event: Page.navigatedWithinDocument (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "frameId": "0739768DC194F2371E4AD64D5E74BCBD",
   "url": "https://www.google.com/"
}
[1737858537.501][DEBUG]: DevTools WebSocket Event: Page.domContentEventFired (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "timestamp": 987792.143707
}
[1737858537.501][DEBUG]: DevTools WebSocket Event: Page.loadEventFired (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "timestamp": 987792.146649
}
[1737858537.501][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=21) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "awaitPromise": false,
   "expression": "document.readyState",
   "returnByValue": true,
   "uniqueContextId": "5498727652018522778.6044701359604856849"
}
[1737858537.502][DEBUG]: DevTools WebSocket Event: Page.frameStoppedLoading (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "frameId": "0739768DC194F2371E4AD64D5E74BCBD"
}
[1737858537.509][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=20) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "result": {
      "description": "1",
      "type": "number",
      "value": 1
   }
}
[1737858537.549][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=21) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "result": {
      "type": "string",
      "value": "complete"
   }
}
[1737858537.549][INFO]: Done waiting for pending navigations. Status: ok
[1737858537.549][INFO]: [5ee49c40def94563b2d07dbeea40d69c] RESPONSE Navigate
[1737858537.550][INFO]: [5ee49c40def94563b2d07dbeea40d69c] COMMAND GetTitle {
}
[1737858537.550][INFO]: Waiting for pending navigations...
[1737858537.551][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=22) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "expression": "1"
}
[1737858537.562][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=22) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "result": {
      "description": "1",
      "type": "number",
      "value": 1
   }
}
[1737858537.562][INFO]: Done waiting for pending navigations. Status: ok
[1737858537.562][DEBUG]: DevTools WebSocket Command: Page.getFrameTree (id=23) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858537.575][DEBUG]: DevTools WebSocket Response: Page.getFrameTree (id=23) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "frameTree": {
      "frame": {
         "adFrameStatus": {
            "adFrameType": "none"
         },
         "crossOriginIsolatedContextType": "NotIsolated",
         "domainAndRegistry": "google.com",
         "gatedAPIFeatures": [  ],
         "id": "0739768DC194F2371E4AD64D5E74BCBD",
         "loaderId": "A231BB87653D8E91AD2D46B697D97034",
         "mimeType": "text/html",
         "secureContextType": "Secure",
         "securityOrigin": "https://www.google.com",
         "url": "https://www.google.com/"
      }
   }
}
[1737858537.575][DEBUG]: DevTools WebSocket Command: Page.getFrameTree (id=24) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858537.576][DEBUG]: DevTools WebSocket Response: Page.getFrameTree (id=24) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "frameTree": {
      "frame": {
         "adFrameStatus": {
            "adFrameType": "none"
         },
         "crossOriginIsolatedContextType": "NotIsolated",
         "domainAndRegistry": "google.com",
         "gatedAPIFeatures": [  ],
         "id": "0739768DC194F2371E4AD64D5E74BCBD",
         "loaderId": "A231BB87653D8E91AD2D46B697D97034",
         "mimeType": "text/html",
         "secureContextType": "Secure",
         "securityOrigin": "https://www.google.com",
         "url": "https://www.google.com/"
      }
   }
}
[1737858537.577][DEBUG]: DevTools WebSocket Command: Runtime.callFunctionOn (id=25) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "arguments": [  ],
   "awaitPromise": true,
   "functionDeclaration": "function(){ return (function() { // Copyright 2012 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/**\n * Enum for WebD...",
   "objectGroup": "aff32f9b-c004-414e-b3d0-6a73314f08e3",
   "serializationOptions": {
      "serialization": "deep"
   },
   "uniqueContextId": "5498727652018522778.6044701359604856849"
}
[1737858537.586][DEBUG]: DevTools WebSocket Response: Runtime.callFunctionOn (id=25) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "result": {
      "className": "Array",
      "deepSerializedValue": {
         "type": "array",
         "value": [ {
            "type": "string",
            "value": "{\"status\":0,\"value\":\"Google\"}"
         } ]
      },
      "description": "Array(1)",
      "objectId": "-6044900532535103049.1.1",
      "subtype": "array",
      "type": "object"
   }
}
[1737858537.586][DEBUG]: DevTools WebSocket Command: Runtime.releaseObjectGroup (id=26) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "objectGroup": "aff32f9b-c004-414e-b3d0-6a73314f08e3"
}
[1737858537.587][INFO]: Waiting for pending navigations...
[1737858537.587][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=27) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "expression": "1"
}
[1737858537.592][DEBUG]: DevTools WebSocket Response: Runtime.releaseObjectGroup (id=26) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
}
[1737858537.593][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=27) (session_id=49E262832CACCBCE86850DB20443B89C) 0739768DC194F2371E4AD64D5E74BCBD {
   "result": {
      "description": "1",
      "type": "number",
      "value": 1
   }
}
[1737858537.593][INFO]: Done waiting for pending navigations. Status: ok
[1737858537.593][INFO]: [5ee49c40def94563b2d07dbeea40d69c] RESPONSE GetTitle "Google"
[1737858537.594][INFO]: [5ee49c40def94563b2d07dbeea40d69c] COMMAND Quit {
}
[1737858537.644][INFO]: [5ee49c40def94563b2d07dbeea40d69c] RESPONSE Quit
[1737858537.644][DEBUG]: Log type 'driver' lost 0 entries on destruction
[1737858537.644][DEBUG]: Log type 'browser' lost 0 entries on destruction
@bropines
Copy link
Author

If you use the portable version, then everything is fine. But the question is, why is there such a difference between the deb version and the portable version?

@Alex313031
Copy link
Owner

Alex313031 commented Jan 27, 2025

@bropines It is because multiple command line args are being appended from different sources. Args from the wrapper scripts, and then args from chromedriver.
See https://source.chromium.org/chromium/chromium/src/+/41c5a92d035b1714e5b935e9085981dfc5bb9877:chrome/app/chrome_main.cc;l=201

Right above where it logs that error and then initiates a crash, it says that if the number of command line args is more than 1 (because 1 is needed to start it in headless mode), to log an error and then crash. Note that the name is confusing, because it doesn't count args manually entered by the user at the commandline in a terminal. It is counting args that are being passed by environment variables, or chromedriver, or other binary. The point is to avoid argument conflicts, since for example, it always applies the last given argument when given manually at the cmdline, but doesn't do that for other ways of passing flags. So for example running Thorium manually in a terminal with --foo=bar --foo=oof, it will only apply the --foo=oof since it came last. But what is it supposed to do, when you have, for example --foo=bar being set by the user manually at the commandline, --foo=oof being set by environment variables, and --foo=gooble being set by a runner binary like chromedriver or selenium. Chromium has different code points to load arguments from these different ways, so how would you guarantee that flags are accepted in a certain order, i.e. if there are conflicting or overwriting flags, which one should Thorium respect first? See the problem. So instead it just logs an error and crashes.

Making sure that flags being applied to the browser are only coming from one source (i.e. chromedriver in this case) should resolve the problem.

However, both the regular and portable versions by default use wrapper scripts. Can you try directly calling the binary in headless mode like so:

/opt/chromium.org/thorium/thorium --headless=new --no-sandbox --disable-dev-shm-usage --remote-debugging-port=9222

And see if that works for you. Then you could configure chromedriver or whatever headless testing setup you have in "parsejs" dir to use /opt/chromium.org/thorium/thorium instead of the /opt/chromium.org/thorium/thorium-browser or /usr/bin/thorium-browser (just a symbolic link to /opt/chromium.org/thorium/thorium-browser) wrapper scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants