Gateway fails to download chat images: "download file failed" / "socket is read-write timeout"
Important:Please file the issue follow the template, or we won't be able to help you to solve the problem.
0. Report Issue Guide
-
Please run the following command and check whether the problem has been fixed:
rm -rf package-lock.json rm -rf node_modules npm install
Answer: sh: npm: 未找到命令
- Please search in FAQ List first, and make sure your problem has not been solved before.
Answer: 404 Page Not Found
- Please search in the issue first, and make sure your problem had not been reported before
Answer: Not found in open nor closed issues at least with keyword "download file failed" or "socket is read-write timeout"
1. Versions
What is your wechaty version?
Answer: Docker image wechaty/wechaty:0.65
Which puppet are you using for wechaty? (puppeteer/padlocal/service...)
Answer: Padlocal
What is your wechaty-puppet-XXX(padchat/puppeteer/) version?
Answer: How do we check that? We are running a customized version of dotnet-wechaty-getting-started project.
What is your node version? (run
node --version)
Answer: -bash: node: 未找到命令
What os are you using
Answer: CentOS
2. Describe the bug
Give a clear and concise description of what the bug is.
The puppet gateway (wechaty/wechaty container) pops an error message related to chat image download:
13:58:29 ERR PuppetServiceImpl grpcError() messageImage() rejection: [tid:98b2056a] [11013ms] download file failed:{"host":{"host":"180.111.199.125","port":80},"payload":"qwAAA4lOIHmtF8cAAAAAAAAAAAAAAAADcAAAAAN2ZXIAAAABMQAAAAl3ZWl4aW5udW0AAAAKMzM0MDIxNzcyMQAAAANzZXEAAAACMjEAAAANY2xpZW50dmVyc2lvbgAAAAk0MDI2NTQ3NTQAAAAMY2xpZW50b3N0eXBlAAAADGlQYWQgaU9TMTQuMgAAAAdhdXRoa2V5AAAAQjBAAgEBBDkwNwIBAQIBAQIExxeteQIDPRH9AgEAAgS5xm+0AgM9FLkCBCHIEg4CBFUSYHECBGGvaGgCBGuk3Z4EAAAAAAduZXR0eXBlAAAAATEAAAAMYWNjZXB0ZHVwYWNrAAAAATEAAAAGcnNhdmVyAAAAATEAAAAIcnNhdmFsdWUAAACAFlWYCNx6gqiXKjtfzLaleuwjqJMXB2niCcfEvIzxR2qMSNevYZFax9itUGrVOGfq4JZQWijWoanotshdQW2wbuTSHxQ6UOz78653GkOorhx5ria1xP/ibQ5EUUDE7IgBfjqZoX4nU9ANiLHuR8AgDdRSqJZHxq5tyvWTnGugH6gAAAAIZmlsZXR5cGUAAAABMgAAAAp3eGNoYXR0eXBlAAAAATAAAAAGZmlsZWlkAAABDjMwODE4NDAyMDEwMDA0NzgzMDc2MDIwMTAwMDIwNDYwOWI0ZGNmMDIwMzJmNTY1ZTAyMDRiMmViY2U4YzAyMDQ2MTYwNGU3OTA0NTE3Nzc4NzU3MDZjNmY2MTY0NWYzMjMzMzQzNTM2MzkzMTM4MzgzNTMwNDA2MzY4NjE3NDcyNmY2ZjZkMzMzMjMzMzE1ZjMxMzYzMzMzMzczMDMxMzQzOTM2NWY2MTMzNjU2MjYzNjMzMzYzMmQzODM1Mzk2NDJkMzQ2NTM2MzQyZDM5NjI2MTYzMmQ2NjM4NjM2NTMyMzc2MjM5NjUzODYxNjEwMjA0MDEyNTBhMDIwMjAxMDAwNDA1MDA0YzU0YTIwMAAAAAtsYXN0cmV0Y29kZQAAAAEwAAAABWlwc2VxAAAAATAAAAANY2xpLXF1aWMtZmxhZwAAAAEwAAAACXd4bXNnZmxhZwAAAAAAAAALd3hhdXRvc3RhcnQAAAABMAAAAA1kb3ducGljZm9ybWF0AAAAATEAAAAGb2Zmc2V0AAAAATAAAAALbGFyZ2VzdmlkZW8AAAABMAAAAApzb3VyY2VmbGFnAAAAATA=","unpackaeskey":"VinBcMGZdIvoFZmFyFr0OA=="}, received null response
It is followed by (though not sure if the two are related):
(node:40) UnhandledPromiseRejectionWarning: VError: [tid:98b2056a] Fail to send socket to:"180.111.199.125:80", data:ab000003894e2079ad17c700000000000000000000000003700000000376657200000001310000000977656978696e6e756d0000000a33333430323137373231000000037365710000000232310000000d636c69656e7476657273696f6e000000093430323635343735340000000c636c69656e746f73747970650000000c6950616420694f5331342e3200000007617574686b6579000000423040020101043930370201010201010204c717ad7902033d11fd0201000204b9c66fb402033d14b9020421c8120e020455126071020461af686802046ba4dd9e0400000000076e65747479706500000001310000000c61636365707464757061636b00000001310000000672736176657200000001310000000872736176616c75650000008016559808dc7a82a8972a3b5fccb6a57aec23a893170769e209c7c4bc8cf1476a8c48d7af61915ac7d8ad506ad53867eae096505a28d6a1a9e8b6c85d416db06ee4d21f143a50ecfbf3ae771a43a8ae1c79ae26b5c4ffe26d0e445140c4ec88017e3a99a17e2753d00d88b1ee47c0200dd452a89647c6ae6dcaf5939c6ba01fa80000000866696c657479706500000001320000000a7778636861747479706500000001300000000666696c6569640000010e3330383138343032303130303034373833303736303230313030303230343630396234646366303230333266353635653032303462326562636538633032303436313630346537393034353137373738373537303663366636313634356633323333333433353336333933313338333833353330343036333638363137343732366636663664333333323333333135663331333633333333333733303331333433393336356636313333363536323633363333333633326433383335333936343264333436353336333432643339363236313633326436363338363336353332333736323339363533383631363130323034303132353061303230323031303030343035303034633534613230300000000b6c617374726574636f6465000000013000000005697073657100000001300000000d636c692d717569632d666c616700000001300000000977786d7367666c6167000000000000000b77786175746f737461727400000001300000000d646f776e706963666f726d61740000000131000000066f666673657400000001300000000b6c6172676573766964656f00000001300000000a736f75726365666c61670000000130, after max retry:5: [SocketClient] socket is read-write timeout
Once this happens, any subsequent chat images will all fail to download through the gateway, showing the same error message. Thus, the chatbot is not able to receive any images from the other participants.
However, this error does not stop the chatbot from receiving normal text messages, so other kinds of chatting activity between the bot and other participants remain unaffected.
3. To Reproduce
This part is very important: if you can not provide any reproduce steps, then the problem will be very hard to be recognized.
How to create a Minimal, Reproducible Example
Steps to reproduce the behavior:
- Start docker container with wechaty/wechaty:0.65 (may affect other versions too, I recall observing same kind of behavior with the original 0.56)
- Use QR code to login. Chat normally. Try sending pictures.
- Observe the
docker logsfor the gateway container to catch this error. It may not come immediately, or not every time when you send an image, so you might need to be patient.
4. Expected behavior
Give a clear and concise description of what you expected to happen.
The ability to download and process the images normally each time as per bot's programming.
5. Actual behavior
If applicable, add screenshots to help explain your problem. But do not paste log screenshots here.
Unable to process the images and throwing this error, also locking up for any subsequent chat images.
6. Full Output Logs
Set env
WECHATY_LOG=sillyin order to set log level to silly, then we can get the full log (If you dosen't set log env, log level is info as default, we cannot get the full log)
We need full log instead of log screenshot or log fragments!
Show Logs
$ WECHATY_LOG=silly node yourbot.js
-> PASTE YOUR FULL(DO NOT ONLY PROVIDE FRAGMENTS) LOG MESSAGES HERE
[logs.txt](https://github.com/wechaty/wechaty/files/7312025/logs.txt)
7. Additional context
Add any other context about the problem here.
The only way to fix the situation after "lockdown" is to restart both the gateway image and the app itself. If restart either one of them is not enough.
Now tried updating the gateway image to wechaty:latest, but this exact same behavior still happens.