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

给bot发完图片。发送/finish 后到第二步 [2/4] Converting images...时bot自动退出 #13

Open
Declarcall opened this issue Feb 25, 2019 · 3 comments

Comments

@Declarcall
Copy link

@Declarcall Declarcall commented Feb 25, 2019

在自己vps上部署telegram-stickerimage-bot,给bot发完图片。发送/finish 后到第二步 [2/4] Converting images...时bot自动退出。

系统: CentOS 7 x64

错误日志:

[root@Declarcall telegram-stickerimage-bot]# npm start

> telegram-stickerimage-bot@0.0.1 start /root/telegram-stickerimage-bot
> node bot.js

[INTERNAL] [INFO] Loaded language strings: en
[INTERNAL] [INFO] Loaded language strings: de
[INTERNAL] [INFO] Loaded language strings: zh-hans
[INTERNAL] [INFO] Loaded language strings: zh-hant
[123456789] [INFO] Started a new pack task.
[123456789] [INFO] Started direct image task.
[123456789] [INFO] Convert: convert ./storage/123456789/src/file_32.webp /root/telegram-stickerimage-bot/storage/123456789/img/file_32.png
[123456789] [INFO] Cleaning up...
[123456789] [INFO] Started a new pack task.
[123456789] [INFO] Starting pack task...
[123456789] [INFO] Downloading files...
[123456789] [INFO] File CAADBQADnAAD-MbFCh9e9To998caAg saved to disk.
[123456789] [INFO] Converting images...
[123456789] [INFO] Convert: convert ./storage/123456789/src/file_35.webp -flatten /root/telegram-stickerimage-bot/storage/123456789/img/file_35.jpg
/root/telegram-stickerimage-bot/bot.js:98
            .replace('%errbody%', err.response.body));
                                              ^

TypeError: Cannot read property 'body' of undefined
    at errMsgHandler (/root/telegram-stickerimage-bot/bot.js:98:47)
    at /root/telegram-stickerimage-bot/bot.js:151:17
    at /root/telegram-stickerimage-bot/node_modules/async/dist/async.js:3679:13
    at /root/telegram-stickerimage-bot/node_modules/async/dist/async.js:486:20
    at iterateeCallback (/root/telegram-stickerimage-bot/node_modules/async/dist/async.js:865:21)
    at /root/telegram-stickerimage-bot/node_modules/async/dist/async.js:847:20
    at /root/telegram-stickerimage-bot/node_modules/async/dist/async.js:3676:17
    at /root/telegram-stickerimage-bot/node_modules/async/dist/async.js:339:31
    at /root/telegram-stickerimage-bot/bot.js:140:21
    at /root/telegram-stickerimage-bot/bot.js:264:9
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! telegram-stickerimage-bot@0.0.1 start: `node bot.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the telegram-stickerimage-bot@0.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!     /root/.npm/_logs/2019-02-25T10_23_57_968Z-debug.log
[root@Declarcall telegram-stickerimage-bot]# cat /root/.npm/_logs/2019-02-25T10_23_57_968Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/root/node-v8.1.1-linux-x64/bin/node',
1 verbose cli   '/root/node-v8.1.1-linux-x64/bin/npm',
1 verbose cli   'start' ]
2 info using npm@5.0.3
3 info using node@v8.1.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle telegram-stickerimage-bot@0.0.1~prestart: telegram-stickerimage-bot@0.0.1
6 silly lifecycle telegram-stickerimage-bot@0.0.1~prestart: no script for prestart, continuing
7 info lifecycle telegram-stickerimage-bot@0.0.1~start: telegram-stickerimage-bot@0.0.1
8 verbose lifecycle telegram-stickerimage-bot@0.0.1~start: unsafe-perm in lifecycle true
9 verbose lifecycle telegram-stickerimage-bot@0.0.1~start: PATH: /root/node-v8.1.1-linux-x64/lib/node_modules/npm/bin/node-gyp-bin:/root/telegram-stickerimage-bot/node_modules/.bin:/root/node-v8.1.1-linux-x64/bin:/root/node-v8.1.1-linux-x64/bin:/root/node-v8.1.1-linux-x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
10 verbose lifecycle telegram-stickerimage-bot@0.0.1~start: CWD: /root/telegram-stickerimage-bot
11 silly lifecycle telegram-stickerimage-bot@0.0.1~start: Args: [ '-c', 'node bot.js' ]
12 silly lifecycle telegram-stickerimage-bot@0.0.1~start: Returned: code: 1  signal: null
13 info lifecycle telegram-stickerimage-bot@0.0.1~start: Failed to exec start script
14 verbose stack Error: telegram-stickerimage-bot@0.0.1 start: `node bot.js`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/root/node-v8.1.1-linux-x64/lib/node_modules/npm/lib/utils/lifecycle.js:283:16)
14 verbose stack     at emitTwo (events.js:125:13)
14 verbose stack     at EventEmitter.emit (events.js:213:7)
14 verbose stack     at ChildProcess.<anonymous> (/root/node-v8.1.1-linux-x64/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:125:13)
14 verbose stack     at ChildProcess.emit (events.js:213:7)
14 verbose stack     at maybeClose (internal/child_process.js:897:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
15 verbose pkgid telegram-stickerimage-bot@0.0.1
16 verbose cwd /root/telegram-stickerimage-bot
17 verbose Linux 3.10.0-957.1.3.el7.x86_64
18 verbose argv "/root/node-v8.1.1-linux-x64/bin/node" "/root/node-v8.1.1-linux-x64/bin/npm" "start"
19 verbose node v8.1.1
20 verbose npm  v5.0.3
21 error code ELIFECYCLE
22 error errno 1
23 error telegram-stickerimage-bot@0.0.1 start: `node bot.js`
23 error Exit status 1
24 error Failed at the telegram-stickerimage-bot@0.0.1 start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
@phoenixlzx

This comment has been minimized.

Copy link
Owner

@phoenixlzx phoenixlzx commented Feb 25, 2019

应该是 imagemagick 没有 webp 支持,转换的时候出错了。

@Declarcall

This comment has been minimized.

Copy link
Author

@Declarcall Declarcall commented Feb 25, 2019

先安装webp

yum install libwebp -y

卸载系统自带的ImageMagick

yum remove ImageMagick -y

下载ImageMagick源码包,编译

wget -c https://www.imagemagick.org/download/releases/ImageMagick-6.9.10-28.tar.gz 
tar -zxf ImageMagick-6.9.10-28.tar.gz && cd ImageMagick-6.9.10-28
./configure --with-webp
make && make install
identify -list format | grep -i 'webp'
     WEBP* rw-   WebP Image Format (libwebp 0.3.0 [020E])

搞定!

@Declarcall

This comment has been minimized.

Copy link
Author

@Declarcall Declarcall commented Feb 25, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.