Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when adding flat shipping method #2180

Closed
StaticActual opened this issue Apr 30, 2017 · 34 comments
Closed

Error when adding flat shipping method #2180

StaticActual opened this issue Apr 30, 2017 · 34 comments
Assignees
Labels
bug For issues that describe a defect or regression in the released software verified reproducible For issues that describe bugs that the core team was able to confirm

Comments

@StaticActual
Copy link

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.

@brent-hoover
Copy link
Collaborator

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

@StaticActual
Copy link
Author

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.

@brent-hoover
Copy link
Collaborator

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.

@aaronjudd aaronjudd added bug For issues that describe a defect or regression in the released software needs-to-be-reproduced labels May 1, 2017
@hasmizal
Copy link

hasmizal commented May 2, 2017

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

image

@brent-hoover
Copy link
Collaborator

brent-hoover commented May 6, 2017

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

@aaronjudd aaronjudd added verified reproducible For issues that describe bugs that the core team was able to confirm and removed needs-to-be-reproduced labels May 8, 2017
@brent-hoover
Copy link
Collaborator

brent-hoover commented May 10, 2017

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

@jujes
Copy link

jujes commented May 10, 2017

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 abdulsemiu-atanda self-assigned this May 12, 2017
@jujes
Copy link

jujes commented May 14, 2017

@abdulsemiu-atanda some idea how fix it?

@jujes
Copy link

jujes commented May 17, 2017

@zenweasel some idea how fix it?
:)

Thanks in advance,

@spencern
Copy link
Contributor

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

@jujes
Copy link

jujes commented May 17, 2017

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

@brent-hoover
Copy link
Collaborator

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

@jujes
Copy link

jujes commented May 18, 2017

@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

@brent-hoover
Copy link
Collaborator

No, I mean in the actual db collection

@jujes
Copy link

jujes commented May 18, 2017

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

Thanks in advance :)

@brent-hoover
Copy link
Collaborator

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

@jujes
Copy link

jujes commented May 18, 2017

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

@brent-hoover
Copy link
Collaborator

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.

@jujes
Copy link

jujes commented May 18, 2017

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

@brent-hoover
Copy link
Collaborator

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

@jujes
Copy link

jujes commented May 18, 2017

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
}

@brent-hoover
Copy link
Collaborator

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.

@jujes
Copy link

jujes commented May 18, 2017

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

@brent-hoover
Copy link
Collaborator

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

@jujes
Copy link

jujes commented May 18, 2017

http://gph.is/1KjihQe

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

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

@brent-hoover
Copy link
Collaborator

So simple, right? ;)

@jujes
Copy link

jujes commented May 18, 2017

yes, thanks!
:)

@jujes
Copy link

jujes commented May 18, 2017

@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 :)

@jshimko
Copy link
Contributor

jshimko commented May 23, 2017

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?

@brent-hoover
Copy link
Collaborator

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

@jshimko
Copy link
Contributor

jshimko commented May 23, 2017

Alrighty, give this PR a test then...

#2329

@jshimko
Copy link
Contributor

jshimko commented May 25, 2017

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

@brent-hoover brent-hoover removed their assignment Jun 20, 2017
@brent-hoover
Copy link
Collaborator

@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!

@StaticActual
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For issues that describe a defect or regression in the released software verified reproducible For issues that describe bugs that the core team was able to confirm
Projects
None yet
Development

No branches or pull requests

8 participants