-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
[Investigation] Uncaught exception in distributions_controller.pickedup #3557
Comments
This hasn't happened since May 13th. On May 11th it happened several times and also on May 5. All the ones in the last month are one user, and it looks like all one item throwing the error. Now, this particular user does have a history of jamming the save button, so it might be related to that. I also wonder if they might just be trying to change the storage location on complete? |
They only have one storage location, so that's a dead end |
It looks like the inventory on May 13 for the item was "N/A" . |
It appears that the partner was able to request the item even though there had never been any inventory. Is that something we should be blocking? |
(I suppose some banks will do purchases based on what is requested, so probably not to block) |
But how were they able to save it the distribution with the item with no inventory? |
This issue has been inactive for 246 hours (10.25 days) and will be automatically unassigned after 114 more hours (4.75 days). |
This has not recurred since the double-click issue was fixed. I suggest we wait another 2 weeks, and if it hasn't recurred, we consider it a side-effect of that. |
This issue has been inactive for 262 hours (10.92 days) and will be automatically unassigned after 98 more hours (4.08 days). |
Closing. We think it might have been a side effect of the double-click issue. |
It's BAAACK!!! See bugsnag |
Picking up again... What this has in common with the "lower than on hand minimum quality" error (which has a separate investigation)... is that there is a storage location involved that does not have and inventory entry. That the item is not available at this storage location. How does that happen? In this case, it existed once upon a time... |
There is a "remove empty items" in storage_location.rb. Which is called in update_storage_location, which is called in the call on ItemizableUpdateService . So -- whenever we update an itemizable, we are checking if the storage location has no inventory for that (at the end, I think, but double-check), and removing the inventory_item if it has a level of 0. Then, when we look for it at pickup, or if changing the storage location, we are scuppered. I suspect this was done to keep the list of items you can pick from to just the ones that you can actually distribute (could be wrong on that). |
I'm not sure, though, where we should be handling this -- when we look at it, or just not removing the inventory item. |
It has some other effects, too. If you don't have any of the item in your storage location, then you change the storage location to a different one, then change it back, you get a problem as well. |
Summary
Unable to complete distributions sometimes. There's something strange going on. Find out what!
Requires bugsnag access to investigate, so limiting to more senior folk.
Details
Example
From bugsnag, April 13, 2023, User 466 and similarly about a week earlier, User 14
ActiveRecord::RecordInvaliddistributions#picked_up
Validation failed: Inventory Donated Diapers (Size 4) is not available at this storage location
User 466
Failing at line 202 in distributions_controller.rb
if !distribution.complete? && distribution.complete!
Notes:
The first time we noticed this, it was with a kit that had been deactivated.
This time, it is with an item that does not appear on the storage location.
However, Donated Diapers (Size 4) is missing from what appears to be the main storage location for the bank, when Donated Diapers (Size 3) and Donated Diapers (Size 5) are both there. This does not seen right. How could this happen?
It seems to die silently rather than giving a 500 error - at least with the most recent case.
This may be related to the bugsnag we've with "undefined method "lower than on hand minimum quantity".
Criteria for completion
The text was updated successfully, but these errors were encountered: