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

localhost: cannot access /admin/subscriptions #6358

Closed
andrewpbrett opened this issue Nov 10, 2020 · 4 comments · Fixed by #6377
Closed

localhost: cannot access /admin/subscriptions #6358

andrewpbrett opened this issue Nov 10, 2020 · 4 comments · Fixed by #6377
Assignees
Labels
bug-s2 The bug is affecting any of the non-critical features described in S1 and there is no workaround.

Comments

@andrewpbrett
Copy link
Contributor

andrewpbrett commented Nov 10, 2020

Description

In my local database, there are several calculators in the database where type == "Spree::Calculator::FlatRate". On master, this results in a 500 error when you visit /admin/subscriptions.

It looks like this was introduced when #5978 was merged.

Expected Behavior

Should see the subscriptions page

Actual Behaviour

The single-table inheritance mechanism failed to locate the subclass: 'Spree::Calculator::FlatRate'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Spree::Calculator.inheritance_column to use another column for that information.
= admin_inject_json_ams_array "admin.subscriptions", "shops", @shops, Api::Admin::IdNameSerializer if @shops
  = admin_inject_json_ams_array "admin.subscriptions", "customers", @customers, Api::Admin::IdEmailSerializer if @customers
  = admin_inject_json_ams_array "admin.subscriptions", "schedules", @schedules, Api::Admin::IdNameSerializer if @schedules
  = admin_inject_json_ams_array "admin.subscriptions", "paymentMethods", @payment_methods, Api::Admin::PaymentMethodSerializer if @payment_methods
  = admin_inject_json_ams_array "admin.subscriptions", "shippingMethods", @shipping_methods, Api::Admin::IdNameSerializer if @shipping_methods
  = admin_inject_json_ams_array "admin.subscriptions", "orderCycles", @order_cycles, Api::Admin::BasicOrderCycleSerializer if @order_cycles
  = admin_inject_available_countries(module: "admin.subscriptions")
app/models/spree/payment_method.rb:105:in `init'
app/helpers/admin/injection_helper.rb:211:in `admin_inject_json_ams_array'
app/views/admin/subscriptions/_data.html.haml:5:in `_app_views_admin_subscriptions__data_html_haml__721258578312291284_70141302593520'
app/views/admin/subscriptions/index.html.haml:15:in `_app_views_admin_subscriptions_index_html_haml___458590784082120731_70141219767640'

Steps to Reproduce

  1. Visit /admin/subscriptions

Animated Gif/Screenshot

Screen Shot 2020-11-10 at 1 25 05 PM

Workaround

None

Severity

bug-s2: a non-critical feature is broken, no workaround

Your Environment

Possible Fix

To fix for now I ran update spree_calculators set type = 'Calculator::FlatRate' where type = 'Spree::Calculator::FlatRate'; in Postgres locally...so maybe we need a migration that does this? And maybe check other tables that might reference a Spree class?

@andrewpbrett andrewpbrett added the bug-s2 The bug is affecting any of the non-critical features described in S1 and there is no workaround. label Nov 10, 2020
@andrewpbrett
Copy link
Contributor Author

@luisramos0 I might be missing something here; I know that this has already been deployed to FR and @RachL said that the post-deploy checks were all good. But maybe the subscriptions page wasn't checked? Or there were no calculators that caused the issue on FR?

@RachL
Copy link
Contributor

RachL commented Nov 11, 2020

@andrewpbrett @luisramos0 I did not checked it yesterday 😊 but it is working in production. Maybe because we don't have a lot of them per hubs?

@luisramos0
Copy link
Contributor

This is the problem that happened yesterday in FR prod.
It's working in FR because I fixed the FR prod DB manually yesterday. I'll have a PR for this soon.

@RachL it's @andrewpbrett 👍

@RachL
Copy link
Contributor

RachL commented Nov 11, 2020

oops 🤦 thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-s2 The bug is affecting any of the non-critical features described in S1 and there is no workaround.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants