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

"failed stated PuppetWeChatBridge" #78

Closed
8 tasks done
lprintf opened this issue Jul 10, 2021 · 7 comments
Closed
8 tasks done

"failed stated PuppetWeChatBridge" #78

lprintf opened this issue Jul 10, 2021 · 7 comments

Comments

@lprintf
Copy link
Contributor

lprintf commented Jul 10, 2021

Failed to Start PuppetWeChatBridge with the Envirenment X64.

Self-Diagnosis

  • I have reviewed the documentation.
  • I have reviewed the Wiki.
  • I have tried to use the latest version.
  • I have searched the issues for an answer to my question.
  • I have searched the web for an answer to my question.

Environment(for bug reports)

  • Operating System: centos7
  • IDE version: VSCode
  • Plugin version: matrix-appservice-wechaty@0.8.28; wechaty-puppet-wechat@0.28.1

My configuration/Related code

WECHATY_PUPPET=wechaty-puppet-wechat

Steps to Reproduce the Issue

run WECHATY_PUPPET=wechaty-puppet-wechat LOG_LEVEL=silly ts-node bin/matrix-appservice-wechaty.ts --config config/config.yaml --file wechaty-registration.yaml directly in centos7 x64

Current Result (Include screenshots where appropriate.)

23:12:53 VERB PuppetWeChatBridge initBrowser() with options={"args":["--audio-output-channels=0","--disable-default-apps","--disable-translate","--disable-gpu","--disable-setuid-sandbox","--disable-sync","--hide-scrollbars","--mute-audio","--no-sandbox"],"headless":true}
23:12:53 ERR PuppetWeChatBridge start() exception: Error: Could not find expected browser (chrome) locally. Run `npm install` to download the correct Chromium revision (848005).
23:12:53 SILL StateSwitch <PuppetWeChatBridge> off() is false
23:12:53 VERB StateSwitch <PuppetWeChatBridge> off(true) <- (false)
23:12:53 ERR PuppetWeChat initBridge() exception: Could not find expected browser (chrome) locally. Run `npm install` to download the correct Chromium revision (848005).
23:12:53 VERB PuppetWeChatBridge stop()
23:12:53 ERR PuppetWeChat initBridge() this.bridge.stop() rejection: Error: no page
23:12:53 ERR PuppetWeChat start() exception: Error
Error: 
    at PuppetWeChat.<anonymous> (/home/ylin/Documents/matrix-appservice-wechaty/node_modules/wechaty/src/wechaty.ts:444:32)
    at PuppetWeChat.emit (events.js:315:20)
    at PuppetWeChat.EventEmitter.emit (domain.js:467:12)
    at PuppetWeChat.start (/home/ylin/Documents/matrix-appservice-wechaty/node_modules/wechaty/node_modules/wechaty-puppet-wechat/src/puppet-wechat.ts:201:12)
    at Wechaty.start (/home/ylin/Documents/matrix-appservice-wechaty/node_modules/wechaty/src/wechaty.ts:726:7)
    at async Promise.all (index 0)
    at Object.run (/home/ylin/Documents/matrix-appservice-wechaty/src/cli/run.ts:57:3)
...

Expected Result

I will propose a pull request after my last pull request haved been deal if appropriate. If it is not appropriate, please stop me and point my faults.

Further explanation:

It seem a bug about puppeteer, and similliar to berstend/puppeteer-extra#471 and
https://stackoverflow.com/questions/53997175/puppeteer-error-chromium-revision-is-not-downloaded.

I have avoid it by install chrome and add some modifications in a commit such as follow:

  if(process.env.SIMULATED){
    // XXX This is aim to use the chrome referred by /usr/bin/chromium-browser as dependency of wechaty.node_modules.puppeteer module.
    Object.defineProperty(process, 'arch', {
      value: process.env.SIMULATED,
    });
  }

I am not familiar with the open source project contribution process. I will propose a pull request after my last pull request haved been deal if appropriate.

@huan
Copy link
Member

huan commented Jul 18, 2021

Thanks for creating this issue and the explanation!

I have two questions after reviewed the PR and read the links that you provided:

  1. Did you tried the Remove puppeteer-core from your dependencies. suggestion from issue 471?
  2. Have you tried the answer from https://stackoverflow.com/questions/53997175/puppeteer-error-chromium-revision-is-not-downloaded by adding executablePath: '/usr/bin/chromium-browser' to puppeteer options?

@lprintf
Copy link
Contributor Author

lprintf commented Jul 18, 2021

Yes, This is not a good way to solve the problem only avoid it temporarily. But this project is not dependented puppeteer derectly. A better solution is to update the puppeteer of wechaty. And there is a debug script disscuss more. Let me try more.

@lprintf
Copy link
Contributor Author

lprintf commented Jul 18, 2021

emmm, I use the endpoint: '/usr/bin/chromium-browser' and solve this problem. I will try more before commit in the future.

@lprintf lprintf closed this as completed Jul 18, 2021
@huan
Copy link
Member

huan commented Jul 18, 2021

Great to know that you have solved this problem by setting the puppetOptions.

It would be great if you can write your solution by adding a TroubleShooting section in the README so that it can help future developers who run into the same issue that you have.

@lprintf
Copy link
Contributor Author

lprintf commented Jul 18, 2021

Great to know that you have solved this problem by setting the puppetOptions.

It would be great if you can write your solution by adding a TroubleShooting section in the README so that it can help future developers who run into the same issue that you have.

OK, it have been record. And I have updated the PR #79 now.

@lprintf
Copy link
Contributor Author

lprintf commented Jul 19, 2021

When I install dependency in wechaty-puppet-wechat, It will install chrominum automaticly and needn't set chromium path by myself. But set the chromium path manually is a easy way to solve this problem.

> puppeteer@7.1.0 install /home/ylin/Documents/wechaty-puppet-wechat/node_modules/puppeteer
> node install.js

Downloading Chromium r848005 - 138.2 Mb [====================] 100% 0.0s 
Chromium (848005) downloaded to /home/ylin/Documents/wechaty-puppet-wechat/node_modules/puppeteer/.local-chromium/linux-848005

> core-js@3.15.2 postinstall /home/ylin/Documents/wechaty-puppet-wechat/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

@lprintf lprintf reopened this Jul 19, 2021
@lprintf lprintf changed the title Bug failed stated PuppetWeChatBridge "failed stated PuppetWeChatBridge" Jul 19, 2021
@lprintf
Copy link
Contributor Author

lprintf commented Jul 19, 2021

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