# Server Error 500 --\> session which are beeing locked / timedout?

**URL:** <https://forum.shopware.com/t/server-error-500-session-which-are-beeing-locked-timedout/89754>\
**Category:** International (English Only)\
**Created:** [13. August 2021 um 21:16 UTC](https://forum.shopware.com/t/server-error-500-session-which-are-beeing-locked-timedout/89754 "2021-08-13T21:16:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rtomas](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@rtomas](https://forum.shopware.com/u/rtomas)\
**Post date:** [13. August 2021 um 21:16 UTC](https://forum.shopware.com/t/server-error-500-session-which-are-beeing-locked-timedout/89754/1 "2021-08-13T21:16:39Z")

</div>

Hi,  
We have a recurrent issue ( **Shopware 5.4.6** Build Rev 201807181357) when for example I open a preview of a product file from  
the back-end and then all the shop (all pages) is producing a Server Error 500.

For some minutes the web site is in ‚black out‘ 😮  
In the server log we have found  
\<\<  
[Thu Aug 12 00:00:35.185338 2021] [:error] [pid 20936:tid 140645385074432] [client 2a01:cb10:113:2400:68fd:ad30:ec9a:c67f:58756] FastCGI: server „/home/…/php5-fcgi-\*-80-tux21.trendhosting-net.ch“ stderr: PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction in /home/…/Shopware/Components/Session/PdoSessionHandler.php:536, referer: htt …/

[Thu Aug 12 00:00:35.185382 2021] [:error] [pid 20936:tid 140645385074432] [client 2a01:cb10:113:2400:68fd:ad30:ec9a:c67f:58756] FastCGI: server „/home/…“ stderr: Stack trace:, referer: htt …/

[Thu Aug 12 00:00:35.185405 2021] [:error] [pid 20936:tid 140645385074432] [client 2a01:cb10:113:2400:68fd:ad30:ec9a:c67f:58756] FastCGI: server „/home/…s/php5-fcgi-\*-80-tux21.trendhosting-net.ch“ stderr: #0 /home/…/htdocs/engine/Shopware/Components/Session/PdoSessionHandler.php(536): PDOStatement-\>execute(), referer: htt …/

[Thu Aug 12 00:00:35.185412 2021] [:error] [pid 20936:tid 140645385074432] [client 2a01:cb10:113:2400:68fd:ad30:ec9a:c67f:58756] FastCGI: server „/home/…/php5-fcgi-\*-80-tux21.trendhosting-net.ch“ stderr: #1 /home/…/htdocs/engine/Shopware/Components/Session/PdoSessionHandler.php(291): Shopware\Components\Session\PdoSessionHandler-\>doRead(‚15d45683c996c31…‘), referer: htt …/

[Thu Aug 12 00:00:35.185417 2021] [:error] [pid 20936:tid 140645385074432] [client 2a01:cb10:113:2400:68fd:ad30:ec9a:c67f:58756] FastCGI: server „/home/…/php5-fcgi-\*-80-tux21.trendhosting-net.ch“ stderr: #2 [internal function]: Shopware\Components\Session\PdoSessionHandler-\>read(‚15d45683c996c31…‘), referer: htt …/

[Thu Aug 12 00:00:35.185423 2021] [:error] [pid 20936:tid 140645385074432] [client 2a01:cb10:113:2400:68fd:ad30:ec9a:c67f:58756] FastCGI: server „/home/…/php5-fcgi-\*-80-tux21.trendhosting-net.ch“ stderr: #3 /home/…/htdocs/engine/Library/Zend/Session.php(481): session\_start(), referer: htt …/

[Thu Aug 12 00:00:35.185428 2021] [:error] [pid 20936:tid 140645385074432] [client 2a01:cb10:113:2400:68fd:ad30:ec9a:c67f:58756] FastCGI: server „/home/…“ stderr: #4 /home/…/htdocs/engine/Shopware/Components/DependencyInjection/Bridge/Session.php(105): Zend\_Session::start(Array), referer: htt …/

[Thu Aug 12 00:00:35.185435 2021] [:error] [pid 20936:tid 140645385074432] [client 2a01:cb10:113:2400:68fd:ad30:ec9a:c67f:58756] FastCGI: server „/home/…/php5-fcgi-\*-80-tux21.trendhosting-net.ch“ stderr: #5 /home/…/var/cache/production\_201807181357/proxies/ShopwareProduction47d1dce28dbd034a3cb7a3f576d693fce18c6df8ProjectContainer.php(1303): Shopware\…, referer: htt …/

> >

so we think the solution can be (not sure at all) to disable session locking in shopware.

In the official documentation:

> **[Shopware Session handling](https://developers.shopware.com/sysadmins-guide/sessions/)**
>
> Shopware Session handling

​#### Disable locking[Anchor link for: disable locking](https://developers.shopware.com/sysadmins-guide/sessions/#disable-locking)

As of Shopware 5.2.13, you can disable the session locking for the database handler:

```auto
'session' => ['save_handler' => 'db', 'locking' => false]

```

but if I include this code to config.php the site crashed.

Any clue/help please?  
Thanks a lot

---

<div class="post-metadata">

**Author:** ![LenaForlin](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/lenaforlin/32/13485_2.png) [@LenaForlin](https://forum.shopware.com/u/LenaForlin)\
**Post date:** [2. September 2021 um 07:20 UTC](https://forum.shopware.com/t/server-error-500-session-which-are-beeing-locked-timedout/89754/2 "2021-09-02T07:20:42Z")

</div>

Hello rtomas,

If there are many calls on a session, a deadlock error can appear. Disabling the session locking could lead to race conditions, so it is not suited to be a permanent solution.

- Check for third party plugins which negatively affect your shop
- Using a faster session handler, for example Redis: [Shopware Session handling](https://developers.shopware.com/sysadmins-guide/sessions/#redis)
- Not recommended: Temporarily disabling the session locking (Danger: race conditions can appear): [config.php settings](https://developers.shopware.com/developers-guide/shopware-config/#session-locking)

While adding content in the config.php, you have to ensure that the code added is valid, or the site will no longer be reachable. Example:

```auto
<?php
return [
    'db' => [
        'username' => 'yourUsername',
        'password' => 'yourPassword',
        'dbname' => 'yourDbname',
        'host' => 'yourHost',
        'port' => 'yourPort'
    ],

   'session' => [
        'locking' => false,
    ],
];

```

If you do not have a lot of traffic, the issue is most likely caused by a plugin which is causing too many calls on the session.
