openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.1k stars 714 forks source link

Server error (slug of doom) running reports on SOME order cycles/dates #4016

Closed WalkingBlackBear closed 5 years ago

WalkingBlackBear commented 5 years ago

Description

When trying to run a report on a past order cycle/date range, the server instantly returns the system error/slug of doom screen.

I am getting the exact same result when running a packing report, orders and distributors report, and all of the Orders and Fulfillment reports as well. The payment report returns the expected result on the same time period though.

Expected Behavior

A report is returned based on the parameters set or OC selected.

Actual Behaviour

The NO GROW server error screen is shown. It comes up almost immediately, so there is no chance that it is some kind of server timeout at play.

Steps to Reproduce

  1. Sign in as a hub administrator (regular user, NOT Super User)
  2. Go to the Reports tab.
  3. Select a report type listed above as returning the error. (IE: Packing report)
  4. EITHER: Select an affected date range OR an affected order cycle. (In my case, for the CLFC test shop, February 17, 2019 to March 4, 2019 OR "Test Cycle 11 (17 Feb 08:00) - 03 Mar 16:00)"
  5. Click Search

Animated Gif/Screenshot

OFN-Error-PackingReport-ByDate OFN-Error-PackingReport-ByOC

Context

I was trying to access order cycle data while testing reports after V2 upgrade to see what/if anything had changed.

Severity

Your Environment

Possible Fix

luisramos0 commented 5 years ago

nicely documented @WalkingBlackBear tagging it S2 at least...

luisramos0 commented 5 years ago

main hypothesis for this issue is that deleted products are breaking the reports.

RachL commented 5 years ago

Yes thank you @WalkingBlackBear I was able to reproduce this during the latest release testing. I guess previously I didn't had deleted products within the database I was using :/ hte next release will correct the orders and fulfillment reports. We still need to work on Bulk-coop, orders and distributors and packing reports.

sauloperez commented 5 years ago

That's exactly one of the other reports affected by unhandled deleted products. I can tackle it myself or help someone else :point_up:

btw @WalkingBlackBear , "Orders and Fulfillment report" is fixed in the release v2.2.0.

Matt-Yorkley commented 5 years ago

@sauloperez is this essentially the same issue as #3956 ?

Matt-Yorkley commented 5 years ago

Also, can't we employ Paranoia's #with_deleted scope to get around some of these issues?

sauloperez commented 5 years ago

@sauloperez is this essentially the same issue as #3956 ?

Yep, read my comment above.