# Connection Error - Help Required

**URL:** https://forum.mautic.org/t/connection-error-help-required/25606
**Category:** Product Support
**Created:** [October 6, 2022, 12:03pm UTC](https://forum.mautic.org/t/connection-error-help-required/25606 "2022-10-06T12:03:03Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [October 6, 2022, 12:03pm UTC](https://forum.mautic.org/t/connection-error-help-required/25606/1 "2022-10-06T12:03:03Z")

</div>

**Your software**  
My Mautic version is: 4.4.1  
My PHP version is: 8.0  
My Database type and version is: Ver 15.1 Distrib 10.6.7-MariaDB

**Your problem**  
My problem is:  
We are seeing a number of connection errors in the log on connection - it is sporadic, but would like to see if there is a way to pinpoint what they are and if there is a way to correct the situation.  
The site is a high traffic site.

These errors are showing in the log:  
mautic.error:2022/09/13 06:39:05 [crit] 139582#139582: \*1202945 SSL\_read() failed (SSL: error:0A000126:SSL routines::unexpected eof while reading) while processing HTTP/2 connection, client: 199.999.222.999, server: 0.0.0.0:443

Steps I have tried to fix the problem:  
Nothing as of yet besides writing here 🙂

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [October 6, 2022, 12:29pm UTC](https://forum.mautic.org/t/connection-error-help-required/25606/2 "2022-10-06T12:29:12Z")

</div>

Can you share more about the setup? Docker? VPS? LXC?

---

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [October 6, 2022, 12:30pm UTC](https://forum.mautic.org/t/connection-error-help-required/25606/3 "2022-10-06T12:30:11Z")

</div>

Hey Joey,

Yes,  
Manual setup on Ubuntu 22.04 dedicated server, running php 8.0.  
2 Intel vCPU  
4GB Memory  
1GB Swap enabled

openssl version -a

```auto
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
built on: Mon Jul 4 11:20:23 2022 UTC
platform: debian-amd64
options: bn(64,64)
compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -ffile-prefix-map=/build/openssl-Q8dQt3/openssl-3.0.2=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_TLS_SECURITY_LEVEL=2 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
OPENSSLDIR: "/usr/lib/ssl"
ENGINESDIR: "/usr/lib/x86_64-linux-gnu/engines-3"
MODULESDIR: "/usr/lib/x86_64-linux-gnu/ossl-modules"
Seeding source: os-specific
CPUINFO: OPENSSL_ia32cap=0xfffa3223478bffff:0x818d19e07a9

```

lab\_release -a

```auto
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.1 LTS
Release:	22.04
Codename:	jammy

```

nginx -V

```auto
nginx version: nginx/1.22.0
built by gcc 11.2.0 (Ubuntu 11.2.0-19ubuntu1) 
built with OpenSSL 3.0.2 15 Mar 2022
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-g -O2 -ffile-prefix-map=/data/builder/debuild/nginx-1.22.0/debian/debuild-base/nginx-1.22.0=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'

```

---

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [October 6, 2022, 12:41pm UTC](https://forum.mautic.org/t/connection-error-help-required/25606/4 "2022-10-06T12:41:24Z")

</div>

I am also seeing other errors that may be of concern:

```auto
mautic.error:2022/10/03 00:25:15 [error] 572614#572614: *666425 FastCGI sent in stderr: "PHP message: PHP Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permissio
n denied (13) in /var/www/mautic/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php on line 106" while reading response header from upstream, client: 199.999.99.99, server: mymautic.com, request: "GET /mtc.js HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.0-fpm.sock:", host: "mymautic.com", referrer: "http://localhost:4200/"

```

and this:

```auto
mautic.error:2022/10/03 01:15:51 [error] 572613#572613: *670110 connect() to unix:/run/php/php8.0-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 199.999.99.99,
 server: mymautic.com, request: "GET /mtc.js HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.0-fpm.sock:", host: "mymautic.com", referrer: "https://mywebsite.com/"

```

and

```auto
mautic.error:2022/10/04 01:13:57 [error] 572614#572614: *788447 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 199.999.99.99, server: mymautic.com, request: "GET /mtc.js HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.0-fpm.sock", host: "mymauitc.com", referrer: "https://mywebsite.com/"

```

and

```auto
mautic.error:2022/10/04 01:15:42 [error] 572613#572613: *789210 connect() to unix:/run/php/php8.0-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 199.999.99.99,
 server: mymautic, request: "GET /?utm_source=mautic&utm_medium=email&utm_campaign=announcements&utm_content=web-welcome HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.0-fpm.sock:", host: "mymautic.com"

```

@joeyk - what do you think about this article: [nginx - php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream - Server Fault](https://serverfault.com/questions/843460/php-fpm-sock-failed-11-resource-temporarily-unavailable-while-connecting-to-u) ?

---

<div class="post-metadata">

### Author: ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)
#### Post date: [October 7, 2022, 6:19am UTC](https://forum.mautic.org/t/connection-error-help-required/25606/5 "2022-10-07T06:19:49Z")

</div>

clearly not a Mautic issue, I would think - rather openSSL, maybe in conjunction with nginx and/or HTTP/2…  
See e.g. [SSL\_read() failed (SSL: error:0A000126:SSL routines::unexpected eof while reading) · Issue #18866 · openssl/openssl · GitHub](https://github.com/openssl/openssl/issues/18866) where an nginx update helped.

Cheers  
Ekke

---

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [October 7, 2022, 10:36am UTC](https://forum.mautic.org/t/connection-error-help-required/25606/6 "2022-10-07T10:36:31Z")

</div>

Hi Ekke

Thanks for the reply. I already upgraded to latest nginx version a while ago.

Any thoughts on the error for

mautic.error:2022/10/03 00:25:15 [error] 572614#572614: \*666425 FastCGI sent in stderr: “PHP message: PHP Notice: SessionHandler::gc(): ps\_files\_cleanup\_dir: opendir(/var/lib/php/sessions) failed: Permissio n denied (13) in /var/www/mautic/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php on line 106” while reading response header from upstream, client: 199.999.99.99, server: [mymautic.com](http://mymautic.com), request: “GET /mtc.js HTTP/2.0”, upstream: “fastcgi://unix:/run/php/php8.0-fpm.sock:”, host: “[mymautic.com](http://mymautic.com)”, referrer: “[http://localhost:4200/](http://localhost:4200/)”

---

<div class="post-metadata">

### Author: ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)
#### Post date: [October 7, 2022, 1:17pm UTC](https://forum.mautic.org/t/connection-error-help-required/25606/7 "2022-10-07T13:17:28Z")

</div>

Looks like a read and write issue to the directory.

Check your php.ini and look for something like  
`session.save_path=`

What it’s set to and check permission on that folder.

---

<div class="post-metadata">

### Author: ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)
#### Post date: [October 7, 2022, 1:51pm UTC](https://forum.mautic.org/t/connection-error-help-required/25606/8 "2022-10-07T13:51:12Z")

</div>

> [@mikew](#):
>
> SessionHandler::gc(): ps\_files\_cleanup\_dir: opendir(/var/lib/php/sessions) failed: Permissio n denied (13) in /var/www/mautic/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php

Not sure this is related to the original symptom. Quick [Google search result](https://stackoverflow.com/questions/2904862/issues-with-php-5-3-and-sessions-folder) recommends setting `session.gc_probability = 0` 🙂

---

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [October 11, 2022, 6:55am UTC](https://forum.mautic.org/t/connection-error-help-required/25606/9 "2022-10-11T06:55:06Z")

</div>

Thanks @ekke , this is set to 0 already (I guess by default)…

@techbill in my php.ini this is actually commented out,

```auto
session.save_path = "/var/lib/php/sessions"

```

The files inside this directory all have permissions of www-data:www-data

---

<div class="post-metadata">

### Author: ![IonutOjicaDe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ionutojicade/32/7383_2.png) [@IonutOjicaDe](https://forum.mautic.org/u/IonutOjicaDe)
#### Post date: [December 4, 2022, 3:57pm UTC](https://forum.mautic.org/t/connection-error-help-required/25606/10 "2022-12-04T15:57:21Z")

</div>

May I ask, how did you solved the error? I have it also.  
In my /etc/php/7.4/cli/php.ini are also:  
`session.gc_probability = 0` set  
and  
`session.save_path = "/var/lib/php/sessions"` commented out.  
Did you uncommented the “path” line? Or simply ignored the error?

---

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [December 5, 2022, 8:01am UTC](https://forum.mautic.org/t/connection-error-help-required/25606/11 "2022-12-05T08:01:31Z")

</div>

I do not think I ever solved this. I have noticed that Mautic does not work that nicely with ubuntu 22.04 and php8.0

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [December 5, 2022, 8:08am UTC](https://forum.mautic.org/t/connection-error-help-required/25606/12 "2022-12-05T08:08:12Z")

</div>

We use 18.04 cause I saw issues even with 20.04.
