Reaction: Error when adding flat shipping method

Created on 30 Apr 2017  路  34Comments  路  Source: reactioncommerce/reaction

Expected behavior

Flat shipping methods can be easily added and removed.

Actual Behavior

Fails with error No Provider ID provided when adding methods [bad-provider-id]

Steps to Reproduce the Behavior

Just run the most recent docker build and try to add a shipping method.

bug verified reproducible

All 34 comments

I cannot reproduce using the latest Docker build (see screenshot). I am leaving this open as I believe this is a valid bug but the reproduction steps are inaccurate/incomplete.

reaction

Hmm, I think you're right, I just tried it again and I don't get the same results. I don't remember changing anything else, but I will investigate.

I would love to get a reproducible case for this as a couple of people have seen it including us on our demo site, but can't figure out exactly how it gets into that state to get it to happen locally so I can fix it.

I'm facing the same issue when using the latest docker build.

image

@My feeling is that this is related to #1424. Fixture data is being loaded without a shopId. I've never been able to replicate this locally, it only seems to happen with remote Docker containers.

@Stat1c14 We pushed a fix that I believe should fix this issue. #2224 Can you test with the current code on development?

Hi @Stat1c14 this issue is not solved in the latest commit f1306aa:
(HEAD -> development, origin/development) Permissions Fix: Use passed in "audience" param in ReactionApps (#2235)

I build my own container for test it and have the same message:
No Provider ID provided when adding methods [bad-provider-id]

you can see it running my container:
docker pull jujes/reaction.dev:f1306aa

Regards,

@abdulsemiu-atanda some idea how fix it?

@zenweasel some idea how fix it?
:)

Thanks in advance,

Hi @jujes, are you running on the latest release? Our 1.2 release was thought to have fixed this issue.

Hi @spencern and @zenweasel :)

yes I'm running the last 1.2 version, my own build version: docker pull jujes/reaction:1.2.0 and reactioncommerce/prequel this last updated 9Hs ago...

In bouth cases get the same error

@jujes What do the records in your Shipping collection look like?

@zenweasel my Shipping collection look like this:

Flat rate update failed. Error: No Provider ID provided when adding methods [bad-provider-id]

I don't have any records.

issueshippingcollection

screenshot from 2017-05-18 10-55-11

No, I mean in the actual db collection

where I can found this info?
path or script for lookup it...?

Thanks in advance :)

If you open another terminal window and run meteor mongo and then at that prompt do:

db.Shipping.find().pretty();

It will show you what's in that collection

https://asciinema.org/a/121107

this is the container what I'm ussing:
docker pull jujes/reaction:1.2.0

inside the running container:

docker exec -it anida.shop bash
pwd
/opt/reaction/dist/bundle
meteor mongo --allow-superuser

and get:

Even with METEOR_ALLOW_SUPERUSER or --allow-superuser, permissions in your app directory will be incorrect if you ever attempt to perform any Meteor tasks as a normal user. If you need to fix
your permissions, run the following command from the root of your project:
  sudo chown -Rh <username> .meteor/local
mongo: You're not in a Meteor project directory.
To create a new Meteor project:
  meteor create <project name>
For example:
  meteor create myapp
For more help, see 'meteor --help'.

Sorry forgot you were running within a docker container and not a local project. You will want to connect to port 27017 on your docker container thats running mongo. If you have mongo installed on your development machine you should just be able to connect via the command line client.

yes, I want to connect to port 27017 on my docker container that are running mongo..
how do it? something like this from the container??

meteor mongo mongodb://mongo:27017/reaction --allow-superuser
screenshot from 2017-05-18 12-29-50

You don't need to use the meteor mongo just connect with the mongo CLI.

usage: mongo [options] [db address] [file names (ending in .js)]

Or you could use RoboMongo or some other Mongo GUI

ok, here it is: the records in Shipping collection look like

> db.Shipping.find().pretty();
{
        "_id" : "uxL4B9wqigqozDeqr",
        "name" : "Default shipping provider",
        "methods" : [
                {
                        "name" : "Free",
                        "label" : "Free Shipping",
                        "group" : "Ground",
                        "rate" : 0,
                        "validLocales" : [
                                {
                                        "deliveryBegin" : 2,
                                        "deliveryEnd" : 7
                                }
                        ],
                        "validRanges" : [
                                {
                                        "begin" : 50
                                }
                        ],
                        "_id" : "nuLr9vXENhrivMJgR",
                        "handling" : 0,
                        "enabled" : false
                },
                {
                        "name" : "Standard",
                        "label" : "Standard",
                        "group" : "Ground",
                        "rate" : 2.99,
                        "validLocales" : [
                                {
                                        "deliveryBegin" : 2,
                                        "deliveryEnd" : 7
                                }
                        ],
                        "_id" : "F7BDeqX5PAg9D5Kg2",
                        "handling" : 0,
                        "enabled" : false
                },
                {
                        "name" : "Priority",
                        "label" : "Priority",
                        "group" : "Priority",
                        "rate" : 6.99,
                        "validLocales" : [
                                {
                                        "deliveryBegin" : 1,
                                        "deliveryEnd" : 3
                                }
                        ],
                        "_id" : "32JQDYHKSiNxSPq3t",
                        "handling" : 0,
                        "enabled" : false
                }
        ],
        "provider" : {
                "name" : "flatRates",
                "label" : "Flat Rate",
                "_id" : "CnwWyAcJq6NJAjqA6",
                "enabled" : true
        },
        "shopId" : null
}

Well, the issue is still that the shopId is being set to null. The question is why. To work around this temporarily you could just set the shopId of those records and it should work. But obviously that's not a long term strategy.

yes, I see...
@zenweasel how do this temporarily fix?

You can use db.Shipping.update({}, { $set: { shopId: "J8Bhq3uTtdgwZx3rz" } }); and replace that shopId with your shopId (or that is your shopId if you are using the default data).

http://gph.is/1KjihQe

now it's work! and let me create new Flat Rate...

screenshot from 2017-05-18 13-15-03

So simple, right? ;)

yes, thanks!
:)

@zenweasel one think....

when I make docker-compose up, the first log warning message is:

12:54:10.236Z WARN Reaction: No shopId, waiting one second...

here the complete info:

=> Starting app on port 3000...
12:54:09.953Z  INFO Reaction: Load default data from /private/data/
12:54:10.236Z  WARN Reaction: No shopId, waiting one second...
12:54:11.246Z  WARN Reaction: No shopId, waiting one second...
12:54:12.250Z  WARN Reaction: No shopId, waiting one second...
12:54:13.256Z  WARN Reaction: No shopId, waiting one second...
12:54:14.262Z  WARN Reaction: No shopId, waiting one second...
12:54:15.266Z  WARN Reaction: No shopId, waiting one second...
12:54:16.272Z  WARN Reaction: No shopId, waiting one second...
12:54:17.278Z  WARN Reaction: No shopId, waiting one second...
12:54:18.286Z  WARN Reaction: No shopId, waiting one second...
12:54:19.291Z  WARN Reaction: No shopId, waiting one second...
12:54:20.301Z  INFO Reaction: JobServer started
12:54:20.312Z  WARN Reaction: Skipped loading settings from reaction.json.
12:54:27.188Z  WARN Reaction: Reaction.Email.getMailUrl() - no email provider configured
12:54:27.188Z  WARN Reaction:
    ***************************************************
            IMPORTANT! EMAIL VERIFICATION LINK
             Email sending is not configured.
    Go to the following URL to verify email: XXXX@XXXX
    http://anida.shop/#/verify-email/---------------------------------
    ***************************************************
12:54:27.442Z  WARN Reaction: Reaction.Email.getMailUrl() - no email provider configured
12:54:27.458Z ERROR Reaction: Mail not configured
12:54:30.179Z  WARN Reaction:
   *********************************
    IMPORTANT! DEFAULT ADMIN INFO
    EMAIL/LOGIN: XXXX@XXXX
    PASSWORD: XXXXXXXXX
   *********************************
12:54:30.180Z  INFO Reaction: Reaction Version: 1.2.0
12:54:30.241Z  INFO Reaction: Migrating from version 0 -> 4
12:54:30.241Z  INFO Reaction: Running up() on version 1
12:54:30.283Z  INFO Reaction: Running up() on version 2
12:54:30.304Z  INFO Reaction: Running up() on version 3
12:54:30.346Z  WARN Reaction: Skipped loading settings from reaction.json.
12:54:32.894Z  INFO Reaction: Running up() on version 4
12:54:32.909Z  INFO Reaction: Finished migrating.
12:54:32.973Z  WARN Reaction: OpenExchangeRates API not configured. Not adding fetchRates job
12:54:32.975Z  WARN Reaction: OpenExchangeRates API not configured. Not adding flushRates job
12:54:32.978Z  WARN Reaction: No cart cleanup schedule
12:54:33.189Z  INFO Reaction: Reaction initialization finished.

maybe this issue come from the way to load shopId :)

I believe the shopId race condition was finally fixed in #2224. (which is now in the development branch). @jujes, can you test your deployment with the latest code from development and see if that solves your issue?

Also, something seems seriously wrong if it takes 10 seconds to load the base fixtures and return a single shop document. That should happen near instantly. What is your deployment setup like? Is your database possibly far away from your app server?

@jshimko I'm pretty sure he already tested it with that fix in place and no go.

Alrighty, give this PR a test then...

https://github.com/reactioncommerce/reaction/pull/2329

@jujes @Stat1c14 can you pull the latest development branch and test this again? #2329 should have fixed this. It completely blocks the shipping fixtures from being loaded until the initial shop has been inserted and successfully retrieved.

@jujes @Stat1c14 Can you verify if @jshimko's fix has resolved your issue? We are not able to reproduce this so we are relying on your testing to be able to close this issue. Thanks!

@zenweasel I believe it's all good now. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spencern picture spencern  路  3Comments

spencern picture spencern  路  3Comments

focusaurus picture focusaurus  路  4Comments

ticean picture ticean  路  4Comments

coooolers picture coooolers  路  4Comments