Closed sskmtm closed 1 year ago
偶尔出现还是持续出现?
目前在本地持续出现,而且关机重启之后还是会出现
通过mac 的活动监视器发现,出现这种情况的时候,会产生一个 'chrome_crashpad_handler' 的进程,不确定是否和这个又关系
那为啥以前没出现呢?把 $TMPDIR/pulsasr-$USER 临时文件删掉呢?
删掉: $TMPDIR/pulsasr-$USER 目录后,还是会出现
我在本地执行过这样一个命令,之后就会出现上面的问题
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --proxy-server=1.84.252.243:4231 --headless --disable-gpu --hide-scrollbars --remote-debugging-port=0 --no-default-browser-check --no-first-run --no-startup-window --mute-audio --disable-background-networking --disable-background-timer-throttling --disable-client-side-phishing-detection --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-translate --disable-blink-features=AutomationControlled --metrics-recording-only --safebrowsing-disable-auto-update --no-sandbox --ignore-certificate-errors --window-size=1920,1080 --pageLoadStrategy=none --throwExceptionOnScriptError=true --user-data-dir=/tmp/pulsar-root/context/browser/br.66b305
用 root 用户在很多时候都会出现权限问题,不是权限越高错误越少。
检查是否chrome自身权限限制问题,最简单的办法,执行
./bin/tools/chrome/prototype/start-copy.sh
看是否能正常打开浏览器。
直接执行: ./bin/tools/chrome/prototype/start-copy.sh
会出现如下错误:
Copy data from /Users/kust/.pulsar/browser/chrome/prototype/google-chrome to /tmp/pulsar-kust/context/browser1678358184
cp: /tmp/pulsar-kust/context/browser1678358184: No such file or directory
cp: /Users/kust/.pulsar/browser/chrome/prototype/google-chrome: unable to copy extended attributes to /tmp/pulsar-kust/context/browser1678358184: No such file or directory
rm: /tmp/pulsar-kust/context/browser1678358184/SingletonCookie: No such file or directory
rm: /tmp/pulsar-kust/context/browser1678358184/SingletonLock: No such file or directory
unlink: /tmp/pulsar-kust/context/browser1678358184/SingletonSocket: No such file or directory
./bin/tools/chrome/prototype/start-copy.sh: line 16: cd: /tmp/pulsar-kust/context/browser1678358184: No such file or directory
./bin/tools/chrome/prototype/start-copy.sh: line 18: /usr/bin/google-chrome-stable: No such file or directory
当把 ./bin/tools/chrome/prototype/start-copy.sh
文件中的:
/usr/bin/google-chrome-stable
-> /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
后,
其中:/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
是本机的 chrome 安装路径
再次执行 ./bin/tools/chrome/prototype/start-copy.sh
是可以在浏览器中打开 'https://www.tmall.com/'
Copy data from /Users/kust/.pulsar/browser/chrome/prototype/google-chrome to /tmp/pulsar-kust/context/browser1678359000
cp: /tmp/pulsar-kust/context/browser1678359000: No such file or directory
cp: /Users/kust/.pulsar/browser/chrome/prototype/google-chrome: unable to copy extended attributes to /tmp/pulsar-kust/context/browser1678359000: No such file or directory
rm: /tmp/pulsar-kust/context/browser1678359000/SingletonCookie: No such file or directory
rm: /tmp/pulsar-kust/context/browser1678359000/SingletonLock: No such file or directory
unlink: /tmp/pulsar-kust/context/browser1678359000/SingletonSocket: No such file or directory
./bin/tools/chrome/prototype/start-copy.sh: line 16: cd: /tmp/pulsar-kust/context/browser1678359000: No such file or directory
正在现有的浏览器会话中打开。
➜ exotic-amazon git:(main) ✗ objc[56559]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffb566b1ec8) and /Applications/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Versions/111.0.5563.64/Libraries/libGLESv2.dylib (0x111d41850). One of the two will be used. Which one is undefined.
...
这种情况是不是说明权限没问题呢
What's the version number of chrome?
➜ ~ /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version Google Chrome 111.0.5563.64 ➜ ~
We didn't test against chrome 111, just up to 110.
Since the error message has said:
Caused by: ai.platon.pulsar.browser.driver.chrome.util.WebSocketServiceException: Received error (405) - Method Not Allowed
Using unsafe HTTP verb GET to invoke /json/new. This action supports only PUT verb.
I think there is a protocol change in chrome 111 and we have to fix it in pulsarR.
The relevant code is in ChromeImpl:
val uri = URL(String.format(path, *params))
connection = uri.openConnection() as HttpURLConnection
We have to modify the code to support HTTP PUT method.
A simple fix is to downgrade chrome to 110.
ok,降低版本到 110 后,运行没问题了,需要注意的一点需要防止浏览器自动更新
Will be fixed in the next version with pulsar-1.10.11.
Fixed in the main branch by upgrading pulsar to 1.10.11.
请问一下这种错误是怎么造成的