Reaction: Current docker-compose file doesn't start

Created on 16 Jan 2018  路  20Comments  路  Source: reactioncommerce/reaction

Expected behavior

Running docker-compose up . should start the reaction and mongo images w/o issue

Actual behavior

Receive a flurry of errors like this:

reaction_1  | 02:41:03.282Z  WARN Reaction: Error while importing to Packages: Updating the path 'layout' would create a conflict at 'layout'
reaction_1  | 02:41:03.282Z  WARN Reaction: Error while importing to Packages: Updating the path 'layout' would create a conflict at 'layout'
reaction_1  | 02:41:03.282Z  WARN Reaction: Error while importing to Packages: Updating the path 'layout' would create a conflict at 'layout'
reaction_1  | 02:41:03.282Z  WARN Reaction: Error while importing to Packages: Updating the path 'layout' would create a conflict at 'layout'
reaction_1  | 02:41:03.282Z  WARN Reaction: Error while importing to Packages: Updating the path 'layout' would create a conflict at 'layout'
reaction_1  | 02:41:03.282Z  WARN Reaction: Error while importing to Packages: Updating the path 'layout' would create a conflict at 'layout'
reaction_1  | 02:41:03.283Z  WARN Reaction: Error while importing to Packages: Updating the path 'settings' would create a conflict at 'settings'

App starts but clicking around yields nothing. Can't click to PDP, etc.

Steps to reproduce the behavior

In the root of your reaction directory type docker-compose up .

Versions

Node: 8.9.1
NPM: 5.5.1
Meteor Node: 8.9.3
Meteor NPM: 5.5.1
Reaction CLI: 0.24.2
Reaction: 1.6.3
Reaction branch: master
Docker: 17.12.0-ce
bug verified reproducible

Most helpful comment

That's only because I removed the --bind_ip_all flag from the mongod command in my 3.4 example. That's required in 3.6 and was already there in the example from our repo.

3.4 can be simply this:

mongo:
  image: mongo:3.4

3.6 requires the additional flag (see docs)

mongo:
  image: mongo:3.6
  command: mongod --bind_ip_all

Neither require the --storageEngine=wiredTiger anymore because that has been the default since 3.2. We just haven't removed it from the example yet because it doesn't cause any issues.

Anyway, the file as-is on the master branch still works fine for me.

reaction:
  image: reactioncommerce/reaction:latest
  links:
    - mongo
  ports:
    - "80:3000"
  environment:
    ROOT_URL: "http://localhost"
    MONGO_URL: "mongodb://mongo:27017/reaction"

mongo:
  image: mongo:latest
  command: mongod --storageEngine=wiredTiger --bind_ip_all

And I think we probably need to outlaw the :latest flag. It's a pretty constant source of confusion. I'll submit a PR.

All 20 comments

I can't reproduce this. Works fine for me.

reaction init

cd reaction

docker-compose up -d

# note no errors in logs
docker-compose logs reaction

# open in your default browser
open http://localhost

I have reproduced this on three separate machines now

The default image is reactioncommerce/reaction:latest, so make sure you definitely have the _actual_ latest version by running...

docker pull reactioncommerce/reaction:latest

Note the Docker "latest" nightmare...

http://container-solutions.com/docker-latest-confusion/

 禄禄 docker pull reactioncommerce/reaction:latest
latest: Pulling from reactioncommerce/reaction
Digest: sha256:29862c28d565190c3ba73d81363e35ca6d0797d3a40f16a40cde2c68077a510d
Status: Image is up to date for reactioncommerce/reaction:latest

I double-checked by following those ^^ exact instructions above and got the same error. Important to note that it looks like the site is working, but if you click on the product you aren't taken to the PDP, etc. But I def see all the errors in the logs

Same deal with mongo.

docker pull mongo:latest

Or to be as specific as possible, just pin the versions. And change the port to something other than 80 just to confirm. This works on 3 different machines too. Mac and Linux. Docker 17.12.0-ce

reaction:
  image: reactioncommerce/reaction:v1.6.1
  links:
    - mongo
  ports:
    - "3000:3000"
  environment:
    ROOT_URL: "http://localhost"
    MONGO_URL: "mongodb://mongo:27017/reaction"

mongo:
  image: mongo:3.4
  command: mongod --storageEngine=wiredTiger
 禄禄 docker pull mongo:latest
latest: Pulling from library/mongo
Digest: sha256:878b76e5834f37da98096296f4147f6ca4d94b1a9187986e9d6e59756e7ce865
Status: Image is up to date for mongo:latest

Running that above compose file it works. If I then revert the file and use the one in the repo, it fails again

Looks like the version in mongo:latest is 3.6 not 3.4? Not sure if it matters.

Verified that taking the above compose file and changing the mongo version to latest breaks it

That's only because I removed the --bind_ip_all flag from the mongod command in my 3.4 example. That's required in 3.6 and was already there in the example from our repo.

3.4 can be simply this:

mongo:
  image: mongo:3.4

3.6 requires the additional flag (see docs)

mongo:
  image: mongo:3.6
  command: mongod --bind_ip_all

Neither require the --storageEngine=wiredTiger anymore because that has been the default since 3.2. We just haven't removed it from the example yet because it doesn't cause any issues.

Anyway, the file as-is on the master branch still works fine for me.

reaction:
  image: reactioncommerce/reaction:latest
  links:
    - mongo
  ports:
    - "80:3000"
  environment:
    ROOT_URL: "http://localhost"
    MONGO_URL: "mongodb://mongo:27017/reaction"

mongo:
  image: mongo:latest
  command: mongod --storageEngine=wiredTiger --bind_ip_all

And I think we probably need to outlaw the :latest flag. It's a pretty constant source of confusion. I'll submit a PR.

Somebody just need to verify whether this is happening to anybody besides me and the random community member. If you can't replicate then close.

Another community member is reporting they see this problem

Yes, I'm having these errors with a fresh docker-compose up:

reaction_1  | 08:05:12.132Z  INFO Reaction: Running up() on version 3
reaction_1  | 08:05:12.143Z  WARN Reaction: Skipped loading settings from reaction.json.
reaction_1  | 08:05:12.925Z  INFO Reaction: Running up() on version 4
reaction_1  | 08:05:12.930Z  INFO Reaction: Running up() on version 5
reaction_1  | 08:05:12.937Z  WARN Reaction: Error while importing to Packages: Updating the path 'layout' would create a conflict at 'layout'
reaction_1  | 08:05:12.937Z  WARN Reaction: Error while importing to Packages: Updating the path 'layout' would create a conflict at 'layout'
reaction_1  | 08:05:12.938Z  WARN Reaction: Error while importing to Packages: Updating the path 'settings' would create a conflict at 'settings'
reaction_1  | 08:05:12.938Z  WARN Reaction: Error while importing to Packages: Updating the path 'layout' would create a conflict at 'layout'
reaction_1  | 08:05:12.938Z  WARN Reaction: Error while importing to Packages: Updating the path 'settings' would create a conflict at 'settings'
reaction_1  | 08:05:12.938Z  WARN Reaction: Error while importing to Packages: Updating the path 'layout' would create a conflict at 'layout'
reaction_1  | 08:05:12.938Z  WARN Reaction: Error while importing to Packages: Updating the path 'icon' would create a conflict at 'icon'
...

I see the same logged errors and symptoms on the site. I've been troubleshooting this and can verify that the mongo connection is fine is Docker Compose with two tests: 1) telnet to mongo works inside the reaction container 2) I can log into the site as admin with the default credentials.

The Error while importing to Packages indicate that there's a problem with the fixtures.

I tried to disable fixtures by adding the SKIP_FIXTURES environment config. Fixtures were bypassed but then there's no store so the site doesn't launch. That would be expected.

Looping @spencern on this one to help determine if it's an issue with the core fixtures.

Thanks to some help from @prinzdezibel in chat, we found the source of the problem. The app doesn't work correctly with Mongo 3.6. Things are OK with Mongo 3.4.

We're pinning the Mongo version in the Docker Compose files to mongo:3.4 in #3653. This will get things working immediately but doesn't add support for 3.6. I created #3861 to track the long term fix to add full compatibility.

@ticean Should we put some sort of note in our docs that you should only be running sites with Mongo 3.4 until this is resolved? Is this a Reaction thing or a Meteor thing?

Yes, we should call this out in docs.

TBH, I'm not sure if it's specific to Reaction or Meteor. Comments in this open Mongoose issue indicate driver compatibility issues that were fixed by configuring Mongo 3.6 server to be 3.4 compatible. I didn't deep dive on that. It could also be that Reaction has been developed and tested on 3.4 only, since that's what Meteor provides. I opened #3861 for that follow-up investigation.

Moving to backlog as I don't think this is an issue my team should work on.

This was resolved by the merge of #3653, which pinned the MongoDB version. The README has been updated with instructions to run using docker-compose-demo.yml.

Was this page helpful?
0 / 5 - 0 ratings