InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

Salesorder shipment not working

Open mabroens opened this issue 1 year ago • 13 comments

Please verify that this bug has NOT been raised before.

  • [X] I checked and didn't find a similar issue

Describe the bug*

Hi Team,

i have an order one article but 1020 times trackable with serialnumbers entered. no whenever i want to complete shipment i fulfill all fields, select Confirm Shipment > Submit and than it takes a long time for the lines to be processed. and eventually in th ebackground (Complete shimpemnt 1 is blocking the content) i get an error msg.

lukely now i was able to capture it: image

any suggestions?? what does erro 500 mean and where can i find more info

Steps to Reproduce

written above

Expected behaviour

shipment completed

Deployment Method

  • [ ] Docker
  • [ ] Package
  • [X] Bare metal
  • [ ] Other - added info in Steps to Reproduce

Version Information

Version Information:

InvenTree-Version: 0.15.2 Django Version: 4.2.12

Database: sqlite3 Debug-Mode: True Deployed using Docker: False Platform: Linux-6.5.0-44-generic-x86_64-with-glibc2.35 Installer: None

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.0.0'}, {'name': 'InvenTreeLabelMachine', 'slug': 'inventreelabelmachine', 'version': '1.0.0'}, {'name': 'InvenTreeLabelSheet', 'slug': 'inventreelabelsheet', 'version': '1.0.0'}, {'name': 'DigiKeyPlugin', 'slug': 'digikeyplugin', 'version': '1.0.0'}, {'name': 'LCSCPlugin', 'slug': 'lcscplugin', 'version': '1.0.0'}, {'name': 'MouserPlugin', 'slug': 'mouserplugin', 'version': '1.0.0'}, {'name': 'TMEPlugin', 'slug': 'tmeplugin', 'version': '1.0.0'}]

Please verify if you can reproduce this bug on the demo site.

  • [ ] I can reproduce this bug on the demo site.

Relevant log output

No response

mabroens avatar Sep 10 '24 07:09 mabroens

You should be able to see the full error log here: https://docs.inventree.org/en/stable/settings/logs/

SchrodingersGat avatar Sep 10 '24 23:09 SchrodingersGat

Hi i was looking for that but its only availeble under admin i see. anyway found it.but... there are no errors logged: image

mabroens avatar Sep 11 '24 06:09 mabroens

@SchrodingersGat i did notice something else though. image

although: image

any suggestions why this order would have 0 completed line items??

mabroens avatar Sep 11 '24 06:09 mabroens

@SchrodingersGat any suggestions? pls assist

mabroens avatar Sep 13 '24 16:09 mabroens

@mabroens looks like two parts to your question here.

1. Incomplete Line Items

You have allocated the stock, but not "shipped" the items. You need to mark your incomplete shipments as "shipped" before you can close out the order.

2. Error Messages

If the error msg is not being logged, you'll need to capture the API network transfer to see what the error message is, and report that here.

Open the developer tab in your browser, and select the "network" tab. Then hit the "Submit" button on the form (which causes the 500 code error). Then, please provide the error message reported by the server.

SchrodingersGat avatar Sep 13 '24 23:09 SchrodingersGat

I hope this is what you are looking for:

Image

when i click the jquery is ee: Image

and following: here i tried it twice.

Image

br Martijn

mabroens avatar Sep 14 '24 08:09 mabroens

Click on this network transaction to see the "details". In particular, the "response" from the server is what I need to see.

Image

SchrodingersGat avatar Sep 16 '24 00:09 SchrodingersGat

Hi, i just redid the test and here are the screenshots.  Image

Image

I have also canceled the order such that stock became available again. than made a new order for the same product only 1 item works as expected. Than made an other new order with the same article only now allocated the 1020 pcs including their serials. and its fails again with the above screen shots.

Not sure if ist relevant info but the serials in my case are MAC addresses in the form of: 8C:1F:64:14:53:92 and i allocate them by going to the line item pressing the # sign enter qty 1020, enter a comma separated list of 1020 MAC addresses and press entre. after this they appear as expected in the pulldown list: Image

hope this helps you any how

Br Martijn

mabroens avatar Sep 16 '24 12:09 mabroens

Unfortunately that error message is not very helpful!

I have tried to reproduce but without any luck. Note that you are on a much older version of InvenTree too.

It would be helpful if you can narrow down the set of circumstances where the error occurs (if possible)!

SchrodingersGat avatar Sep 17 '24 04:09 SchrodingersGat

@SchrodingersGat i was just thinking of splitting the order in multiple shipments, just to see if that would change behavior but it seems we can only one by one delete stock allocation.. the bin on the upper row does not work. Image

would it make sense to add the ability to delete assigned stock (or actually unallocate) to the screen.

deleting one by one is a disaster as it every time closes all windows.

or is there a faster way to do so??

mabroens avatar Sep 17 '24 05:09 mabroens

Just updated to the latest release with sudo apt install --only-upgrade inventree

same result the error field is still empty. but during installation i also had a few warnings and one fatal. fatal: not a git repository (or any of the parent directories): .git

mabroens avatar Sep 17 '24 06:09 mabroens

@mabroens the git warning message should not matter here..

Do you have access to the server, and can view the log output in real time? If the 500 error is not being logged to the database, there may be some relevant information the server console logs?

SchrodingersGat avatar Sep 18 '24 02:09 SchrodingersGat

Hi Oliver, when you say "Do you have access to the server," yes i have ssh acces to the ubuntu machine hosting Inventree. any suggestion where i can find the log output so i can cpy the server console logs and share them.

mabroens avatar Sep 18 '24 06:09 mabroens

sorry guys but any suggestions. it's still not working and i would really like to get my stock up to date.

mabroens avatar Oct 04 '24 18:10 mabroens

@mabroens I see that you have updated to the "latest" version - can you please confirm the exact version of InvenTree you are now using?

SchrodingersGat avatar Oct 06 '24 10:10 SchrodingersGat

Sure:

Version Information:

InvenTree-Version: 0.16.2 Django Version: 4.2.15

Database: sqlite3 Debug-Mode: True Deployed using Docker: False Platform: Linux-6.5.0-44-generic-x86_64-with-glibc2.35 Installer: None

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.1.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.1.0'}, {'name': 'InvenTreeLabelMachine', 'slug': 'inventreelabelmachine', 'version': '1.0.0'}, {'name': 'InvenTreeLabelSheet', 'slug': 'inventreelabelsheet', 'version': '1.0.0'}, {'name': 'DigiKeyPlugin', 'slug': 'digikeyplugin', 'version': '1.0.0'}, {'name': 'LCSCPlugin', 'slug': 'lcscplugin', 'version': '1.0.0'}, {'name': 'MouserPlugin', 'slug': 'mouserplugin', 'version': '1.0.0'}, {'name': 'TMEPlugin', 'slug': 'tmeplugin', 'version': '1.0.0'}]

mabroens avatar Oct 06 '24 10:10 mabroens

Reading through your error report again, can I clarify: Are you trying to mark a shipment as "complete" which has over 1,000 items in it?

SchrodingersGat avatar Oct 06 '24 10:10 SchrodingersGat

Yes, i have a sales order with 1020 times the same item. all are serialized with MAC adresses and all have been allocated. i can also see in the stock that these are allocated. its just that i can not contineu to teh shipment. that always fails.

I have already once deleted the whole SO created a new one with same result

mabroens avatar Oct 06 '24 10:10 mabroens

Ah, ok. I completely missed that subtlety but it makes sense. The 500 error is caused by your proxy server which times out as the server takes too long to process the request. This is why an error is not logged in the database too - the request is simply cancelled upstream by the proxy server.

So, it would appear that the backend system takes too long to process the shipment with > 1,000 items at once. I'm not suprised really as it was not something that we have considered! I would say this is not a "bug" per-se, but certainly we could look at whether the backend request could be optimized to speed up the request processing - or offload it to the backgroun worker.

I'll add the "fund" tag to this, if you are able to contribute to a "fix" for this it would be appreciated :)

SchrodingersGat avatar Oct 06 '24 10:10 SchrodingersGat

Ah yes that makes sense. it also takes long to load the SO in total.

And not a bug i understand what you mean but would higly appreciat if this could be fixed asap, seems like a small fix.

What did you have in mind for Fund? and how to do so. i mention already earlier that is no usse as the tool itself is wonderfull :-)

please instruct me to wher or how to do so.

mabroens avatar Oct 06 '24 10:10 mabroens

Done 😊

mabroens avatar Oct 06 '24 11:10 mabroens

@SchrodingersGat sorry to ask but any idea when this update will be rolled out? i would very much like to finisch this shipment so i also have my stock up to date.

mabroens avatar Oct 16 '24 07:10 mabroens

@mabroens there is still a fair bit of work left on this release. For now can you split into multiple smaller shipment? The issue is that the API call takes longer than the timeout on your proxy server

SchrodingersGat avatar Oct 16 '24 07:10 SchrodingersGat