tierrun/tier-vercel-openai

Vercel Deploying to Production: Does not work with 'live' stripe keys.

lewisddffse11 opened this issue · 5 comments

Describe the bug

tier: GET https://api.tier.run/v1/pull
TierError: Internal Server Error
at Tier.apiGet (/vercel/path0/.next/server/chunks/760.js:339:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /vercel/path0/.next/server/chunks/232.js:21:14 {
code: 'internal_error',
path: '/v1/pull',
requestData: undefined,
status: 500,
responseData: {
status: 500,
code: 'internal_error',
message: 'Internal Server Error'
}
}

Build error occurred
Error: Failed to collect page data for /pricing
at /vercel/path0/node_modules/next/dist/build/utils.js:1161:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
type: 'Error'
}
Error: Command "npm run build" exited with 1

To Reproduce
When I replace the test Stripe key with the live Stripe key in the environmental variables in Vercel, the above error occurs. No issue exists when I am using test keys.

@lewisddffse11 Can you check if you pushed the models to a new Stripe account? This will ensure that all products are created by Tier and that it contains the metadata used by pull.

@jerriclynsjohn I have run the following command:
tier --live push https://model.tier.run/edit/clkhpfm792kd2o972osf1gyq4

This is the output:
ok plan:business@0 feature:extraaicopy https://dashboard.stripe.com/a_1DlHjIIngxpad0U/prices/price_1NXcmrCIngxpad0UETtCexiL [created]
ok plan:startup@0 feature:base https://dashboard.stripe.com/a_1DlHjIIngxpad0U/prices/price_1NXcmrCIngxpad0UnhziOww9 [created]
ok plan:business@0 feature:aicopy https://dashboard.stripe.com/a_1DlHjIIngxpad0U/prices/price_1NXcmrCIngxpad0UDvZnAw4S [created]
ok plan:business@0 feature:base https://dashboard.stripe.com/a_1DlHjIIngxpad0U/prices/price_1NXcmrCIngxpad0UVebcmNii [created]
ok plan:free@0 feature:aicopy https://dashboard.stripe.com/a_1DlHjIIngxpad0U/prices/price_1NXcmsCIngxpad0UBboVTWhI [created]
ok plan:startup@0 feature:aicopy https://dashboard.stripe.com/a_1DlHjIIngxpad0U/prices/price_1NXcmrCIngxpad0URkzKKqDk [created]
ok plan:startup@0 feature:extraaicopy https://dashboard.stripe.com/a_1DlHjIIngxpad0U/prices/price_1NXcmsCIngxpad0UwwWC5oim [created]
ok plan:free@0 feature:base https://dashboard.stripe.com/a_1DlHjIIngxpad0U/prices/price_1NXcmrCIngxpad0UoYojUHDg [created]

When I run "tier --live pull" I get the correct output.
I can see the products in my Stripe account (not using test mode). I have attached screenshot that shows that only products created by tier are present.
Products

How can I check that "metadata used by pull" is correct?

Thank You!

@lewisddffse11 Will you please confirm your live key you are using sk_ or rk_ has all permissions set to read/write all? https://dashboard.stripe.com/apikeys

I was able to reproduce the bug and fixed it by creating and using a restricted key with the following permissions as "TIER_API_KEY" for the app.

  1. All core resources
  2. All billing resources
  3. All connect resources
  4. All issuing resources

You can do this at the link mentioned above by @bmizerany. I'm closing the issue, feel free to reopen if it doesn't work. Also, feel free to join us at https://tier.run/join-slack

I have the same exact problem. Did anyone solve this?