reactioncommerce / reaction

Mailchimp Open Commerce is an API-first, headless commerce platform built using Node.js, React, GraphQL. Deployed via Docker and Kubernetes.
https://mailchimp.com/developer/open-commerce/
GNU General Public License v3.0
12.34k stars 2.17k forks source link

Reaction does not support Mongo 3.6 #3861

Closed ticean closed 6 years ago

ticean commented 6 years ago

Prerequisites

Issue Description

Reaction v1.8.1 does not work correctly with Mongo 3.6. Things work fine in Mongo 3.4. This issue was originally reported in https://github.com/reactioncommerce/reaction/issues/3491, though the cause was unknown when originally reported there.

We are 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.

Here are the errors thrown when the process attempts to load the Reaction fixtures in Mongo 3.6:

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'
...

Steps to Reproduce

Docker Compose

Please provide starting context, i.e. logged in as a user, configure a particular payment method.

  1. Update the mongo service in docker-compose.yml to set to version 3.6.
    mongo:
    image: mongo:3.6
    command: mongod --bind_ip_all
  2. Start the reaction service.
    docker-compose up
  3. Errors show above should be logged.
  4. Navigation on the site (localhost:3000) does not work.

Local Meteor Dev Environment

This is also reproducible in a local Meteor development environment.

  1. Update the mongo service in docker-compose.yml to set to version 3.6.
    mongo:
    image: mongo:3.6
    command: mongod --bind_ip_all
    ports:
      - 27017:27017
  2. Start the mongo service.
    docker-compose up mongo
  3. In a new console, start reaction with MONGO_URL set. (Meteor should use the Mongo 3.6 from Docker Compose, assuming Docker for Mac.)
    MONGO_URL=mongodb://127.0.0.1:27017/reaction reaction
  4. Errors show above should be logged.
  5. Navigation on the site (localhost:3000) does not work.

Possible Solution

The issue is discussed in https://github.com/Automattic/mongoose/issues/5973.

Versions

These are the version from my host machine, but testing was performed from Docker images.

Node: 9.2.0
NPM: 5.5.1
Meteor Node: 8.9.4
Meteor NPM: 5.6.0
Reaction CLI: 0.28.0
Reaction: 1.8.1
Reaction branch: docker-base-updates
Docker: 17.12.0-ce
aaronjudd commented 6 years ago

The WIP status has just been removed from the PR in Meteor that updates to be MongoDB 3.6 compatible. See: https://github.com/meteor/meteor/pull/9632 I'd suggest not setting this in stone in docs, etc.. as the upgrade path is not [hopefully] too far away.

aldeed commented 6 years ago

It appears that Meteor 1.7 has a fix for this. Need to verify fixed after updating.

loanlaux commented 6 years ago

I believe we can close this. Meteor 1.7 shipped with MongoDB 3.6.4 and I've been running Reaction with MongoDB 3.6.x with no issue whatsoever.

brent-hoover commented 6 years ago

We have also been running Mongo 3.6 in load testing so am closing.