azukiapp / azk

azk is a lightweight open source development environment orchestration tool. Instantly & safely run any environment on your local machine.
http://azk.io
Apache License 2.0
899 stars 63 forks source link

Can´t complete getting started without adding not mentioned redis command #603

Closed vnavarro closed 8 years ago

vnavarro commented 8 years ago

Description of the problem: Redis command is missing bind instruction to work during getting started docs, without it the sample doesn´t work.

OS: OS X Yosemite 10.10.5 azk version: 0.16.3

Environment details (VirtualBox, DigitalOcean, etc.): Virtual Box 5.0.12 r104815

Steps to Reproduce:

  1. Follow docs.azk.io to step 2.4
  2. Finish this step until the azk restart azkdemo command

Actual Results:

azk: ↑ starting `azkdemo` system, 2 new instances...
azk: ↑ starting `redis` system, 1 new instances...
azk: ✓ checking `azukiapp/node:0.12` image...
azk: ◴ waiting for `redis` system to start, trying connection to port 6379/tcp...
azk: ⎘ syncing files for `azkdemo` system...
azk: ◴ waiting for `azkdemo` system to start, trying connection to port http/tcp...
azk: Run system `azkdemo` return: (0), for command: ["npm","start"]:
azk: [timeout] `azk` has timed out on `azkdemo` system.
azk: [timeout] Failure to reach port `32776` from `http://azkdemo.dev.azk.io` after 100000 milliseconds.
azk: [timeout] Make sure the start command binds `port` to the `0.0.0.0` interface, not only to the `localhost` interface.
azk: [timeout] You might want to edit your `Azkfile.js` in order to increase the maximum timeout.

azk: Look for azk start troubleshooting documentation for more info at: http://bit.ly/azk_start_troubleshooting

azk: Due to the above error azk will stop all instances already running.

azk: ↓ stopping `azkdemo` system, 1 instances...

Expected Results: Service up and running

Additional info: Adding command: ["redis-server", "--bind 0.0.0.0"] to the Azkfile.js in the redis section solves the problem. We probably should add this command in the redis configurations at the docs.

nuxlli commented 8 years ago

@vnavarro, thanks for reporting.

However, a solution for that is already merged into master: https://github.com/azukiapp/azk/pull/602.

This should be available on the next release (azk v0.17.0).

vnavarro commented 8 years ago

@nuxlli, glad to help :smile:

I checked the merge #602 and it is still missing the "--bind 0.0.0.0" param for redis, without the bind the demo wasn´t working :cry:

nuxlli commented 8 years ago

@vnavarro, I think I went ahead and told you about another problem.

Being specific on PR #602

In the example published in azk docs, we're using https://hub.docker.com/_/redis.

We did some changes on azk v0.16.0 to properly handle Docker images which have an ENTRYPOINT, but we let a case uncovered: when a property command is declared as a String (not an Array) in your Azkfile.js, this will be incorrectly delivered to the ENTRYPOINT script, causing "command not found" or errors in parameters.

Back to what you reported

Notice that the error message that you received was on azkdemo system, not redis (line 7). In the line 4, the message says azk was waiting for redis and then azk was able to connect to redis. Hence, redis system was properly exposed.

It's more likely that another error has occurred in the azkdemo system, causing it to fail the startup process (in the azk v0.17.0 the statup process will be more verbose -- when called with -vv flag -- helping to debug cases like yours).

This error can be caused due to a missing dependency redis from npm, stated in the session that you pointed: http://docs.azk.io/en/getting-started/database.html#configuring-application. Notice by this line that if all systems are started using azk start or azk restart and the dependency isn't installed, the application will fail when running the require method.

Anyway, I've made some tests with the Redis image and it's ok. By default, the bind is done to all interfaces (it's the default behavior when compiling Redis from source).

If after that the error persists and it's actually a bind issue, please send me a gist with your Azkfile.js and I'll try to reproduce it here.

vnavarro commented 8 years ago

@nuxlli great! I´m new to azk and docker so I´m still getting the grasp here. I´ll keep an eye in the new version and check on this issue again. Thx :smile:

gullitmiranda commented 8 years ago

@vnavarro has worked for you?