Shopware Backend Bestellungen Serverfehler Error 500

If you encounter an AJAX error (Error 500) in the Shopware backend in the order overview (Customers->Orders) and cannot view all customer orders, it is advisable to check the Shopware error logs (directly in the backend or via var/log/). In our case, the error indicated that there were problems with the payment status. The exact error message in the log file was:

 

PHP Fatal error:  Uncaught TypeError: Argument 2 passed to Shopware\Components\StateTranslatorService::translateState() must be of the type array, null given, called in /engine/Shopware/Controllers/Backend/Order.php on line 1364 and defined in /engine/Shopware/Components/StateTranslatorService.php:58. Apparently, a payment status was present in one of the orders that could not be processed by the system. In this case, if you compare the existing statuses in the s_order table in the "cleared" column with the entries in the s_core_states table, you will hopefully find the source of the error quite easily. If an ID is entered in the s_order table that does not exist in s_core_states, this error occurs. If you delete the affected orders or change the status in the "cleared" column, everything works again.