There has been an error processing your request Magento 2.3.4

{"0":"SQLSTATE[HY000] [2002] No such file or directory","1":"#1 Zend_Db_Adapter_Pdo_Mysql->_connect() called at [vendor\/magento\/framework\/DB\/Adapter\/Pdo\/Mysql.php:410]\n#2 Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql->_connect() called at [vendor\/magento\/zendframework1\/library\/Zend\/Db\/Adapter\/Abstract.php:861]\n#3...

Im receiving this kinda errors on var/log there is bunch of similar errors…I dont know what does it says, can someone explain about this…How do i fix this

This type of error looks like a consequence/side-effect from MySQL hanging or crashing. Digging a little deeper into the logs might give you a hint towards the actual cause of MySQL hanging or crashing.

Thanks for the reply Craig,

I don’t understand anything, it ends similar to this

"url":"\/brands?brand=325&concern=523%2C525%2C542&product_list_order=position","script_name":"\/index.php","report_id":"021495a8ef8d699a5764f428792f0b580eaea7a002d2a1a496a3f113affd462a"}

is it something related to configuration of products, like they are misaligned/misconfigured. I guess so because brand is a Attribute and 325 is ID

I’m afraid that doesn’t give us much to go on. Please, include the bulk of the log at the relevant timestamp. Ensure that you check bhoth exception.log and system.log entries. And what exactly you were doing at the time the error occurred (to add some context)

Sure Craig,

I have attached the most recent error log, At this time the site was displaying There has been an error processing your request and after few sec it came back to normal. Also i have noticed that the RAM is dying to process this. Out of 3951 MB only 87 MB left | (free -m command)

ram usage

I remember couple months ago this was happened were i was adding products, it took too much time to save. then i click reload on browser, it displayed the error message on front end. Also I was not allowed to index or clear the cache for few sec… then it get back to normal. Same thing happened again on last 7th of march, were Some peoples/bot were trying to Create a new account using fake Russian word with some fake urls, The same message was displayed “There has been an error processing your request”, so i removed this customers, enabled the Captcha & Recaptch for Logins & Signups…Then i have decided to upgrade magneto version to V2.3.4 from 2.3. I figured there is bug on Theme and extensions also, But some errors are not related to any.

So, I guess it comes down to:

  • MySQL misconfiguration or
  • Something in Magento hogging MySQL resources

You might find some decent leads in the MySQL Slow Query Log that can point you in the right direction.

You may also benefit from slightly increasing your Innodb Buffer Pool Size from its default value to maybe double. e.g. 128M to 256M. Don’t go too high as you’ll do far more harm than good on a server with only 4GB of memory.

Hi Craig, thank you for the helping me,

  1. I’ll go through MySQL Slow Query Log, thanks for finding it for me.

  2. I did tried to increase innodb buffer pool size after watching your 36 Magento 2 tips video, The problem is that the value is not changed after saving still remains 128 MiB. is there any other way to change?

Can i modify etc/my.cnf max_connections=100 to some number, will it help. i saw people suggesting this on internet.

What size of RAM would you recommend for me? i have 6K+ of SKU’s.

I tried to increase Innodb Buffer Pool Size. to 256 MiB using phpmyadmin as root user, then on terminal sudo service mysql restart, nothing worked, the value is set back to default 128 MiB

Any changes you make in phpMyAdmin get reset when you restart mysql. You need to update your actual configuration file and then restart mysql.

1 Like

there is no my.cnf file on etc folder :face_with_monocle:

Your location will depend on your environment, such as your database manager (e.g. MySQL, MariaDB, Percona, etc…) and your Operating System (e.g. Ubuntu, CentOS, etc…). To help find the location of this file, I would recommend reaching out to https://unix.stackexchange.com.

However, if you originally followed this tutorial (How to install Magento 2.3 and build a web server), then you’ll want to edit: /etc/mysql/mysql.conf.d/mysqld.cnf

1 Like

Yeah that one helped me…Thank You :ok_hand:

Hi Craig, hope you doing good !

I did tried to increase innodb buffer pool size to 256M, the value have been saved successfully. but still also i’m getting “There has been an error processing your request” error message. Will it get fixed if i increase my RAM and CPU.

yes i did followed your video (How to install Magento 2.3 and build a web server)

Apologies for the delay in writing. Did you resolve your issue? If so, what steps did you take?

No Craig, I still have this problem, my site is under maintenance mode for long time.

Some people recommend me to modify env.php file [‘host’ => ‘localhost’, to ‘127.0.0.1’,], i don’t think its gonna work.

Help me if you found any solution.

[FIXED] This issue is because of lacking memory, Here are the following steps I have done to fix the issue

  • Separated database to another droplet. (I want you to create a Video Tutorial on this topic :pray:)
  • Installed the Geo Lock extension, so that the search engine bots engagement level will be decreased
  • CDN - configured to reduce the load
  • Enabled Recaptcha

Best my.cnf configuration for 4GB RAM

# SAFETY #
max-allowed-packet             = 16M
max-connect-errors             = 1000000
skip-name-resolve
sql-mode                       = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY
sysdate-is-now                 = 1
innodb                         = FORCE

# DATA STORAGE #
datadir                        = /var/lib/mysql/

# BINARY LOGGING #
log-bin                        = /var/lib/mysql/mysql-bin
expire-logs-days               = 14
sync-binlog                    = 1

# CACHES AND LIMITS #
tmp-table-size                 = 32M
max-heap-table-size            = 32M
query-cache-type               = 1
query-cache-size               = 64M
max-connections                = 500
thread-cache-size              = 50
open-files-limit               = 65535
table-definition-cache         = 1024
table-open-cache               = 2048

# INNODB #
innodb-flush-method            = O_DIRECT
innodb-log-files-in-group      = 2
innodb-log-file-size           = 128M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table          = 1
innodb-buffer-pool-size        = 2G

# LOGGING #
log-error                      = /var/lib/mysql/mysql-error.log
log-queries-not-using-indexes  = 1
slow-query-log                 = 1
slow-query-log-file            = /var/lib/mysql/mysql-slow.log

Tools Used:
MySQL Workbench

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.