Error The Shipment not found - CS-Cart 4.18.1

Where the problem occurred:
Store Builder Version CS-Cart 4.18.1 // PHP Version 8.1.28 // Firefox 125.0.3 (64-bit) (also tried other web browsers - same result) No special/custom Add-ons

Details of the problem:
We migrated our test store to a new server and upgraded from CS-Cart 4.13.1.SP2 to 4.18.1 and we just noticed that orders already in the system WITH shipping/tracking information already entered come up with an “Error The Shipment not found” warning when saving the order. Existing orders WITHOUT shipping/tracking information already entered also do not have a place to add the shipping information (that shipping area section is completely missing to enter tracking information). Brand new orders after the update seem to work perfectly fine though - the shipping area exists, linked to the order, and tracking (once entered) shows up just fine. It’s like the connection/link to the shipping information was cut somehow with all of the existing orders.

Write what the problem is
5 Screenshots attached. (below(?))

How to reproduce the problem:

  1. Spin up a CS-Cart 4.13.1.SP2 version (starting with PHP 7.4), add multiple test order data (at least 4-10 various orders) - some with shipping/tracking information entered, some without (order status does not seem to matter, but you can mix it up).
  2. Upgrade the cart to CS-Cart 4.18.1 (upgrade PHP version to 8.1 when able to do so. Also, skip backups ;), then look at any of the existing orders WITH tracking already added and just try to “Save” them (no changes need to be made within the order) - the “Error The Shipment not found” should pop up - also notice if the shipping area where tracking is added exists or not for orders WITHOUT shipping/tracking info added (orders that had tracking entered is still there, but do not appear to be “linked” to the order anymore). Then add some new orders and see that those work just fine.


UPDATE: So it doesn’t seem like the upgrade itself is causing the problem. I rebuilt the new test server yet again and transferred over all the data (files and database info, deleted the /var/cache folder again) and that is where the problem exists with the existing orders not wanting to keep the shipping/tracking information linked/tied to the orders, but I don’t see why this is the case, as the shipping data is still in the database, just not linked anymore to the orders somehow. Has anyone else experienced this??
So, a new way to reproduce the error (maybe in any version, but we are currently at CS-Cart 4.13.1.SP2 with PHP7.4), have a store created with multiple orders and some of those orders with dummy shipping/tracking information already entered (and some orders with multiple items for shipment and partially shipped items as if you need to add more shipping information later to complete the order and some orders with no Shipping information added), then transfer the entire store to a brand new server. Then look at those existing orders to see if the Shipping information / tracking section stayed linked to the order when trying to “Save” the order and you can create more tracking “New shipment >” for the partially shipped orders already created before the migration. This one doesn’t make sense as to why the whole Shipping information / tracking section is missing or unlinked from the existing orders - brand new orders on the new test server work just fine with the Shipping information area. Any thoughts would be appreciated! Thanks in advance…

Troubleshooting Info: On the new good orders with Shipping information, no errors occur, but on the existing orders on the new test server, I get these errors:
[18-May-2024 14:16:33 *****] PHP Notice: unserialize(): Error at offset 2043 of 2559 bytes in /public_html/app/functions/fn.cart.php on line 2171
[18-May-2024 14:16:33 *****] PHP Warning: Invalid argument supplied for foreach() in /public_html/app/functions/fn.cart.php on line 2173
[18-May-2024 14:16:33 *****] PHP Notice: unserialize(): Error at offset 3934 of 17062 bytes in /public_html/app/functions/fn.cart.php on line 2380

Seems like a serialize/unserialize issue maybe(?) My database Server connection collation is set to: utf8mb4_unicode_ci on both servers…

Any idea on how to fix this issue?

SOLVED: Sorry everyone, this one appears to be PEBKAC Error (Problem Exists Between Keyboard And Chair)… :thinking:
This is not a bug as far as I can tell and can be closed.
So the way we have been migrating/upgrading our store over to new servers in the past has been to compress and dump all of the files and copy the database over, then modify the entire MySQL database file before importing it into the new test server to be able to use a different new domain name until the store is upgraded and tested. Then we convert the database domain name back in reverse when ready to go live on the new test server as the new home for our store. We use sed statements on the MySQL database file - the “before update and testing” would be:
sed -i ‘s|||g’ ./MySQLDatabaseName.sql
then import the database into the new test server. Update config.local.php file,
and once all is updated/good to go, the “after update and testing” command to put things back would be: export database, then use:
sed -i ‘s|||g’ ./MySQLDatabaseName.sql
then re-import the database into the new test server, update config.local.php file and point the live domain DNS to the new upgraded server home IP.
I’m guessing we never caught the order shipping serialize/unserialize issue during testing while using the testing domain as the shipping would work just fine again once we put the domain name back to the live store domain and the characters matched up exactly again. Anyway, sorry again, but hopefully this will help others learn more about the all-around great shopping cart that is CS-CART… :wink:

1 Like