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

upcomingInvoice exception [Epic2] #800

Closed
jordanh opened this issue Mar 12, 2017 · 8 comments
Closed

upcomingInvoice exception [Epic2] #800

jordanh opened this issue Mar 12, 2017 · 8 comments
Assignees
Labels

Comments

@jordanh
Copy link
Contributor

jordanh commented Mar 12, 2017

Issue - Bug

We are getting super close now. I encountered a fresh exception trying to view my upcoming invoice.

Reproduction steps:

  1. Impersonate jordan.husney@google.com usergoogle-oauth2|112540584686400405659
  2. Navigate to User Hub->Organizations->Jordan's Org->Settings and Billing
  3. Observe invoice list does not load
2017-03-12T04:48:11.638407238Z app[web.1]: DEBUG GraphQL Subscribe Error: upcomingInvoice [ { Error: {"_error":"Stripe: Unknown arguments ([object Object],/app/src/server/billing/stripe.js,/app/src/server/billing). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to GET function (urlData) {\n      var url = 'upcoming?customer=' + urlData.customerId;\n      // Legacy support where second argument is a the subscription id\n      if (urlData.invoiceOptions && typeof urlData.invoiceOptions === 'string') {\n        return url + '&subscription=' + urlData.invoiceOptions;\n      } else if (urlData.invoiceOptions && typeof urlData.invoiceOptions === 'object') {\n        return url + '&' + utils.stringifyRequestData(urlData.invoiceOptions);\n      }\n      return url;\n    })"}
2017-03-12T04:48:11.638557783Z app[web.1]:       at errorObj (/app/src/server/utils/utils.js:7:32)
2017-03-12T04:48:11.638572333Z app[web.1]:       at _callee$ (/app/src/server/billing/stripe.js:10:11)
2017-03-12T04:48:11.638579088Z app[web.1]:       at tryCatch (/app/node_modules/regenerator-runtime/runtime.js:63:40)
2017-03-12T04:48:11.638585518Z app[web.1]:       at Generator.invoke [as _invoke] (/app/node_modules/regenerator-runtime/runtime.js:337:22)
2017-03-12T04:48:11.638591873Z app[web.1]:       at Generator.prototype.(anonymous function) [as throw] (/app/node_modules/regenerator-runtime/runtime.js:96:21)
2017-03-12T04:48:11.638598282Z app[web.1]:       at step (/app/src/server/billing/stripe.js:20:191)
2017-03-12T04:48:11.638604575Z app[web.1]:       at /app/src/server/billing/stripe.js:20:402
2017-03-12T04:48:11.638613743Z app[web.1]:     message: '{"_error":"Stripe: Unknown arguments ([object Object],/app/src/server/billing/stripe.js,/app/src/server/billing). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to GET function (urlData) {\\n      var url = \'upcoming?customer=\' + urlData.customerId;\\n      // Legacy support where second argument is a the subscription id\\n      if (urlData.invoiceOptions && typeof urlData.invoiceOptions === \'string\') {\\n        return url + \'&subscription=\' + urlData.invoiceOptions;\\n      } else if (urlData.invoiceOptions && typeof urlData.invoiceOptions === \'object\') {\\n        return url + \'&\' + utils.stringifyRequestData(urlData.invoiceOptions);\\n      }\\n      return url;\\n    })"}',
2017-03-12T04:48:11.638678959Z app[web.1]:     locations: [ [Object] ],
2017-03-12T04:48:11.638688092Z app[web.1]:     path: [ 'upcomingInvoice' ] } ]
@jordanh
Copy link
Contributor Author

jordanh commented Mar 13, 2017

I've been digging into this one a bit more, trying to triage. Current mystery: it works on dev just fine.

Next, I looked into the database on action-staging. That too looks line:

r.db('actionProduction').table('Organization').get('Sk1mZJ-E9ce')('stripeId')

Returns:

"cus_AEdDLtDunq0MQ5"

🤔

I am going to deploy a few console logging statements to staging to collect more info.

@jordanh
Copy link
Contributor Author

jordanh commented Mar 13, 2017

Debugging statements on this path look clean. The mystery deepens!

2017-03-13T14:23:07.474466548Z app[web.1]: upcomingInvoice(): Sk1mZJ-E9ce
2017-03-13T14:23:07.837782314Z app[web.1]: upcomingInvoice(): cus_AEdDLtDunq0MQ5
2017-03-13T14:23:07.839178038Z app[web.1]: makeUpcomingInvoice(Sk1mZJ-E9ce, cus_AEdDLtDunq0MQ5): enter
2017-03-13T14:23:07.869854312Z app[web.1]: DEBUG GraphQL Subscribe Error: upcomingInvoice [ { Error: {"_error":"Stripe: Unknown arguments ([object Object],/app/src/server/billing/stripe.js,/app/src/server/billing). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to GET function (urlData) {\n      var url = 'upcoming?customer=' + urlData.customerId;\n      // Legacy support where second argument is a the subscription id\n      if (urlData.invoiceOptions && typeof urlData.invoiceOptions === 'string') {\n        return url + '&subscription=' + urlData.invoiceOptions;\n      } else if (urlData.invoiceOptions && typeof urlData.invoiceOptions === 'object') {\n        return url + '&' + utils.stringifyRequestData(urlData.invoiceOptions);\n      }\n      return url;\n    })"}

@jordanh
Copy link
Contributor Author

jordanh commented Mar 13, 2017

What looks like is happening is that the stripe.invoices.retrieveUpcoming call is getting some strange args. Instead of being called with the signature (stripeId), it's being called as ([object Object], "/app/src/server/billing/stripe.js", "/app/src/server/billing").

The only place I could see that injection possibily happening is in tryCatchWrapper. I'm going to add another console statement there and see what I can see...

@jordanh
Copy link
Contributor Author

jordanh commented Mar 13, 2017

Oh how interesting. Now it heisenbuged! This is the new exception:

DEBUG GraphQL Subscribe Error: upcomingInvoice [ { Error: {"_error":"No such customer: cus_AEdDLtDunq0MQ5"}

@mattkrick
Copy link
Member

oo, lemme dig in & see if i can reproduce

@jordanh
Copy link
Contributor Author

jordanh commented Mar 13, 2017

Ok, now referring to stripe for this one:

image

This might be an artifact of sharing data between development

@mattkrick
Copy link
Member

Bug filed here: babel/babel#5462

@mattkrick
Copy link
Member

workarounded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants