These are chat archives for reactioncommerce/reaction

17th
Sep 2016
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:18
Hello!
I tried to migrate from an older build: reactioncommerce/reaction:1828 (2+ months old) to the latest stable one, and the DB does not seem to be 100% compatible. I am no longer able edit most of the products: it does not even enter the product; in some products it is able to enter it, but unable to enter edit mode. We identified that the most problematic seem to be the ones which do not have variants.
Is there a way to "upgrade" the products to fit the newer versions ? (the issues start with build 1915, which is also 2+ months old)
Brent Hoover
@zenweasel
Sep 17 2016 11:19
That last significant change to the product schema was much more than two months ago
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:21
I think I managed to get exactly before it :(
I've done all the products in the old one. Any scripts for schema upgrade ?
Brent Hoover
@zenweasel
Sep 17 2016 11:24
unfortunately there is no migration script for making this change. I’m trying to find the PR for this. Was from an external contributor
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:26
all I need to keep is the product (and its variants) with description, labels and images. All the rest I can reconfigure easily...
Brent Hoover
@zenweasel
Sep 17 2016 11:26
are you exporting and reimporting products?
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:26
currently all is in DB.
Brent Hoover
@zenweasel
Sep 17 2016 11:27
I think you could do that, I think you can even exclude fields to export with the mongodb utility
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:28
and at import time it will arrange the data in the new schema automatically ?
Brent Hoover
@zenweasel
Sep 17 2016 11:29
actually, I guess I don’t completely remember that the difference was
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:29
something related to variants(options) maybe ?
Brent Hoover
@zenweasel
Sep 17 2016 11:30
yes, I remember it was the “flattened” schema but I didn’t pay attention to exactly what the change was
but exporting the data and massaging it that was is still probably your best bet
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:31
you mean export and afterwards manually transform before reimport ?
Brent Hoover
@zenweasel
Sep 17 2016 11:31
yeah
writing a quick script to transform JSON is pretty painless
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:33
any chances to find details on which collections we need the change?
Brent Hoover
@zenweasel
Sep 17 2016 11:33
it’s just Products
I’m still looking for the PR
here it is: reactioncommerce/reaction#741
back in March
is your build older than that?
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:35
no, it's working fine with build: reactioncommerce/reaction:1828 (2+ months old)
but not with build 1915
(these are the build numbers listed on dockerhub tags: https://hub.docker.com/r/reactioncommerce/reaction/tags/ )
Brent Hoover
@zenweasel
Sep 17 2016 11:36
yeah, those numbers don’t really mean anything to me
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:37
but the fact that is 2 months old /
Brent Hoover
@zenweasel
Sep 17 2016 11:38
then I am not sure what could be going on
there’s been no major schema changes that I remember in that period of time
Brent Hoover
@zenweasel
Sep 17 2016 11:44
looking at the git history I don’t see anything significant
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:46
I did not try an empty shop with the new builds; can you confirm that in the new builds product editing, with variants, etc is working fine ?
(are there people using it?)
Brent Hoover
@zenweasel
Sep 17 2016 11:46
It was working fine for me
I built a couple of test stores with 15-20 product with variants
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:49
looking at my exported Products.json, I see ancestors with values.
Brent Hoover
@zenweasel
Sep 17 2016 11:49
yep
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:49
while in the PR it states: ancestors: Array For a product – ancestors array is always clean for now.
Brent Hoover
@zenweasel
Sep 17 2016 11:49
variants should have ancestors
by PR do you mean #741?
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:50
yes
Brent Hoover
@zenweasel
Sep 17 2016 11:51
but you said that your data was working after this change?
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:53
it is working fine with docker tag: 1828. Acording to the date, it should have the change in 741.
Brent Hoover
@zenweasel
Sep 17 2016 11:55
yeah I would think something affected by that change would not be subtle
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:55
if you could have a visual check: https://transfer.sh/21neX/products.json
(it is exported from mongoexpress. For some reason I cannot validate it as a json...)
none of the mongoexpress export validate as json for some reason.
Brent Hoover
@zenweasel
Sep 17 2016 11:57
because it doesn’t create a valid JSON object
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 11:58
not sure why this happens.
Brent Hoover
@zenweasel
Sep 17 2016 11:59
you need to add —jsonArray
otherwise each line is a JSON object, but it’s not an array of JSON objects
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:00
it's a GUI (not cli). I have two options: export and export as JSON; both create invalid jsons
anyhow, from your experience, it looks a good schema?
Brent Hoover
@zenweasel
Sep 17 2016 12:01
just eyeballing it it seems fine
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:02
let me give you the ids with issues
and the ones that are fine
Brent Hoover
@zenweasel
Sep 17 2016 12:02
can you export them with the command line client so I could import them?
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:03
ok. give me few mins
Brent Hoover
@zenweasel
Sep 17 2016 12:03
mongoexport --db meteor --collection Products --port 3001 --jsonArray --pretty > Products.json
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:04
it's not default in the container, checking what package to install
Brent Hoover
@zenweasel
Sep 17 2016 12:05
it should come installed with the mongo package but not sure
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:06
you are right, I was in the reaction container
Brent Hoover
@zenweasel
Sep 17 2016 12:10
loading
I get a bunch of errors
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:15
you did mongoimport to get the errors?
Brent Hoover
@zenweasel
Sep 17 2016 12:17
No, I just loaded the data into my local copy of Reaction
this error is a mystery to me:
I20160917-20:12:49.748(8)? 12:12:49.747Z  WARN Reaction: Error while importing to Products: After applying the update to the document {_id: "SXP8SfHbz8Xk42aex" , ...}, the (immutable) field '_id' was found to have been altered to _id: “QXAaRBnAWDSwqBAWh”
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:20
one thing it's sure: I never updated the DB directly. Always via the interface.
if it's an item only, let's remove it.
Brent Hoover
@zenweasel
Sep 17 2016 12:20
no, it’s like 20, but not all
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:36
maybe to compare the jsons of the working ones with the non-working ones. Can you give the the 20 ids?
(or how to generate these errors myself)
Brent Hoover
@zenweasel
Sep 17 2016 12:36
I just dropped your file into /private/data/ as Products.json and reset and restarted
in my local install
I’ve think I’ve seen this before with a mismatch with the shop file, so you may want to export Product, Shops, and Tags
that may fix it
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:38
exporting
Brent Hoover
@zenweasel
Sep 17 2016 12:46
yeah, getting the same errors
but the store starts up
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:47
and I guess those products cannot be seen, right?
Brent Hoover
@zenweasel
Sep 17 2016 12:47
I can’t say because I can’t tell which ones they are
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:47
can you grep the ids that failed ?
and I'll translate to product names
Brent Hoover
@zenweasel
Sep 17 2016 12:48
do you not have a way to running this locally?
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:49
can you help me identify the folder inside the container?
root@fc6bb7865748:/var/www/bundle# find / -name private
/var/src/packages/reaction-layout/private
/var/src/packages/reaction-shipping/private
/var/src/packages/reaction-ui-navbar/private
/var/src/packages/reaction-ui/private
/var/src/packages/reaction-sample-data/private
/var/src/packages/reaction-i18n/private
/var/src/private
/var/www/bundle/programs/server/npm/node_modules/meteor/kadira_flow-router-ssr/node_modules/private
/var/www/bundle/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/babel-core/node_modules/private
/var/www/bundle/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/babel-preset-meteor/node_modules/private
/var/www/bundle/programs/server/npm/node_modules/meteor/reactioncommerce_reaction-ui/node_modules/react/node_modules/envify/node_modules/jstransform/node_modules/commoner/node_modules/private
/var/www/bundle/programs/server/npm/node_modules/meteor/babel-runtime/node_modules/regenerator/node_modules/private
/var/www/bundle/programs/server/assets/packages/reactioncommerce_reaction-ui/private
/var/www/bundle/programs/server/assets/packages/reactioncommerce_reaction-i18n/private
/var/www/bundle/programs/server/assets/packages/reactioncommerce_reaction-ui-navbar/private
/var/www/bundle/programs/server/assets/packages/reactioncommerce_reaction-layout/private
/var/www/bundle/programs/server/assets/packages/reactioncommerce_reaction-sample-data/private
/var/www/bundle/programs/server/assets/packages/reactioncommerce_reaction-shipping/private
root@fc6bb7865748:/var/www/bundle# cd /var/src/private
root@fc6bb7865748:/var/src/private# ls
settings
maybe /var/src/private ?
Brent Hoover
@zenweasel
Sep 17 2016 12:50
no I don’t really know how these folders translate into a built version. You don’t have a development version?
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:52
I mean, in which private/data to put the above json files
Brent Hoover
@zenweasel
Sep 17 2016 12:53
in my development version it /private/data from the root of the project where I have it cloned
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:54
I found these ones already there:
root@f152923e1a89:/var/src/private/data# ls -la
total 164
drwxrwxr-x 3 root root 4096 Sep 14 00:19 .
drwxrwxr-x 7 root root 4096 Sep 14 00:19 ..
-rw-rw-r-- 1 root root 2951 Sep 14 00:19 Products.json
-rw-rw-r-- 1 root root 790 Sep 14 00:19 Shipping.json
-rwxrwxr-x 1 root root 143285 Sep 14 00:19 Shops.json
-rw-rw-r-- 1 root root 538 Sep 14 00:19 Tags.json
drwxrwxr-x 2 root root 4096 Sep 14 00:19 i18n
these are loaded automatically each time the server is started?
Brent Hoover
@zenweasel
Sep 17 2016 12:54
Yes
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:55
so I simply replace them with the ones I export from "production"
Brent Hoover
@zenweasel
Sep 17 2016 12:55
correct
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:55
and restart the container
Brent Hoover
@zenweasel
Sep 17 2016 12:55
you want to do reaction reset and then restart reaction
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 12:55
does it matter if there is already data in mongoDB ?
ah, this will cleanup the mongoDB ?
Brent Hoover
@zenweasel
Sep 17 2016 12:56
yeah, it just does meteor reset which resets the Mongo db
Brent Hoover
@zenweasel
Sep 17 2016 13:07
hey, I need to go pay attention to my family for a while. Let me know how it goes and I will try to catch up to you tomorrow.
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 13:46
I appreciate so much your help ! I am working to import it myself with the private/data.
soyJsus
@soyJSus
Sep 17 2016 16:15
i have question, Every time you make a change in register.js I do react reset?
Epifania Collection - christian orthodox priest vestments and church items
@EpifaniaCollection
Sep 17 2016 16:28
I am just a beginer, but as per @zenweasel , reaction reset means mongo db reset (aka meteor reset) and triggers cleanup of mongoDB
soyJsus
@soyJSus
Sep 17 2016 16:34
yes, but I wanted to know if every time you modify the Register.js in my plugin I do a reset
I am creating a new component in my dashboard , but it gives me an error
mi register
This page was not found.
soyJsus
@soyJSus
Sep 17 2016 16:41
mi index.js in client
import "./templates/dashboard/recetas.html";
import "./templates/settings/settings.html";