# Fehler: 500 und 503, SQLSTATE(08004) (1040) Too many connections

**URL:** <https://forum.shopware.com/t/fehler-500-und-503-sqlstate-08004-1040-too-many-connections/59702>\
**Category:** Allgemein\
**Created:** [24. Mai 2019 um 11:43 UTC](https://forum.shopware.com/t/fehler-500-und-503-sqlstate-08004-1040-too-many-connections/59702 "2019-05-24T11:43:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Getzoo](https://avatars.discourse-cdn.com/v4/letter/g/f4b2a3/32.png) [@Getzoo](https://forum.shopware.com/u/Getzoo)\
**Post date:** [24. Mai 2019 um 11:43 UTC](https://forum.shopware.com/t/fehler-500-und-503-sqlstate-08004-1040-too-many-connections/59702/1 "2019-05-24T11:43:34Z")

</div>

Hallo, vielleicht hat hier wer eine Idee. Ich habe sporadisch diesen Fehler auf meinem Devshop. Die Seite lädt dann sehr lange und dann kommt dieser Fehler bei raus, woran könnte das Problem liegen, das er zu viele Verbindungen zur Datenbank aufbaut? Viele Grüße, Thomas

```
Channel: core
request:	
{
    "uri": "/backend/widgets/getLastOrders?_dc=1558697595196&page=1&start=0&limit=25",
    "method": "GET",
    "query": {
        "_dc": "1558697595196",
        "page": "1",
        "start": "0",
        "limit": "25",
        "module": "backend",
        "controller": "widgets",
        "action": "getLastOrders"
    },
    "post": []
}

RuntimeException: Could not connect to database. Message from SQL Server: SQLSTATE(08004) (1040) Too many connections in /engine/Shopware/Components/DependencyInjection/Bridge/Db.php:76 Stack trace:
#0 /engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php(513): Shopware\Components\DependencyInjection\Bridge\Db::createPDO(Array)
#1 /engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php(369): Shopware_Plugins_Backend_Auth_Bootstrap->createSaveHandler(Object(ShopwareProduction848e0ed9018f82ce933306af81420882d546e34bProjectContainer))
#2 /engine/Library/Enlight/Event/Handler/Plugin.php(149): Shopware_Plugins_Backend_Auth_Bootstrap->onInitResourceBackendSession(Object(Enlight_Event_EventArgs))
#3 /engine/Library/Enlight/Event/EventManager.php(256): Enlight_Event_Handler_Plugin->execute(Object(Enlight_Event_EventArgs))
#4 /engine/Shopware/Components/DependencyInjection/Container.php(195): Enlight_Event_EventManager->notifyUntil('Enlight_Bootstr...', Object(Enlight_Event_EventArgs))
#5 /engine/Shopware/Components/DependencyInjection/Container.php(156): Shopware\Components\DependencyInjection\Container->doLoad('backendsession')
#6 /engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php(391): Shopware\Components\DependencyInjection\Container->load('backendsession')
#7 /engine/Library/Enlight/Event/Handler/Plugin.php(149): Shopware_Plugins_Backend_Auth_Bootstrap->onInitResourceAuth(Object(Enlight_Event_EventArgs))
#8 /engine/Library/Enlight/Event/EventManager.php(256): Enlight_Event_Handler_Plugin->execute(Object(Enlight_Event_EventArgs))
#9 /engine/Shopware/Components/DependencyInjection/Container.php(195): Enlight_Event_EventManager->notifyUntil('Enlight_Bootstr...', Object(Enlight_Event_EventArgs))
#10 /engine/Shopware/Components/DependencyInjection/Container.php(138): Shopware\Components\DependencyInjection\Container->doLoad('auth', 1)
#11 /engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php(226): Shopware\Components\DependencyInjection\Container->get('auth')
#12 /engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php(207): Shopware_Plugins_Backend_Auth_Bootstrap->checkAuth()
#13 /engine/Library/Enlight/Event/Handler/Plugin.php(149): Shopware_Plugins_Backend_Auth_Bootstrap->onPreDispatchBackend(Object(Enlight_Controller_ActionEventArgs))
#14 /engine/Library/Enlight/Event/EventManager.php(219): Enlight_Event_Handler_Plugin->execute(Object(Enlight_Controller_ActionEventArgs))
#15 /engine/Library/Enlight/Controller/Action.php(170): Enlight_Event_EventManager->notify('Enlight_Control...', Object(Enlight_Controller_ActionEventArgs))
#16 /engine/Library/Enlight/Controller/Dispatcher/Default.php(563): Enlight_Controller_Action->dispatch('popupAction')
#17 /engine/Library/Enlight/Controller/Front.php(222): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#18 /engine/Shopware/Kernel.php(202): Enlight_Controller_Front->dispatch()
#19 /vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php(102): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(448): Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(Object(Shopware\Kernel), Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /engine/Shopware/Components/HttpCache/AppCache.php(260): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#22 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(238): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#23 /engine/Shopware/Components/HttpCache/AppCache.php(105): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true)
#24 /html/shop/shopware.php(122): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#25

RuntimeException: Could not connect to database. Message from SQL Server: SQLSTATE(HY000) (1040) Too many connections in /engine/Shopware/Components/DependencyInjection/Bridge/Db.php:76 Stack trace:
#0 /engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php(513): Shopware\Components\DependencyInjection\Bridge\Db::createPDO(Array)
#1 /engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php(369): Shopware_Plugins_Backend_Auth_Bootstrap->createSaveHandler(Object(ShopwareProduction848e0ed9018f82ce933306af81420882d546e34bProjectContainer))
#2 /engine/Library/Enlight/Event/Handler/Plugin.php(149): Shopware_Plugins_Backend_Auth_Bootstrap->onInitResourceBackendSession(Object(Enlight_Event_EventArgs))
#3 /engine/Library/Enlight/Event/EventManager.php(256): Enlight_Event_Handler_Plugin->execute(Object(Enlight_Event_EventArgs))
#4 /engine/Shopware/Components/DependencyInjection/Container.php(195): Enlight_Event_EventManager->notifyUntil('Enlight_Bootstr...', Object(Enlight_Event_EventArgs))
#5 /engine/Shopware/Components/DependencyInjection/Container.php(156): Shopware\Components\DependencyInjection\Container->doLoad('backendsession')
#6 /engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php(391): Shopware\Components\DependencyInjection\Container->load('backendsession')
#7 /engine/Library/Enlight/Event/Handler/Plugin.php(149): Shopware_Plugins_Backend_Auth_Bootstrap->onInitResourceAuth(Object(Enlight_Event_EventArgs))
#8 /engine/Library/Enlight/Event/EventManager.php(256): Enlight_Event_Handler_Plugin->execute(Object(Enlight_Event_EventArgs))
#9 /engine/Shopware/Components/DependencyInjection/Container.php(195): Enlight_Event_EventManager->notifyUntil('Enlight_Bootstr...', Object(Enlight_Event_EventArgs))
#10 /engine/Shopware/Components/DependencyInjection/Container.php(138): Shopware\Components\DependencyInjection\Container->doLoad('auth', 1)
#11 /engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php(226): Shopware\Components\DependencyInjection\Container->get('auth')
#12 /engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php(207): Shopware_Plugins_Backend_Auth_Bootstrap->checkAuth()
#13 /engine/Library/Enlight/Event/Handler/Plugin.php(149): Shopware_Plugins_Backend_Auth_Bootstrap->onPreDispatchBackend(Object(Enlight_Controller_ActionEventArgs))
#14 /engine/Library/Enlight/Event/EventManager.php(219): Enlight_Event_Handler_Plugin->execute(Object(Enlight_Controller_ActionEventArgs))
#15 /engine/Library/Enlight/Controller/Action.php(170): Enlight_Event_EventManager->notify('Enlight_Control...', Object(Enlight_Controller_ActionEventArgs))
#16 /engine/Library/Enlight/Controller/Dispatcher/Default.php(563): Enlight_Controller_Action->dispatch('getLastOrdersAc...')
#17 /engine/Library/Enlight/Controller/Front.php(222): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#18 /engine/Shopware/Kernel.php(202): Enlight_Controller_Front->dispatch()
#19 /vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php(102): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(448): Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(Object(Shopware\Kernel), Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /engine/Shopware/Components/HttpCache/AppCache.php(260): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#22 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(238): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#23 /engine/Shopware/Components/HttpCache/AppCache.php(105): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true)
#24 /html/shop/shopware.php(122): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#25

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![TimmeHosting](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/timmehosting/32/15580_2.png) [@TimmeHosting](https://forum.shopware.com/u/TimmeHosting)\
**Post date:** [24. Mai 2019 um 12:10 UTC](https://forum.shopware.com/t/fehler-500-und-503-sqlstate-08004-1040-too-many-connections/59702/2 "2019-05-24T12:10:57Z")

</div>

Ist das evtl. ein Shared Hosting? Ich könnte mir vorstellen, dass Du evtl. Nachbarn auf dem Server hast, die die Datenbank zu stark in Anspruch nehmen.

![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/385eaa628505df573ebf33722f780335f53ac1b2.png)

Timme Hosting - schnelles nginx-Hosting

[www.timmehosting.de](https://timmehosting.de/)

---

<div class="post-metadata">

**Author:** ![Getzoo](https://avatars.discourse-cdn.com/v4/letter/g/f4b2a3/32.png) [@Getzoo](https://forum.shopware.com/u/Getzoo)\
**Post date:** [24. Mai 2019 um 12:31 UTC](https://forum.shopware.com/t/fehler-500-und-503-sqlstate-08004-1040-too-many-connections/59702/3 "2019-05-24T12:31:01Z")

</div>

Tatächlich ist es ein managed vServer von Mittwald, werde ich den Support mal befragen müssen. Ich dachte nur im ersten Moment das Shopware vielleicht zu viele Verbindungen zur Datenbank aufbaut.
