Varnish error 503 - Where do I set http_resp_hdr_len?

Keywords: PrestaShop - Google Cloud Platform - Technical issue - Other
Description:
I am trying to migrate from a shared hosting service to gcloud, using the newest prestashop 1.7.6.8 bitnami stack.

I decided to enable varnish but I’m getting the 503 error. Searching online lead me to believe I need to change the http_resp_hdr_len parameter of varnish.

I’ve found in other community posts, paths to the config file where I could change the variable, but it seems the newest version of the stack doesn’t have any of the paths specified.

So how can I change the http_resp_hdr_len parametor?

Hi @jlago3577,

Thanks for using Bitnami. Can you give us a link to the posts you mention to try to better understand what are you trying to achieve?

Apart from that, we have a Support Tool that will gather relevant information for us to analyze your configuration and logs. Could you please execute it on the machine where the stack is running by following the steps described in the guide below?

Please note that you need to paste the code ID that is shown at the end.

Ive ran tje support tool, the code is: f376c491-a2ca-9c41-653c-3a8672f8b87f

Says here: https://bobcares.com/blog/varnish-error-503/ I need to increase the http_resp_hdr_len default value, but I do not know where that is located on the stack’s instalation of varnish.

Hi @jlago3577,

Thanks for the code. I visited your website and it is working fine for me. Did you manage to solve your issues?

The Varnish config file is at /opt/bitnami/varnish/etc/varnish/default.vcl. I see a couple of backup files there, so I understand you have already done any modification into this file. Did you remember to restart Varnish for changes to take effect?

sudo /opt/bitnami/ctlscript.sh restart varnish

I also see a lot of PHP errors in the Apache log, so maybe your issues are related to the Prestashop application itself and not Varnish? Note Varnish won’t serve anything to your clients if the reply was not properly generated from PHP

[Thu Oct 08 12:30:59.913641 2020] [proxy_fcgi:error] [pid 3099:tid 140226076747520] [client 127.0.0.1:33426] AH01071: Got error 'PHP message: PHP Notice:  tempnam(): file created in the system's temporary directory in /opt/bitnami/prestashop/classes/PrestaShopAutoload.php on line 258\nPHP message: PHP Warning:  rename(/tmp/class_index.phpCWgWIq,/opt/bitnami/prestashop/var/cache/prod/class_index.php): Permission denied in /opt/bitnami/prestashop/classes/PrestaShopAutoload.php on line 264\nPHP message: PHP Notice:  tempnam(): file created in the system's temporary directory in /opt/bitnami/prestashop/classes/PrestaShopAutoload.php on line 258\nPHP message: PHP Warning:  rename(/tmp/class_stub.phpaoeFi1,/opt/bitnami/prestashop/var/cache/prod/class_stub.php): Permission denied in /opt/bitnami/prestashop/classes/PrestaShopAutoload.php on line 264\nPHP message: PHP Notice:  tempnam(): file created in the system's temporary directory in /opt/bitnami/prestashop/classes/PrestaShopAutoload.php on line 258\nPHP message: PHP Warning:  rename(/tmp/namespaced_class_stub.phpUP4qSB,/opt/bitnami/prestashop/var/cache/prod/namespaced_class_stub.php): Permission denied in /opt/bitnami/prestashop/classes/PrestaShopAutoload.php on line 264\nPHP message: PHP Warning:  require_once(/opt/bitnami/prestashop/var/cache/prod/appParameters.php): failed to open stream: No such file or directory in /opt/bitnami/prestashop/config/bootstrap.php on line 87\nPHP message: PHP Fatal error:  require_once(): Failed opening required '/opt/bitnami/prestashop/var/cache/prod/appParameters.php' (include_path='/opt/bitnami/prestashop/vendor/pear/pear_exception:/opt/bitnami/prestashop/vendor/pear/console_getopt:/opt/bitnami/prestashop/vendor/pear/pear-core-minimal/src:/opt/bitnami/prestashop/vendor/pear/archive_tar:.:/opt/bitnami/php/lib/php') in /opt/bitnami/prestashop/config/bootstrap.php on line 87\n'
[Thu Oct 08 12:31:00.788750 2020] [proxy_fcgi:error] [pid 3099:tid 140226068354816] [client 127.0.0.1:33428] AH01071: Got error 'PHP message: PHP Notice:  tempnam(): file created in the system's temporary directory in /opt/bitnami/prestashop/classes/PrestaShopAutoload.php on line 258\nPHP message: PHP Warning:  rename(/tmp/class_index.php0cQsyu,/opt/bitnami/prestashop/var/cache/prod/class_index.php): Permission denied in /opt/bitnami/prestashop/classes/PrestaShopAutoload.php on line 264\nPHP message: PHP Notice:  tempnam(): file created in the system's temporary directory in /opt/bitnami/prestashop/classes/PrestaShopAutoload.php on line 258\nPHP message: PHP Warning:  rename(/tmp/class_stub.phpQWz4W8,/opt/bitnami/prestashop/var/cache/prod/class_stub.php): Permission denied in /opt/bitnami/prestashop/classes/PrestaShopAutoload.php on line 264\nPHP message: PHP Notice:  tempnam(): file created in the system's temporary directory in /opt/bitnami/prestashop/classes/PrestaShopAutoload.php on line 258\nPHP message: PHP Warning:  rename(/tmp/namespaced_class_stub.phpYtlIlN,/opt/bitnami/prestashop/var/cache/prod/namespaced_class_stub.php): Permission denied in /opt/bitnami/prestashop/classes/PrestaShopAutoload.php on line 264\nPHP message: PHP Warning:  require_once(/opt/bitnami/prestashop/var/cache/prod/appParameters.php): failed to open stream: No such file or directory in /opt/bitnami/prestashop/config/bootstrap.php on line 87\nPHP message: PHP Fatal error:  require_once(): Failed opening required '/opt/bitnami/prestashop/var/cache/prod/appParameters.php' (include_path='/opt/bitnami/prestashop/vendor/pear/pear_exception:/opt/bitnami/prestashop/vendor/pear/console_getopt:/opt/bitnami/prestashop/vendor/pear/pear-core-minimal/src:/opt/bitnami/prestashop/vendor/pear/archive_tar:.:/opt/bitnami/php/lib/php') in /opt/bitnami/prestashop/config/bootstrap.php on line 87\n', referer: http://localhost:8888/

Hi. I haven’t managed to solve the issue with varnish, what I ended up doing was removing varnish entirelly and adding just mod_pagespeed.

In regards to those errors with apache, they were fixed but varnish was still having the same 503 error issue. :confused:

I’m not sure how to change the http_resp_hdr_len in the default.vcl config file, as in what sintax to use and where on the file to place it.

Hi @jlago3577,

All the references I found to that parameter mention that you need to modify the command to start varnish to include the value you want. The arguments that are used when starting Varnish are defined in this file

sudo vim /opt/bitnami/scripts/varnish/run.sh

You can include there the argument you want and restart Varnish for the changes to take effect.

How did you fix those issues? Can you check what the permissions configuration is for this folder?

sudo ls -la /opt/bitnami/prestashop/var/cache/prod/

Thanks

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