Prestashop error 503 when importing large csv file - prestashop

I'm importing a large csv file (arround 30k lines) with the native importer of Prestashop (1.7.6.7) but i crashes (most often after the data validation).
I'm running my web server with apache and php fpm 7.2. Here are the logd i get :
Jun 25 10:00:01.490369 2021] [proxy_fcgi:error] [pid 18083:tid 139680320476928] [client 176.141.207.46:63302] AH01067: Failed to read FastCGI header, referer: https://preprod.motogoodeal.ch/admin5473ukqbi/index.php?controller=AdminImport&token=bf736a3ca6f1406cf822f2dd9c22f028
[Fri Jun 25 10:00:01.490404 2021] [proxy_fcgi:error] [pid 18083:tid 139680320476928] (104)Connection reset by peer: [client 176.141.207.46:63302] AH01075: Error dispatching request to : , referer: https://preprod.motogoodeal.ch/admin5473ukqbi/index.php?controller=AdminImport&token=bf736a3ca6f1406cf822f2dd9c22f028
It worked before

Pls check PHP Parameters with your host provider such as :
allow_url_fopen = On
allow_url_include = Off
asp_tags = Off
display_errors = Off
enable_dl = Off
file_uploads = On
max_execution_time = 30
max_input_time = 60
max_input_vars = 50000
memory_limit = 512M
session.save_path = ""
upload_max_filesize = 128M
but you need input the right value for each one based on your needs and hosting's resources

I solved this by increasing the pm.max_children value :)

Related

Enable HTTP2 in Apache 2.4.53

After reading this link, it's clear that HTTP2 and prefork don't work together. I am trying to get around this issue by disabling prefork in MPM.
I went and changed the httpd-mpm.conf and commented out the following statements:
<IfModule mpm_prefork_module>
#StartServers 5
#MinSpareServers 5
#MaxSpareServers 10
#MaxRequestWorkers 250
#MaxConnectionsPerChild 0
</IfModule>
and in my httpd.conf file i have enabled the module
LoadModule http2_module modules/mod_http2.so
and added the following configuration:
Protocols h2 h2c http/1.1
H2Direct on
I see no errors in my error log which are as follows:
[Thu Apr 14 23:03:59.295852 2022] [ssl:warn] [pid 18592:tid 220] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Apr 14 23:03:59.297852 2022] [mpm_winnt:notice] [pid 18592:tid 220] AH00455: Apache/2.4.53 (Win64) OpenSSL/1.1.1n configured -- resuming normal operations
[Thu Apr 14 23:03:59.297852 2022] [mpm_winnt:notice] [pid 18592:tid 220] AH00456: Apache Lounge VS16 Server built: Mar 16 2022 11:26:15
[Thu Apr 14 23:03:59.298852 2022] [core:notice] [pid 18592:tid 220] AH00094: Command line: 'httpd.exe -d C:/Users/naraadia/.softwares/Apache24_2.4.53'
[Thu Apr 14 23:03:59.320854 2022] [mpm_winnt:notice] [pid 18592:tid 220] AH00418: Parent: Created child process 14840
[Thu Apr 14 23:04:00.406963 2022] [ssl:warn] [pid 14840:tid 228] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Apr 14 23:04:00.449967 2022] [mpm_winnt:notice] [pid 14840:tid 228] AH00354: Child: Starting 64 worker threads.
and none of my pages being served by the server have HTTP2 or h2 protocol in developer tools. All the pages have http/1.1 protocol. Is there a better way to achieve HTTP2 protocol being pushed? I feel prefork is still not disabled.
I have downloaded the server zip file and not compiled the server.
EDIT 1 : After Reading the mod_http2 documentation, it's clear that winnt mpm strategy is being used.
I tried to check if curl helps in determining if HTTP2 is enabled or not but when I run
curl -I --http2 http://localhost:8083 | findstr HTTP
It returns nothing.
Can anyone help in enabling HTTP2 or help in determining what is missing?
I went and changed the httpd-mpm.conf and commented out the following statements:
Those statments were wrapped in an <IfModule mpm_prefork_module> so would only be used if that module was enabled.
EDIT 1 : After Reading the mod_http2 documentation, it's clear that winnt mpm strategy is being used.
That's correct. Apache on windows uses it's own mpm module, which is compatible with HTTP/2.
and none of my pages being served by the server have HTTP2 or h2 protocol in developer tools. All the pages have http/1.1 protocol. Is there a better way to achieve HTTP2 protocol being pushed? I feel prefork is still not disabled.
Browsers only support HTTP/2 over HTTPS. Looks like, from your curl command, that you are only using unencrypted HTTP, rather than HTTPS. So this will not work, even though you have enabled H2Direct - both client and server need to support this to work and you have only enabled it on the server and cannot enable this on the browser.
I tried to check if curl helps in determining if HTTP2 is enabled or not but when I run
curl -I --http2 http://localhost:8083 | findstr HTTP
It returns nothing.
Using HTTP/2 over HTTP (rather than HTTPS) requires an upgrade header and round trip, though that is going to be deprecated. You should use --http2-prior-knowledge if wanting to use HTTP/2 over HTTP and are sure the server supports it.

Apache Internal Sever Error after 5 minutes of waiting for a response using Dev Desktop on Win 10

I use xdebug with VS Code to inspect variables on my local Drupal 8 installation on Win 10, but after approximately 5 minutes (it is always the same amount of time) I get an Internal Server Error and can't inspect my variables any longer. I tried increasing memory_limit in my php.ini file but to no effect. I increased max_execution_time in php.ini and nothing changed. I increased FcgidIOTimeout and FcgidMaxRequestLen in httpd.conf and nothing changed. I got the following output from C:\Program Files (x86)\DevDesktop\apache\logs\error.log :
[Sat May 25 12:37:02.785838 2019] [fcgid:warn] [pid 21796:tid 1112]
(OS 109)The pipe has been ended. : [client 127.0.0.1:61083]
mod_fcgid: get overlap result error, referer:
http://drupal.dd:8083/node [Sat May 25 12:37:02.785838 2019]
[core:error] [pid 21796:tid 1112] [client 127.0.0.1:61083] End of
script output before headers: index.php, referer:
http://drupal.dd:8083/node
Please help.

Custom error log in apache2

In apache log file I am getting long messages such as:
[Wed Feb 21 19:32:18.916451 2018] [:error] [pid 23919] [client 10.0.2.2:50156] Error Message...
How I can get custom log message like:
Format:[Time] [Message]
[19:32:18] Error Message....
Put
ErrorLogFormat "[%{c}t] %M"
in apache config file (supposedly, /etc/apache2/apache2.conf)
Other formatting options you can find in https://httpd.apache.org/docs/2.4/mod/core.html#errorlogformat

HHVM With FCGI and APACHE show 500 Internal Server Error

Hy,
I have succesfully installed hhvm on my ubuntu 14.04 server. I can run codes from terminal with the following code.
hhvm test.php
The problem is when I want to access my webpage from browser I get 500 Internal Server Error. In the error log I have found the following lines.
[Fri Apr 24 14:26:37.377998 2015] [fcgid:warn] [pid 40696] (104)Connection reset by peer: [client 192.168.65.221:50382] mod_fcgid: error reading data from FastCGI server
[Fri Apr 24 14:26:37.378029 2015] [core:error] [pid 40696] [client 192.168.65.221:50382] End of script output before headers: index.php
I am using Apache web server with ISPConfig 3 to handle domains and other stuff.
Does anyone know how to handle this situation?
Thanks in advance, David.

Apache Proxy Error

I am getting the following error intermittently on my server:
**Proxy Error**
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.
Reason: Error reading from remote server
The error logs show the following:
[Sun Feb 06 03:06:00 2011] [error] [client 82.43.154.57] proxy: Error reading from remote server returned by /login, referer: https://demo.XXXXX.us/
[Sun Feb 06 03:06:30 2011] [error] [client 82.43.154.57] (70007)The timeout specified has expired: proxy: error reading status line from remote server XXXXX.us
[Sun Feb 06 03:06:30 2011] [error] [client 82.43.154.57] proxy: Error reading from remote server returned by /
[Sun Feb 06 03:13:31 2011] [error] [client 82.43.154.57] (70007)The timeout specified has expired: proxy: error reading status line from remote server XXXXX.us
[Sun Feb 06 03:13:31 2011] [error] [client 82.43.154.57] proxy: Error reading from remote server returned by /
I have read a lot of posts suggesting connection timeout settings in tomcat and environment settings in Apache. I have set the following in httpd.conf:
<VirtualHost *>
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
</VirtualHost>
I have also set the following in tomcat server.xml:
<Connector port="9080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="9443" acceptCount="100"
connectionTimeout="60000" disableUploadTimeout="true" />
Also, once the error occurs, I have to start a new browser for the error to disappear as it continues to show even on a refresh. Secondly, I am using htaccess to rewrite the url. Don't know if this has any impact on the error?
EDIT>
My server is running on 150mb of free memory at normal times and can drop quite low but not at the exact times of the above error. Would this cause such an error?
I would appreciate any ideas people have.
Thank you.
This was an issue with Pear Mailer.
We were using Pear Mailer which uses a queue to stack emails ready for sending with a cron job. There was an error in the Pear script which was being called on every action on our site (making posts, sending messages etc..). Pear was crashing which in turn crashed the browser resulting in the above errors.
Disabling Pear resolved the problem, and tweaking the code got it working again.
It took so long to find the issue as we never thought Pear Mailer could cause such a response.
we had a similar problem on our server after a mysql crash, and the only solution was to restart the server.