RocketChat / hubot-rocketchat

Rocket.Chat Hubot adapter
MIT License
578 stars 227 forks source link

Getting Error on docker run... #298

Open greldinard opened 6 years ago

greldinard commented 6 years ago

This appears, after executing docker run on the latest image with the same parameters that we used for a long time:

[Tue Aug 28 2018 09:54:07 GMT+0000 (UTC)] INFO Starting Rocketchat adapter version 1.0.11...
[Tue Aug 28 2018 09:54:07 GMT+0000 (UTC)] INFO Once connected to rooms I will respond to the name: bot
[Tue Aug 28 2018 09:54:07 GMT+0000 (UTC)] INFO Connecting To: 192.168.50.60:80
[Tue Aug 28 2018 09:54:07 GMT+0000 (UTC)] INFO Successfully connected!
[Tue Aug 28 2018 09:54:07 GMT+0000 (UTC)] INFO
[Tue Aug 28 2018 09:54:07 GMT+0000 (UTC)] INFO Logging In
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO Successfully Logged In
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO rid:  []
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO All rooms joined.
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO Preparing Meteor Subscriptions..
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO Subscribing to Room: __my_messages__
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO Successfully subscribed to messages
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO Setting up reactive message list...
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] WARNING Loading scripts from hubot-scripts.json is deprecated and will be removed in 3.0 (https://github.com/github/hubot-scripts/issues/1113) in favor of packages for each script.

Your hubot-scripts.json is empty, so you just need to remove it.
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] ERROR Unable to load /home/hubot/node_modules/hubot-rss-reader/scripts/hubot-rss-reader: SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (/home/hubot/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/hubot/node_modules/hubot-rss-reader/libs/rss-checker.coffee:19:14)
    at Object.<anonymous> (/home/hubot/node_modules/hubot-rss-reader/libs/rss-checker.coffee:7:1)
    at Module._compile (module.js:409:26)
    at Object.loadFile (/home/hubot/node_modules/coffee-script/lib/coffee-script/register.js:16:19)
    at Module.load (/home/hubot/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/hubot/node_modules/hubot-rss-reader/scripts/hubot-rss-reader.coffee:20:14)
    at Object.<anonymous> (/home/hubot/node_modules/hubot-rss-reader/scripts/hubot-rss-reader.coffee:14:1)
    at Module._compile (module.js:409:26)
    at Object.loadFile (/home/hubot/node_modules/coffee-script/lib/coffee-script/register.js:16:19)
    at Module.load (/home/hubot/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Robot.loadFile (/home/hubot/node_modules/hubot/src/robot.coffee:355:18)
    at /home/hubot/node_modules/hubot-rss-reader/index.coffee:12:17
    at FSReqWrap.cb [as oncomplete] (fs.js:212:19)

It seems that there is some syntax error. I assume it is due to the use of NodeJS 4.8.3. A more current version should be used - so this error will not occure. I changed it in my local Dockerfile. But then receiving another error stating:

make: Leaving directory '/home/hubot/node_modules/iconv/build'
+ hubot-pugme@0.1.1
+ hubot-help@1.0.1
+ hubot-rss-reader@0.8.3
added 89 packages, removed 154 packages, updated 2 packages and moved 2 packages in 61.881s
up to date in 0.972s
body-parser deprecated undefined extended: provide extended option node_modules/hubot/src/robot.js:445:21
[Mon Aug 27 2018 13:48:04 GMT+0000 (UTC)] ERROR Cannot load adapter rocketchat - Error: Cannot find module 'hubot-rocketchat'
sadsammy commented 6 years ago

Can confirm. I'm running into the same issue. Is there any know workaround?

greldinard commented 6 years ago

Start experimenting on native usage of it (docker-less). Not what I want but...

adolfombarros commented 3 years ago

This appears, after executing docker run on the latest image with the same parameters that we used for a long time:

[Tue Aug 28 2018 09:54:07 GMT+0000 (UTC)] INFO Starting Rocketchat adapter version 1.0.11...
[Tue Aug 28 2018 09:54:07 GMT+0000 (UTC)] INFO Once connected to rooms I will respond to the name: bot
[Tue Aug 28 2018 09:54:07 GMT+0000 (UTC)] INFO Connecting To: 192.168.50.60:80
[Tue Aug 28 2018 09:54:07 GMT+0000 (UTC)] INFO Successfully connected!
[Tue Aug 28 2018 09:54:07 GMT+0000 (UTC)] INFO
[Tue Aug 28 2018 09:54:07 GMT+0000 (UTC)] INFO Logging In
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO Successfully Logged In
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO rid:  []
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO All rooms joined.
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO Preparing Meteor Subscriptions..
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO Subscribing to Room: __my_messages__
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO Successfully subscribed to messages
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] INFO Setting up reactive message list...
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] WARNING Loading scripts from hubot-scripts.json is deprecated and will be removed in 3.0 (https://github.com/github/hubot-scripts/issues/1113) in favor of packages for each script.

Your hubot-scripts.json is empty, so you just need to remove it.
[Tue Aug 28 2018 09:54:11 GMT+0000 (UTC)] ERROR Unable to load /home/hubot/node_modules/hubot-rss-reader/scripts/hubot-rss-reader: SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (/home/hubot/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/hubot/node_modules/hubot-rss-reader/libs/rss-checker.coffee:19:14)
    at Object.<anonymous> (/home/hubot/node_modules/hubot-rss-reader/libs/rss-checker.coffee:7:1)
    at Module._compile (module.js:409:26)
    at Object.loadFile (/home/hubot/node_modules/coffee-script/lib/coffee-script/register.js:16:19)
    at Module.load (/home/hubot/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/hubot/node_modules/hubot-rss-reader/scripts/hubot-rss-reader.coffee:20:14)
    at Object.<anonymous> (/home/hubot/node_modules/hubot-rss-reader/scripts/hubot-rss-reader.coffee:14:1)
    at Module._compile (module.js:409:26)
    at Object.loadFile (/home/hubot/node_modules/coffee-script/lib/coffee-script/register.js:16:19)
    at Module.load (/home/hubot/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Robot.loadFile (/home/hubot/node_modules/hubot/src/robot.coffee:355:18)
    at /home/hubot/node_modules/hubot-rss-reader/index.coffee:12:17
    at FSReqWrap.cb [as oncomplete] (fs.js:212:19)

It seems that there is some syntax error. I assume it is due to the use of NodeJS 4.8.3. A more current version should be used - so this error will not occure. I changed it in my local Dockerfile. But then receiving another error stating:

make: Leaving directory '/home/hubot/node_modules/iconv/build'
+ hubot-pugme@0.1.1
+ hubot-help@1.0.1
+ hubot-rss-reader@0.8.3
added 89 packages, removed 154 packages, updated 2 packages and moved 2 packages in 61.881s
up to date in 0.972s
body-parser deprecated undefined extended: provide extended option node_modules/hubot/src/robot.js:445:21
[Mon Aug 27 2018 13:48:04 GMT+0000 (UTC)] ERROR Cannot load adapter rocketchat - Error: Cannot find module 'hubot-rocketchat'

I got the same issue after upgrade rocketchat to version 3.8.0. Before the upgrade, the hubot had work great !

swvv commented 2 years ago

same