3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
254 stars 143 forks source link

[Bug]: error 500 originating in /var/www/lizmap-web-client-3.5.1/lizmap/modules/lizmap/lib/Request/Proxy.php ? #3332

Closed ccloquet closed 1 year ago

ccloquet commented 1 year ago

What is the bug?

When requesting a WMS,

eg : http://*****/lizmap/index.php/lizmap/service/?repository=projet1&project=2022_abc&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

i receive a 500 error.

In /var/www/lizmap-web-client-3.5.1/lizmap/var/log/errors.log, i read : "Object of class Lizmap\App\JelixContext could not be converted to string"

I could fix it by inserting the followinf condition : if (json_encode($options['body']) != '{}')

in the block:

if ($options['method'] === 'post') {
            curl_setopt($ch, CURLOPT_POST, 1);
            if (!empty($options['body']))
            {
                    if (json_encode($options['body']) != '{}')
                    {
                    error_log(json_encode($options['body']));
                    curl_setopt($ch, CURLOPT_POSTFIELDS, $options['body']);
                    }
            }
        }

What is the root cause, and how can it be fixed?

Regards,

Christophe

Steps to reproduce the issue

Request a WMS like : http://*****/lizmap/index.php/lizmap/service/?repository=projet1&project=2022_abc&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities,

Versions

Plugin is unable to fetch the version installed on the server: 3.5.1

Check Lizmap plugin

QGIS server version, only if the section above doesn't mention the QGIS Server version

3.22

Operating system

Ubuntu 22.04

Browsers

Firefox, Chrome

Browsers version

Version 1.45.123 Chromium: 107.0.5304.110 (Build officiel) (64 bits)

Relevant log output

No response

Gustry commented 1 year ago

Thanks for trying to debug by yourself.

installed on the server: 3.5.1

We are now at version version 3.5.7. Maybe the source of the problem has already been fixed. Can you try ?

3liz-bot commented 1 year ago

This issue is missing some feedbacks. 👻 Please have a look to the discussion, thanks. 🦎