# Shopware Backend Order Not Work

**URL:** <https://forum.shopware.com/t/shopware-backend-order-not-work/36687>\
**Category:** Allgemein\
**Created:** [11. Mai 2016 um 12:38 UTC](https://forum.shopware.com/t/shopware-backend-order-not-work/36687 "2016-05-11T12:38:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![testusernetwork1](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@testusernetwork1](https://forum.shopware.com/u/testusernetwork1)\
**Post date:** [11. Mai 2016 um 12:38 UTC](https://forum.shopware.com/t/shopware-backend-order-not-work/36687/1 "2016-05-11T12:38:08Z")

</div>

Hai.,

I got the Following errors, when I click the “Customer—\> Order”

&nbsp;

**Oops! An error has occurred!**

**&nbsp; &nbsp;&nbsp;  
&nbsp; &nbsp; &nbsp; &nbsp; The following notes should help you.  
&nbsp; &nbsp;&nbsp;**

**&nbsp; &nbsp; An exception occurred while executing ‘SELECT count(DISTINCT s0\_.id) AS sclr0 FROM s\_order s0\_ LEFT JOIN s\_core\_paymentmeans s1\_ ON s0\_.paymentID = s1\_.id LEFT JOIN s\_core\_states s2\_ ON s0\_.cleared = s2\_.id LEFT JOIN s\_core\_states s3\_ ON s0\_.status = s3\_.id LEFT JOIN s\_order\_billingaddress s4\_ ON s0\_.id = s4\_.orderID LEFT JOIN s\_user s5\_ ON s0\_.userID = s5\_.id LEFT JOIN s\_order\_details s6\_ ON s0\_.id = s6\_.orderID LEFT JOIN s\_core\_countries s7\_ ON s4\_.countryID = s7\_.id LEFT JOIN s\_core\_countries\_states s8\_ ON s4\_.stateID = s8\_.id LEFT JOIN s\_core\_shops s9\_ ON s0\_.subshopID = s9\_.id LEFT JOIN s\_premium\_dispatch s10\_ ON s0\_.dispatchID = s10\_.id LEFT JOIN s\_order\_billingaddress\_attributes s11\_ ON s4\_.id = s11\_.billingID LEFT JOIN &nbsp;WHERE s0\_.status NOT IN (’-1’) AND s0\_.ordernumber IS NOT NULL’:**

**SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘WHERE s0\_.status NOT IN (’-1’) AND s0\_.ordernumber IS NOT NULL’ at line 1 in vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php on line 91**

**&nbsp; &nbsp; Stack trace:  
&nbsp; &nbsp;&nbsp;  
 #0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(702): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(PDOException), ‘SELECT count(DI…’, Array)  
 #1 vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php(50): Doctrine\DBAL\Connection-\>executeQuery(‘SELECT count(DI…’, Array, Array, NULL)  
 #2 vendor/doctrine/orm/lib/Doctrine/ORM/Query.php(286): Doctrine\ORM\Query\Exec\SingleSelectExecutor-\>execute(Object(Doctrine\DBAL\Connection), Array, Array)  
 #3 vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(794): Doctrine\ORM\Query-\>\_doExecute()  
 #4 vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(598): Doctrine\ORM\AbstractQuery-\>execute(NULL, 3)  
 #5 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php(143): Doctrine\ORM\AbstractQuery-\>getScalarResult()  
 #6 Shopware/Controllers/Backend/Order.php(357): Doctrine\ORM\Tools\Pagination\Paginator-\>count()  
 #7 Shopware/Controllers/Backend/Order.php(330): Shopware\_Controllers\_Backend\_Order-\>getList(NULL, NULL, ‘0’, ‘20’)  
 #8 Enlight/Controller/Action.php(159): Shopware\_Controllers\_Backend\_Order-\>getListAction()  
 #9 Enlight/Controller/Dispatcher/Default.php(524): Enlight\_Controller\_Action-\>dispatch(‘getListAction’)  
 #10 Enlight/Controller/Front.php(227): Enlight\_Controller\_Dispatcher\_Default-\>dispatch(Object(Enlight\_Controller\_Request\_RequestHttp), Object(Enlight\_Controller\_Response\_ResponseHttp))  
 #11 Shopware/Kernel.php(143): Enlight\_Controller\_Front-\>dispatch()  
 #12 vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(490): Shopware\Kernel-\>handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)  
 #13 Shopware/Components/HttpCache/AppCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)  
 #14 vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(261): Shopware\Components\HttpCache\AppCache-\>forward(Object(Symfony\Component\HttpFoundation\Request), true)  
 #15 Shopware/Components/HttpCache/AppCache.php(103): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>pass(Object(Symfony\Component\HttpFoundation\Request), true)  
 #16 shopware.php(101): Shopware\Components\HttpCache\AppCache-\>handle(Object(Symfony\Component\HttpFoundation\Request))  
 #17 {main}**  
&nbsp; &nbsp;&nbsp;  
&nbsp;

---

<div class="post-metadata">

**Author:** ![Heiner\_Lohaus](https://avatars.discourse-cdn.com/v4/letter/h/b5a626/32.png) [@Heiner\_Lohaus](https://forum.shopware.com/u/Heiner_Lohaus)\
**Post date:** [11. Mai 2016 um 12:55 UTC](https://forum.shopware.com/t/shopware-backend-order-not-work/36687/2 "2016-05-11T12:55:16Z")

</div>

Hello,

your&nbsp;foreign keys&nbsp;seems to be corrupted. This article may help you:

> **[Shopware Dokumentation](https://docs.shopware.com/de)**

Heiner

---

<div class="post-metadata">

**Author:** ![testusernetwork1](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@testusernetwork1](https://forum.shopware.com/u/testusernetwork1)\
**Post date:** [11. Mai 2016 um 14:52 UTC](https://forum.shopware.com/t/shopware-backend-order-not-work/36687/3 "2016-05-11T14:52:21Z")

</div>

Hai.,

I have repair the Database as said in the above link.  
But the error not solved
