Closed xinbenlv closed 6 years ago
It seems similar to this bug https://github.com/GoogleChrome/puppeteer/issues/550
I suspect the docker image doesn't have chromium that matches the revision specified in the puppeteer
I saw you are using the version of v0.11.40 which is not a stable version.
Could you try the latest stable version 0.12 and see if your issue could be fixed?
If you still have the problem, please run the following command and submit the output.
docker run zixia/wechaty:0.12 doctor
docker run zixia/wechaty:0.12 test
hi, encounter the same problem:(
here's my steps:
1、copy your official demo contents to bot.ts
2、at my local machine: mac 10.13,run the cmd docker run -ti --rm --volume="$(pwd)":/bot zixia/wechaty bot.ts
then my logs:
Starting Wechaty v0.13.14 with Node.js v8.9.0 ...
Working directory: /bot
Please make sure you had installed all the NPM modules which is depended on your bot script.
Executing ts-node bot.ts
22:29:06 WARN Wechaty init() DEPRECATED and will be removed after Jun 2018. Use start() instead.
22:29:06 INFO Wechaty v0.13.14 starting...
22:29:06 ERR PuppetWebBridge init() exception: AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install"
22:29:06 ERR PuppetWeb initBridge() exception: Chromium revision is not downloaded. Run "npm install"
22:29:06 WARN PuppetWebBridge quit() page.close() exception: TypeError: Cannot read property 'close' of undefined
22:29:06 WARN PuppetWebBridge quit() browser.close() exception: TypeError: Cannot read property 'close' of undefined
22:29:06 ERR PuppetWeb init() exception: AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install"
22:29:06 ERR Wechaty start() exception: Chromium revision is not downloaded. Run "npm install"
(node:30) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install"
(node:30) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
i have checked and tried all the issues and answers within "Chromium" but non is help: for example, i have run npm install
, npm install chromedriver
, npm install -g chromedriver
, FYI my chromedriver version now is "2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2)"
appreciate your help
@kenshinsyrup It's weird.
Could you please run docker run -ti --rm zixia/wechaty test
and post the output at here?
BTW: we are not using chromedriver anymore. We are using puppetreer now.
@zixia yeah it's weird, cause i can run this code in my linux machine...
mybot.ts
import { Wechaty } from 'wechaty'
Wechaty.instance() // Singleton
.on('scan', (url, code) => console.log(`Scan QR Code to login: ${code}\n${url}`))
.on('login', user => console.log(`User ${user} logined`))
.on('message', message => console.log(`Message: ${message}`))
.init()
package.json:
{
"name": "wechatbot",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"wechaty": "^0.13.14"
}
}
docker run -ti --rm zixia/wechaty test:
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
____ _ _
/ ___|___ _ __ _ __ ___ ___| |_(_)_ __ __ _
| | / _ \| '_ \| '_ \ / _ \/ __| __| | '_ \ / _` |
| |__| (_) | | | | | | | __/ (__| |_| | | | | (_| |
\____\___/|_| |_|_| |_|\___|\___|\__|_|_| |_|\__, |
|___/
____ _ _ ____ _
/ ___| |__ __ _| |_| __ ) ___ | |_ ___
| | | '_ \ / _` | __| _ \ / _ \| __/ __|
| |___| | | | (_| | |_| |_) | (_) | |_\__ \
\____|_| |_|\__,_|\__|____/ \___/ \__|___/
Starting Wechaty v0.13.14 with Node.js v8.9.0 ...
> wechaty@0.13.14 test:unit /wechaty
> blue-tape -r ts-node/register -r source-map-support/register "src/**/*.spec.ts" "tests/**/*.spec.ts"
TAP version 13
# important variables
ok 1 should exist `puppet` in Config
ok 2 should exist `apihost` in Config
ok 3 should exist `profile` in Config
ok 4 should exist `token` in Config
ok 5 should export DEFAULT_PUPPET
ok 6 should export DEFAULT_PROFILE
ok 7 should export DEFAULT_PROTOCOL
ok 8 should export DEFAULT_APIHOST
# validApiHost()
ok 9 should not throw
ok 10 should not throw
ok 11 should throw
ok 12 should throw
# puppetInstance()
ok 13 should throw when not initialized
ok 14 should equal with initialized data
ok 15 should throw after set to null
# constructor()
ok 16 id right
ok 17 from right
ok 18 toString()
# ready()
ok 19 id/MsgId right
ok 20 contact ready for FromUserName
ok 21 contact ready for FromNickName
ok 22 contact ready for ToUserName
ok 23 contact ready for ToNickName
# find()
ok 24 Message.find
# findAll()
ok 25 Message.findAll with limit 2
# self()
ok 26 should identify self message true where message from userId
ok 27 should identify self message false when from a different fromId
# mentioned()
ok 28 @_@ in message should not be treat as contact
ok 29 user@email.com in message should not be treat as contact
ok 30 @小桔同学 is a contact
ok 31 should get 小桔同学 id right in rawObj21
ok 32 @小桔同学 and @wuli舞哩客服 is a contact
ok 33 should get 小桔同学 id right in rawObj22
ok 34 should get wuli舞哩客服 id right in rawObj22
ok 35 @wuli舞哩客服 is a contact
ok 36 should get wuli舞哩客服 id right in rawObj31
ok 37 @小桔同学 and @wuli舞哩客服 is a contact
ok 38 should get wuli舞哩客服 id right in rawObj32
ok 39 should get 小桔同学 id right in rawObj32
# stripHtml()
ok 40 should strip html as expected
# unescapeHtml()
ok 41 should unescape html as expected
# plainText()
ok 42 should convert plain text as expected
# digestEmoji()
ok 43 should digest emoji string 0 as expected
ok 44 should digest emoji string 1 as expected
# unifyEmoji()
ok 45 should convert the emoji xml to the expected unified xml
ok 46 should convert the emoji xml to the expected unified xml
# stripEmoji()
ok 47 should strip to the expected str
ok 48 should strip to the expected str
ok 49 should return empty string for `undefined`
# downloadStream() for media
ok 50 should has cookies in req
ok 51 should has a cookie named life value 42
ok 52 should success download dong from downloadStream()
# getPort() for an available socket port
ok 53 should not be same port even it is available(to provent conflict between concurrency tests in AVA)
ok 54 should has no exception after loop test
# PuppetWebBridge
ok 55 @_@ wow! my email is ruiruibupt@gmail.com in message should not be treat as contact
ok 56 Bridge instnace
# preHtmlToXml()
ok 57 should parse html to xml
# testBlockedMessage()
# clickSwitchAccount()
# Firer smoke testing
ok 58 should be true
# parseFriendConfirm()
ok 59 should be truthy for confirm msg: You have added 李卓桓 as your WeChat contact. Start chatting!
ok 60 should be truthy for confirm msg: 你已添加了李卓桓,现在可以开始聊天了。
ok 61 should be truthy for confirm msg: johnbassserver@gmail.com just added you to his/her contacts list. Send a message to him/her now!
ok 62 should be truthy for confirm msg: johnbassserver@gmail.com刚刚把你添加到通讯录,现在可以开始聊天了。
ok 63 should be falsy for other msg
# parseRoomJoin()
ok 64 should check room join message right for You've invited "李卓桓" to the group chat
ok 65 should get inviteeList right
ok 66 should get inviter right
ok 67 should check room join message right for You've invited "李卓桓.PreAngel、Bruce LEE" to the group chat
ok 68 should get inviteeList right
ok 69 should get inviter right
ok 70 should check room join message right for "李卓桓.PreAngel" invited "Bruce LEE" to the group chat
ok 71 should get inviteeList right
ok 72 should get inviter right
ok 73 should check room join message right for "凌" invited "庆次、小桔妹" to the group chat
ok 74 should get inviteeList right
ok 75 should get inviter right
ok 76 should check room join message right for 你邀请"李佳芮"加入了群聊
ok 77 should get inviteeList right
ok 78 should get inviter right
ok 79 should check room join message right for "桔小秘"通过扫描你分享的二维码加入群聊
ok 80 should get inviteeList right
ok 81 should get inviter right
ok 82 should check room join message right for " 桔小秘"通过扫描"李佳芮"分享的二维码加入群聊
ok 83 should get inviteeList right
ok 84 should get inviter right
ok 85 should check room join message right for "桔小秘"通过扫描"李佳芮"分享的二维码加入群聊
ok 86 should get inviteeList right
ok 87 should get inviter right
ok 88 should check room join message right for "桔小秘" joined the group chat via your shared QR Code.
ok 89 should get inviteeList right
ok 90 should get inviter right
ok 91 should check room join message right for " 桔小秘" joined the group chat via the QR Codeshared by "李佳芮".
ok 92 should get inviteeList right
ok 93 should get inviter right
ok 94 should check room join message right for "桔小秘" joined the group chat via the QR Code shared by "李佳芮".
ok 95 should get inviteeList right
ok 96 should get inviter right
ok 97 should throws if message is not expected
# parseRoomLeave()
ok 98 should get leaver for leave message: You removed "Bruce LEE" from the group chat
ok 99 should get leaver name right
ok 100 should get leaver for leave message: 你将"李佳芮"移出了群聊
ok 101 should get leaver name right
ok 102 should get remover for leave message: You were removed from the group chat by "桔小秘"
ok 103 should get leaver name right
ok 104 should get remover for leave message: 你被"李佳芮"移出群聊
ok 105 should get leaver name right
ok 106 should throw if message is not expected
# parseRoomTopic()
ok 107 should check topic right for content: "李卓桓.PreAngel" changed the group name to "ding"
ok 108 should get right topic
ok 109 should get right changer
ok 110 should check topic right for content: "李佳芮"修改群名为“dong”
ok 111 should get right topic
ok 112 should get right changer
ok 113 should throw if message is not expected
# PuppetWebFriendRequest.receive smoke testing
ok 114 should has info object
ok 115 should has right request message
ok 116 should have a Contact instance
ok 117 should be receive type
# PuppetWebFriendRequest.confirm smoke testing
ok 118 should match confirm message
ok 119 should have a Contact instance
ok 120 should be confirm type
# PuppetWeb Module Exports
ok 121 should export PuppetWeb
ok 122 should export Event
ok 123 should export Bridge
# Puppet smoke testing
ok 124 should be OFF state after instanciate
ok 125 should be ON state after set
ok 126 should be pending state after set
# not blocked
ok 127 should return false when no block message
# html
ok 128 should get zh blocked message
# zh
ok 129 should get zh blocked message
# en
ok 130 should get en blocked message
# switch account needed
ok 131 should click the switch account button
# switch account not needed
ok 132 should no button found
1..132
# tests 132
# pass 132
# ok
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
_____ _ _ ___
| ____|_ _(_) |_ / _ \
| _| \ \/ / | __| | | | |
| |___ > <| | |_ | |_| |
|_____/_/\_\_|\__| \___/
@kenshinsyrup If you can pass all the tests of the docker, could you try again to run docker run -ti --rm --volume="$(pwd)":/bot zixia/wechaty bot.ts
and see what happened?
It should work if you could pass the unit tests. If not, please let me know what' happened, and we should add more unit tests to test docker environment.
@zixia all unit test passed, but still not work.
in fact, i tried docker run -ti --rm --volume="$(pwd)":/bot zixia/wechaty mybot.ts
after i saw the test logs are all successful, but, no, still not work.
and all the err info are same as the logs in my first comment.
i just tried again and here's logs:
docker run -ti --rm --volume="$(pwd)":/bot zixia/wechaty mybot.ts
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
____ _ _
/ ___|___ _ __ _ __ ___ ___| |_(_)_ __ __ _
| | / _ \| '_ \| '_ \ / _ \/ __| __| | '_ \ / _` |
| |__| (_) | | | | | | | __/ (__| |_| | | | | (_| |
\____\___/|_| |_|_| |_|\___|\___|\__|_|_| |_|\__, |
|___/
____ _ _ ____ _
/ ___| |__ __ _| |_| __ ) ___ | |_ ___
| | | '_ \ / _` | __| _ \ / _ \| __/ __|
| |___| | | | (_| | |_| |_) | (_) | |_\__ \
\____|_| |_|\__,_|\__|____/ \___/ \__|___/
Starting Wechaty v0.13.14 with Node.js v8.9.0 ...
Working directory: /bot
Please make sure you had installed all the NPM modules which is depended on your bot script.
Executing ts-node mybot.ts
06:45:46 WARN Wechaty init() DEPRECATED and will be removed after Jun 2018. Use start() instead.
06:45:46 INFO Wechaty v0.13.14 starting...
06:45:46 ERR PuppetWebBridge init() exception: AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install"
06:45:46 ERR PuppetWeb initBridge() exception: Chromium revision is not downloaded. Run "npm install"
06:45:46 WARN PuppetWebBridge quit() page.close() exception: TypeError: Cannot read property 'close' of undefined
06:45:46 WARN PuppetWebBridge quit() browser.close() exception: TypeError: Cannot read property 'close' of undefined
06:45:46 ERR PuppetWeb init() exception: AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install"
06:45:46 ERR Wechaty start() exception: Chromium revision is not downloaded. Run "npm install"
(node:30) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install"
(node:30) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
_____ _ _ ___
| ____|_ _(_) |_ / _ \
| _| \ \/ / | __| | | | |
| |___ > <| | |_ | |_| |
|_____/_/\_\_|\__| \___/
mybot.ts:
import { Wechaty } from 'wechaty'
Wechaty.instance() // Singleton
.on('scan', (url, code) => console.log(`Scan QR Code to login: ${code}\n${url}`))
.on('login', user => console.log(`User ${user} logined`))
.on('message', message => console.log(`Message: ${message}`))
.init()
package.json: { "name": "wechatbot", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "wechaty": "^0.13.14" } }
appreciate your time
Sorry but I can not reproduce it:
zixia@blinder:~$ cd /tmp/
zixia@blinder:/tmp$ cat > mybot.ts
import { Wechaty } from 'wechaty'
Wechaty.instance() // Singleton
.on('scan', (url, code) => console.log(`Scan QR Code to login: ${code}\n${url}`))
.on('login', user => console.log(`User ${user} logined`))
.on('message', message => console.log(`Message: ${message}`))
.init()
zixia@blinder:/tmp$ docker run -ti --rm --volume="$(pwd)":/bot zixia/wechaty mybot.ts
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
____ _ _
/ ___|___ _ __ _ __ ___ ___| |_(_)_ __ __ _
| | / _ \| '_ \| '_ \ / _ \/ __| __| | '_ \ / _` |
| |__| (_) | | | | | | | __/ (__| |_| | | | | (_| |
\____\___/|_| |_|_| |_|\___|\___|\__|_|_| |_|\__, |
|___/
____ _ _ ____ _
/ ___| |__ __ _| |_| __ ) ___ | |_ ___
| | | '_ \ / _` | __| _ \ / _ \| __/ __|
| |___| | | | (_| | |_| |_) | (_) | |_\__ \
\____|_| |_|\__,_|\__|____/ \___/ \__|___/
Starting Wechaty v0.13.14 with Node.js v8.9.0 ...
Working directory: /bot
Executing ts-node mybot.ts
08:39:52 WARN Wechaty init() DEPRECATED and will be removed after Jun 2018. Use start() instead.
08:39:52 INFO Wechaty v0.13.14 starting...
Scan QR Code to login: 0
https://login.weixin.qq.com/qrcode/4en53zNmmw==
^C Script terminated by Control-C
____ _ _ ____
/ ___| |_ _ __| | _ / ___|
| | | __| '__| | _| |_ | |
| |___| |_| | | | |_ _| | |___
\____|\__|_| |_| |_| \____|
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
_____ _ _ _ _____ ___
| ____|_ _(_) |_ / |___ / / _ \
| _| \ \/ / | __| | | |_ \| | | |
| |___ > <| | |_ | |___) | |_| |
|_____/_/\_\_|\__| |_|____/ \___/
zixia@blinder:/tmp$
Could you use another server and try it again?
@zixia OK,as I said, wechaty works fun in my another linux machine. Thanks a lot though, I'll keep an eye on my Mac.
@kenshinsyrup Did you mean that you can run on your Linux server but cant run under MacOS? @xinbenlv What's your platform?
@zixia yes, all logs above are from my MacOS Version 10.13.1 (17B48)
@kenshinsyrup Could you be able to reproduce your problem with another MacOS computer?
If you could, then we can confirm that this issue as a BUG related to MacOS.
@zixia sorry fot my late reply. My friend tried to run your official demo on his Mac with docker and encountered the same error:
Starting Wechaty v0.13.32 with Node.js v8.9.1 ...
Working directory: /bot
Please make sure you had installed all the NPM modules which is depended on your bot script.
Executing ts-node mybot.ts
07:10:50 WARN Wechaty init() DEPRECATED and will be removed after Jun 2018. Use start() instead.
07:10:50 INFO Wechaty v0.13.32 starting...
07:10:50 ERR PuppetWebBridge init() exception: AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install"
07:10:50 ERR PuppetWeb initBridge() exception: Chromium revision is not downloaded. Run "npm install"
07:10:50 WARN PuppetWebBridge quit() page.close() exception: TypeError: Cannot read property 'close' of undefined
07:10:50 WARN PuppetWebBridge quit() browser.close() exception: TypeError: Cannot read property 'close' of undefined
07:10:50 ERR PuppetWeb init() exception: AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install"
07:10:50 ERR Wechaty start() exception: Chromium revision is not downloaded. Run "npm install"
(node:30) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install"
(node:30) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
But, he said he could run the demo with npm successfully. Then I tried to run the demo with npm and yeah, it worked very well. hmm... very interesting...
Thanks for helping me to reproduce this issue on another Mac.
I'll have a try by my self when I have time.
I know how to reproduce it now
If we haven't installed wechaty
(or you can delete node_modules
folder), it will run successful with docker,
but after installing wechaty
, it will fail to start with docker
11:39:15 zzn@zzn-macbookpro2 ❯ ~ ❯ d ❯ … ❯ haoshiyou-bot ❯ v2 ❯ demo-chatie-issue-954 ▶ master 1⇡ + ▶ $ ▶ls
package-lock.json package.json src/ tsconfig.json
11:39:17 zzn@zzn-macbookpro2 ❯ ~ ❯ d ❯ … ❯ haoshiyou-bot ❯ v2 ❯ demo-chatie-issue-954 ▶ master 1⇡ + ▶ $ ▶docker run -ti --rm --volume="$(pwd)":/bot zixia/wechaty src/mybot.ts
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
____ _ _
/ ___|___ _ __ _ __ ___ ___| |_(_)_ __ __ _
| | / _ \| '_ \| '_ \ / _ \/ __| __| | '_ \ / _` |
| |__| (_) | | | | | | | __/ (__| |_| | | | | (_| |
\____\___/|_| |_|_| |_|\___|\___|\__|_|_| |_|\__, |
|___/
____ _ _ ____ _
/ ___| |__ __ _| |_| __ ) ___ | |_ ___
| | | '_ \ / _` | __| _ \ / _ \| __/ __|
| |___| | | | (_| | |_| |_) | (_) | |_\__ \
\____|_| |_|\__,_|\__|____/ \___/ \__|___/
Starting Wechaty v0.13.37 with Node.js v8.9.1 ...
Working directory: /bot
Please make sure you had installed all the NPM modules which is depended on your bot script.
Executing ts-node src/mybot.ts
18:49:52 WARN Wechaty init() DEPRECATED and will be removed after Jun 2018. Use start() instead.
18:49:52 INFO Wechaty v0.13.37 starting...
Scan QR Code to login: 0
https://login.weixin.qq.com/qrcode/YcRPCEW9EQ==
^C Script terminated by Control-C
____ _ _ ____
/ ___| |_ _ __| | _ / ___|
| | | __| '__| | _| |_ | |
| |___| |_| | | | |_ _| | |___
\____|\__|_| |_| |_| \____|
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
_____ _ _ _ _____ ___
| ____|_ _(_) |_ / |___ / / _ \
| _| \ \/ / | __| | | |_ \| | | |
| |___ > <| | |_ | |___) | |_| |
|_____/_/\_\_|\__| |_|____/ \___/
11:39:52 zzn@zzn-macbookpro2 ❯ ~ ❯ d ❯ … ❯ haoshiyou-bot ❯ v2 ❯ demo-chatie-issue-954 ▶ master 1⇡ + ▶ $ ▶npm i
WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs= integrity checksum failed when using sha1: wanted sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs= but got sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==. (4142 bytes)
WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
> puppeteer@0.13.0 install /Users/zzn/Documents/ws/haoshiyou-bot/v2/demo-chatie-issue-954/node_modules/puppeteer
> node install.js
Downloading Chromium r515411 - 73.2 Mb [====================] 100% 0.0s
Chromium downloaded to /Users/zzn/Documents/ws/haoshiyou-bot/v2/demo-chatie-issue-954/node_modules/puppeteer/.local-chromium/mac-515411
added 158 packages in 12.736s
11:40:14 zzn@zzn-macbookpro2 ❯ ~ ❯ d ❯ … ❯ haoshiyou-bot ❯ v2 ❯ demo-chatie-issue-954 ▶ master 1⇡ + ▶ $ ▶docker run -ti --rm --volume="$(pwd)":/bot zixia/wechaty src/mybot.ts
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
____ _ _
/ ___|___ _ __ _ __ ___ ___| |_(_)_ __ __ _
| | / _ \| '_ \| '_ \ / _ \/ __| __| | '_ \ / _` |
| |__| (_) | | | | | | | __/ (__| |_| | | | | (_| |
\____\___/|_| |_|_| |_|\___|\___|\__|_|_| |_|\__, |
|___/
____ _ _ ____ _
/ ___| |__ __ _| |_| __ ) ___ | |_ ___
| | | '_ \ / _` | __| _ \ / _ \| __/ __|
| |___| | | | (_| | |_| |_) | (_) | |_\__ \
\____|_| |_|\__,_|\__|____/ \___/ \__|___/
Starting Wechaty v0.13.37 with Node.js v8.9.1 ...
Working directory: /bot
Please make sure you had installed all the NPM modules which is depended on your bot script.
Executing ts-node src/mybot.ts
18:50:50 WARN Wechaty init() DEPRECATED and will be removed after Jun 2018. Use start() instead.
18:50:50 INFO Wechaty v0.13.36 starting...
18:50:50 ERR PuppetWebBridge init() exception: AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install"
18:50:50 ERR PuppetWeb initBridge() exception: Chromium revision is not downloaded. Run "npm install"
18:50:50 WARN PuppetWebBridge quit() page.close() exception: TypeError: Cannot read property 'close' of undefined
18:50:50 WARN PuppetWebBridge quit() browser.close() exception: TypeError: Cannot read property 'close' of undefined
18:50:50 ERR PuppetWeb init() exception: AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install"
18:50:50 ERR Wechaty start() exception: Chromium revision is not downloaded. Run "npm install"
(node:32) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install"
(node:32) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
_____ _ _ ___
| ____|_ _(_) |_ / _ \
| _| \ \/ / | __| | | | |
| |___ > <| | |_ | |_| |
|_____/_/\_\_|\__| \___/
11:40:26 zzn@zzn-macbookpro2 ❯ ~ ❯ d ❯ … ❯ haoshiyou-bot ❯ v2 ❯ demo-chatie-issue-954 ▶ master 1⇡ + ▶ $ ▶
@xinbenlv Thank you very much for providing the reproduce steps for this issue!
I'll look into it when I have time.
try cnpm
npm install will remove all files in puppeteer node_module, but in my environment it download the chrome zip only once.Make sure the local-chromium was exsit?issues1103
This issue should not be a problem anymore because, with the latest wechaty@0.20 version, we had separated the puppeteer related code to its own npm module: wechaty-puppet-puppeteer.
Please file a new issue if you have any problem with v0.20 or above.
When running
npm start
in haoshiyou-bot we encountered the following errorProvide Your Network Information
Run
npm run doctor
orwechaty run doctor
(for docker user), paste output here// wechaty run doctor show
// npm run doctor
Expected behavior
Expect it to run bot
Actual behavior
Failed to even show login QR code
Steps to reproduce the behavior (and fixes, if any)
Full Output Logs
Show Logs
### Paste the full output logs here with `WECHATY_LOG=silly` set ```shell $ ▶npm install puppeteer > puppeteer@0.12.0 install /Users/zzn/Documents/ws/haoshiyou-bot/node_modules/puppeteer > node install.js Downloading Chromium r508693 - 72.6 Mb [====================] 100% 0.0s Chromium downloaded to /Users/zzn/Documents/ws/haoshiyou-bot/node_modules/puppeteer/.local-chromium/mac-508693 + puppeteer@0.12.0 added 15 packages, removed 14 packages and updated 41 packages in 44.591s 12:36:41 zzn@zzn-macbookpro2 ❯ ~ ❯ d ❯ ws ❯ haoshiyou-bot ▶ master ▶ $ ▶npm start > haoshiyou-bot@1.0.1 start /Users/zzn/Documents/ws/haoshiyou-bot > docker run --env CLOUDINARY_SECRET=$CLOUDINARY_SECRET -ti --volume="$(pwd)":/bot --rm zixia/wechaty src/main.ts __ __ _ _ \ \ / /__ ___| |__ __ _| |_ _ _ \ \ /\ / / _ \/ __| '_ \ / _` | __| | | | \ V V / __/ (__| | | | (_| | |_| |_| | \_/\_/ \___|\___|_| |_|\__,_|\__|\__, | |___/ ____________________________________________________ https://www.chatie.io ____ _ _ / ___|___ _ __ _ __ ___ ___| |_(_)_ __ __ _ | | / _ \| '_ \| '_ \ / _ \/ __| __| | '_ \ / _` | | |__| (_) | | | | | | | __/ (__| |_| | | | | (_| | \____\___/|_| |_|_| |_|\___|\___|\__|_|_| |_|\__, | |___/ ____ _ _ ____ _ / ___| |__ __ _| |_| __ ) ___ | |_ ___ | | | '_ \ / _` | __| _ \ / _ \| __/ __| | |___| | | | (_| | |_| |_) | (_) | |_\__ \ \____|_| |_|\__,_|\__|____/ \___/ \__|___/ Starting Wechaty v0.11.40 with Node.js v8.8.1 ... Working directory: /bot Please make sure you had installed all the NPM modules which is depended by your bot script. Executing ts-node src/main.ts 01:52:13 INFO Wechaty v0.11.29 starting... 01:52:14 ERR PuppetWebBridge init() exception: AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install" 2017-11-04 01:52:14 DEBUG [error] - AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install" 01:52:14 ERR PuppetWeb initBridge() exception: Chromium revision is not downloaded. Run "npm install" 01:52:14 WARN PuppetWebBridge quit() page.close() exception: TypeError: Cannot read property 'close' of undefined 01:52:14 WARN PuppetWebBridge quit() browser.close() exception: TypeError: Cannot read property 'close' of undefined 2017-11-04 01:52:14 DEBUG [error] - AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install" 01:52:14 ERR PuppetWeb init() exception: AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install" 2017-11-04 01:52:14 DEBUG [error] - AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install" 01:52:14 WARN PuppetWeb quit() is called on a OFF puppet. return directly. 01:52:14 ERR Wechaty start() exception: Chromium revision is not downloaded. Run "npm install" 01:52:14 ERR Bot init() fail: AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install" 01:52:14 WARN Wechaty stop() without this.puppet ____ _ _ ____ ____ _____ ____ ___ ____ _____ | __ )| | | |/ ___| | _ \| ____| _ \ / _ \| _ \_ _| | _ \| | | | | _ | |_) | _| | |_) | | | | |_) || | | |_) | |_| | |_| | | _ <| |___| __/| |_| | _ < | | |____/ \___/ \____| |_| \_\_____|_| \___/|_| \_\|_| Press ENTER to continue ... ### 1. source code of src/main.ts import {Logger, LoggerConfig} from 'log4ts'; import {config, Wechaty, log} from 'wechaty'; /* tslint:disable:variable-name */ import {hotImport} from 'hot-import'; import ConsoleAppender from 'log4ts/build/appenders/ConsoleAppender'; import BasicLayout from 'log4ts/build/layouts/BasicLayout'; import {LogLevel} from 'log4ts/build/LogLevel'; const finis = require('finis'); function configLogger() { const appender = new ConsoleAppender(); const layout = new BasicLayout(); appender.setLayout(layout); const config = new LoggerConfig(appender); config.setLevel(LogLevel.DEBUG); Logger.setConfig(config); } const bot = Wechaty.instance({profile: config.default.DEFAULT_PROFILE}); async function main() { configLogger(); // const cronjobs = await hotImport(`cronjobs`); // cronjobs().setup(); // const logger = Logger.getLogger(`logout`); // Bind events bot.on('scan', 'listener/scan'); bot.on('logout', 'listener/logout'); bot.on('login', 'listener/login'); bot.on('friend', 'listener/friend'); bot.on('room-join', 'listener/room-join'); bot.on('room-leave', 'listener/room-leave'); bot.on('room-topic', 'listener/room-topic'); bot.on('message', 'listener/message'); bot.on('heartbeat', 'listener/heartbeat'); bot.on('error', 'listener/error'); await bot.start(); finis(async (code, signal) => { const exitMsg = `Wechaty exit ${code} because of ${signal} `; console.log(exitMsg); await bot.say(exitMsg); }); } main().catch(async (e) => { log.error('Bot', 'init() fail: %s', e); await bot.stop(); process.exit(-1); }); ### 2. directory structor of /bot total 18188 -rw-r--r-- 1 bot bot 2534 May 3 2017 Readme.md -rw-r--r-- 1 bot bot 1669 Oct 30 18:04 demo.wechaty.json -rw-r--r-- 1 bot bot 9807 Apr 22 2017 intro.md -rw-r--r-- 1 bot bot 18218830 Oct 30 18:04 log.json drwxr-xr-x 11 bot bot 374 Feb 12 2017 loopbacksdk -rw-r--r-- 1 bot bot 91 Mar 25 2017 msg.js.map drwxr-xr-x 156 bot bot 5304 Nov 4 2017 node_modules -rw-r--r-- 1 bot bot 102948 Nov 4 2017 package-lock.json -rw-r--r-- 1 bot bot 1609 Nov 4 2017 package.json -rw-r--r-- 1 bot bot 217646 Oct 30 15:21 potential-posting.json drwxr-xr-x 26 bot bot 884 Nov 4 2017 src drwxr-xr-x 4 bot bot 136 Apr 14 2017 tmp -rw-r--r-- 1 bot bot 142 Jan 17 2017 tsconfig.json -rw-r--r-- 1 bot bot 2585 Oct 30 02:47 tslint.json -rw-r--r-- 1 bot bot 40245 Feb 10 2017 yarn.lock ### 3. package.json { "dependencies": { "@purest/providers": "^1.0.0", "@types/express": "^4.0.34", "bluebird": "^3.4.7", "chromedriver": "^2.27.2", "cloudinary": "^1.6.0", "express": "^4.14.0", "finis": "0.0.3", "jsonfile": "^2.4.0", "log4ts": "^0.4.2", "puppet": "^1.0.0", "puppeteer": "^0.12.0", "purest": "^3.0.1", "qrcode-terminal": "^0.11.0", "request": "^2.79.0", "tslint-jsdoc-rules": "^0.1.2", "typescript": "^2.6.1", "uuid": "^3.0.1", "wechaty": "0.11.29" }, "scripts": { "start": "docker run --env CLOUDINARY_SECRET=$CLOUDINARY_SECRET -ti --volume=\"$(pwd)\":/bot --rm zixia/wechaty src/main.ts", "direct": "node src/main.js", "preinstall-chromedriver": "npm install", "install-chromedriver": "node node_modules/chromedriver/install.js", "pretest_e2e": "npm run install-chromedriver", "test_e2e": "node release/test/rune2e.js" }, "name": "haoshiyou-bot", "description": "[![Powered by Wechaty](https://img.shields.io/badge/Powered%20By-Wechaty-green.svg)](https://github.com/wechaty/wechaty)", "version": "1.0.1", "main": "main.js", "devDependencies": {}, "repository": { "type": "git", "url": "git+https://github.com/xinbenlv/haoshiyou-bot.git" }, "keywords": [ "haoshiyou", "haoshiyou.org", "chatbot", "wechaty", "wechat", "rent", "house", "roommate" ], "author": "Zainan Victor Zhou", "license": "MIT", "bugs": { "url": "https://github.com/xinbenlv/haoshiyou-bot/issues" }, "homepage": "https://github.com/xinbenlv/haoshiyou-bot#readme" } ### 4. directory structor inside /bot/node_modules @purest callsites error-ex graceful-fs json-schema-traverse p-locate puppeteer sockjs typedarray @types caseless es6-promise hosted-git-info json-stringify-safe p-map purest spdx-correct typescript agent-base chromedriver es6-promisify hot-import jsonfile parse-json qrcode-terminal spdx-expression-parse ultron array-union cloudinary escapeshellarg https-proxy-agent jsonify path-exists raven spdx-license-ids underscore.string array-uniq co express iconv-lite jsprim path-is-inside raw-body sprintf-js util-deprecate asn1 colors extract-zip inherits load-json-file path-parse read-pkg sshpk uuid async-limiter combined-stream extsprintf is-arrayish locate-path path-type read-pkg-up stack-trace validate-npm-package-license asynckit concat-stream fast-deep-equal is-builtin-module log4ts pend readable-stream state-switch verror aws4 cookie fast-json-stable-stringify is-path-cwd lsmod phantom request string_decoder watchdog bcrypt-pbkdf core-util-is faye-websocket is-path-in-cwd minimist pify resolve stringstream weak bindings dashdash fd-slicer is-path-inside nan pinkie retry-promise strip-bom wechaty bl del find-up is-typedarray node-uuid pinkie-promise rxjs symbol-observable win-spawn bluebird delayed-stream findup-sync isarray normalize-package-data process-nextick-args safe-buffer timed-out wordwrap body-parser diff finis isstream oauth-sign progress sax traverse ws brolog dnode forever-agent jodid25519 object-assign proxy-from-env semver tslint-jsdoc-rules xml2js builtin-modules dnode-protocol getpass jsbn optimist punycode shoe tunnel-agent xmlbuilder bytes ecc-jsbn globby json-schema p-limit puppet sister tweetnacl yauzl ### 5. wechaty doctor #### Wechaty Doctor 1. Wechaty version: 0.11.40 2. Linux x64 version 4.9.13-moby memory 1429/1998 MB 3. Docker: true 4. Node version: v8.8.1 5. Tcp IPC TEST: PASS ____ _ _ _ ___ ____ ____ _ _ _____ / ___| _ _| |__ _ __ ___ (_) |_ __ _ |_ _/ ___/ ___|| | | | ____| \___ \| | | | '_ \| '_ ` _ \| | __| / _` | | |\___ \___ \| | | | _| ___) | |_| | |_) | | | | | | | |_ | (_| | | | ___) |__) | |_| | |___ |____/ \__,_|_.__/|_| |_| |_|_|\__| \__,_| |___|____/____/ \___/|_____| _____________________________________________________________ ####### please paste all the above diagnose messages ####### Wechaty Issue https://github.com/chatie/wechaty/issues Press ENTER to continue ... __ __ _ _ \ \ / /__ ___| |__ __ _| |_ _ _ \ \ /\ / / _ \/ __| '_ \ / _` | __| | | | \ V V / __/ (__| | | | (_| | |_| |_| | \_/\_/ \___|\___|_| |_|\__,_|\__|\__, | |___/ ____________________________________________________ https://www.chatie.io _____ _ _ ____ ____ ____ | ____|_ _(_) |_ |___ \| ___| ___| | _| \ \/ / | __| __) |___ \___ \ | |___ > <| | |_ / __/ ___) |__) | |_____/_/\_\_|\__| |_____|____/____/ npm ERR! code ELIFECYCLE npm ERR! errno 255 npm ERR! haoshiyou-bot@1.0.1 start: `docker run --env CLOUDINARY_SECRET=$CLOUDINARY_SECRET -ti --volume="$(pwd)":/bot --rm zixia/wechaty src/main.ts` npm ERR! Exit status 255 npm ERR! npm ERR! Failed at the haoshiyou-bot@1.0.1 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/zzn/.npm/_logs/2017-11-04T19_36_58_816Z-debug.log ```