Closed abid-khan closed 7 years ago
hi, the log output tells exactly what docker command failed. can you please try to run those commands in sequence in your terminal window: (in the directory where your chatbot resides):
docker network create -d bridge testmybot_network docker build -t testmybot -f ./node_modules/testmybot/Dockerfile.testmybot . docker run --rm -e NODE_TLS_REJECT_UNAUTHORIZED=0 --name testmybot --network testmybot_network --network-alias testmybot testmybot
it should tell you why docker refuses to start.
Once I fire above commands in sequence, last one give me below error, `abidkhan$ docker run --rm -e NODE_TLS_REJECT_UNAUTHORIZED=0 --name testmybot --network testmybot_network --network-alias testmybot testmybot npm info it worked if it ends with ok npm info using npm@3.10.10 npm info using node@v6.10.0 npm info lifecycle simplebot@1.0.0~prestart_testmybot: simplebot@1.0.0 npm info lifecycle simplebot@1.0.0~start_testmybot: simplebot@1.0.0
simplebot@1.0.0 start_testmybot /usr/src/app page_token=*verify_token= node app.js
Initializing Botkit v0.5.2 info: No persistent storage method specified! Data may be lost when process shuts down. debug: Setting up a handler for spawned debug: Setting up a handler for heard_trigger debug: Setting up a handler for command_triggered debug: Setting up a handler for remote_command_end debug: Setting up a handler for facebook_optin debug: Setting up a handler for message_received debug: Setting up a handler for message_received debug: Setting up a handler for undefined debug: Setting up a handler for undefined info: Starting webserver on port 5000 info: ** Serving webhook endpoints for Messenger Platform at: http://0.0.0.0:5000/facebook/receive This bot is online!!! debug: Successfully subscribed to Facebook events: {"success":true} npm info lifecycle simplebot@1.0.0~poststart_testmybot: simplebot@1.0.0 npm info ok `
I am also getting below error
`INFO: docker run testmybot exited with code 1 ERROR: hears Error: Error: connect ECONNREFUSED 127.0.0.1:46199 Unhandled rejection Error: says error: Error: connect ECONNREFUSED 127.0.0.1:46199 at bot.says.then.catch (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/spec/testmybot.spec.js:28:19) at tryCatcher (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromise0 (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/promise.js:689:18) at Async._drainQueue (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/async.js:133:16) at Async._drainQueues (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/async.js:143:10) at Immediate.Async.drainQueues (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/async.js:17:14) at runCallback (timers.js:649:20) at tryOnImmediate (timers.js:622:5) at processImmediate [as _immediateCallback] (timers.js:594:5)
`
Please note that I am using mac machine.
It looks like ip and port issue. Could you please help on this.
With docker-machine, the docker VMs are actually running within another virtual machine. The docker processes cannot bind to the IP address 127.0.0.1. I experienced this issue myself when I tried to run it on an old Windows 7 laptop.
Please try this: run "docker-machine ip default" to get the IP adress which is assigned to your docker containers. For me, this is 192.168.99.100.
Then add the setting
"testendpoint": "http://192.168.99.100:46199",
to the "testmybot.json" file in your project directory. The file should look something like this:
{
"testendpoint": "http://192.168.99.100:46199",
"docker": {
"container": {
"testmybot-fbmock": {
"env": {
"TESTMYBOT_FACEBOOK_WEBHOOKPORT": 5000,
"TESTMYBOT_FACEBOOK_WEBHOOKPATH": "webhook"
}
}
}
}
}
I hav done what you have suggested, however still getting same issue.
` npm test
simplebot@1.0.0 test /Users/abidkhan/Desktop/Projects/node_practice/simplebot jasmine --trace-warnings
Started INFO: Running Docker Command: docker stop testmybot INFO: Running Docker Command: docker stop testmybot-fbmock INFO: docker stop testmybot-fbmock exited with code 1 INFO: docker stop testmybot exited with code 1 INFO: docker network rm exited with code 1 INFO: Running Docker Command: docker network create -d bridge testmybot_network INFO: docker network create exited with code 0 INFO: Running Docker Command: docker build -t testmybot -f ./node_modules/testmybot/Dockerfile.testmybot . INFO: Running Docker Command: docker build -t testmybot-fbmock -f ./node_modules/testmybot-fbmock/Dockerfile ./node_modules/testmybot-fbmock/ INFO: docker build testmybot-fbmock exited with code 0 INFO: docker build testmybot exited with code 0 INFO: Running Docker Command: docker run -d --rm -e NODE_TLS_REJECT_UNAUTHORIZED=0 --name testmybot --network testmybot_network --network-alias testmybot testmybot INFO: Running Docker Command: docker run -d --rm -p 46199:46199 -e TESTMYBOT_FACEBOOK_PUBLISHPORT=46199 -e TESTMYBOT_FACEBOOK_PAGEID= -e TESTMYBOT_FACEBOOK_USERPROFILEIDDEFAULT= -e TESTMYBOT_FACEBOOK_USERPROFILELOCALE=en_US -e TESTMYBOT_FACEBOOK_SEQNOSTART= -e TESTMYBOT_FACEBOOK_SENDDELIVERY=true -e TESTMYBOT_FACEBOOK_WEBHOOKURL= -e TESTMYBOT_FACEBOOK_WEBHOOKPORT=5000 -e TESTMYBOT_FACEBOOK_WEBHOOKPATH=webhook -e TESTMYBOT_FACEBOOK_WEBHOOKHOST=testmybot -e TESTMYBOT_FACEBOOK_WEBHOOKPROTOCOL=http --name testmybot-fbmock --network testmybot_network --network-alias graph.facebook.com testmybot-fbmock INFO: docker run testmybot exited with code 1 Unhandled rejection docker run testmybot returned error code 1
INFO: docker run testmybot-fbmock exited with code 1 ERROR: hears Error: Error: connect ECONNREFUSED 192.168.99.100:46199 Unhandled rejection Error: says error: Error: connect ECONNREFUSED 192.168.99.100:46199 at bot.says.then.catch (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/spec/testmybot.spec.js:28:19) at tryCatcher (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromise0 (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/promise.js:689:18) at Async._drainQueue (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/async.js:133:16) at Async._drainQueues (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/async.js:143:10) at Immediate.Async.drainQueues (/Users/abidkhan/Desktop/Projects/node_practice/simplebot/node_modules/bluebird/js/release/async.js:17:14) at runCallback (timers.js:649:20) at tryOnImmediate (timers.js:622:5) at processImmediate [as _immediateCallback] (timers.js:594:5)
INFO: Running Docker Command: docker stop testmybot INFO: Running Docker Command: docker stop testmybot-fbmock INFO: docker stop testmybot exited with code 1 Unhandled rejection docker stop testmybot returned error code 1
INFO: docker stop testmybot-fbmock exited with code 1 `
OK, for some reason, your docker container doesn't start. First of all, please update to the latest version - I just published the current NPM packages.
Afterwards, please run these commands in line - the last one should fail and you will see why.
docker network create -d bridge testmybot_network docker build -t testmybot-fbmock -f ./node_modules/testmybot-fbmock/Dockerfile ./node_modules/testmybot-fbmock/ docker run --rm -p 46199:46199 -e TESTMYBOT_FACEBOOK_PUBLISHPORT=46199 -e TESTMYBOT_FACEBOOK_PAGEID= -e TESTMYBOT_FACEBOOK_USERPROFILEIDDEFAULT= -e TESTMYBOT_FACEBOOK_USERPROFILELOCALE=en_US -e TESTMYBOT_FACEBOOK_SEQNOSTART= -e TESTMYBOT_FACEBOOK_SENDDELIVERY=true -e TESTMYBOT_FACEBOOK_WEBHOOKURL= -e TESTMYBOT_FACEBOOK_WEBHOOKPORT=5000 -e TESTMYBOT_FACEBOOK_WEBHOOKPATH=webhook -e TESTMYBOT_FACEBOOK_WEBHOOKHOST=testmybot -e TESTMYBOT_FACEBOOK_WEBHOOKPROTOCOL=http --name testmybot-fbmock --network testmybot_network --network-alias graph.facebook.com testmybot-fbmock
I think i found the problem. Please wait for next npm package!
Should be solved now. Please update NPM packages!
I am getting below error. May be we are using -d --rm which convicts with each other.
./node_modules/.bin/jasmine Started INFO: Running Docker Command: docker stop testmybot INFO: Running Docker Command: docker stop testmybot-fbmock INFO: docker stop testmybot exited with code 0 INFO: docker stop testmybot-fbmock exited with code 0 INFO: docker network rm exited with code 0 INFO: Running Docker Command: docker network create -d bridge testmybot_network INFO: docker network create exited with code 0 INFO: Running Docker Command: docker build -t testmybot -f ./node_modules/testmybot/Dockerfile.testmybot . INFO: Running Docker Command: docker build -t testmybot-fbmock -f ./node_modules/testmybot-fbmock/Dockerfile ./node_modules/testmybot-fbmock/ INFO: docker build testmybot-fbmock exited with code 0 INFO: docker build testmybot exited with code 0 INFO: Running Docker Command: docker run -d --rm -e NODE_TLS_REJECT_UNAUTHORIZED=0 --name testmybot --network testmybot_network --network-alias testmybot testmybot INFO: Running Docker Command: docker run -d --rm -p 46199:46199 -e TESTMYBOT_FACEBOOK_PUBLISHPORT=46199 -e TESTMYBOT_FACEBOOK_PAGEID= -e TESTMYBOT_FACEBOOK_USERPROFILEIDDEFAULT= -e TESTMYBOT_FACEBOOK_USERPROFILELOCALE=en_US -e TESTMYBOT_FACEBOOK_SEQNOSTART= -e TESTMYBOT_FACEBOOK_SENDDELIVERY=true -e TESTMYBOT_FACEBOOK_WEBHOOKURL= -e TESTMYBOT_FACEBOOK_WEBHOOKPORT=3000 -e TESTMYBOT_FACEBOOK_WEBHOOKPATH=facebook/receive -e TESTMYBOT_FACEBOOK_WEBHOOKHOST=testmybot -e TESTMYBOT_FACEBOOK_WEBHOOKPROTOCOL=http --name testmybot-fbmock --network testmybot_network --network-alias graph.facebook.com testmybot-fbmock INFO: docker run testmybot exited with code 1 INFO: docker run testmybot-fbmock exited with code 1 Unhandled rejection docker run testmybot returned error code 1