I have just successfully installed the newest version 8.6.0 and everything is working fine when opening the site directly, from my local network. But when I configure my HAProxy to open the site from outside my network it does not load correctly – the top menu bar is corrupt. See the pictures below.
The only difference I saw while debugging from my browser is a ‘bad gateway’ error (502) on the graphql request. Any clue how can I troubleshoot that?
I have already spent a day with an assistance of ChatGPT, checking tons of things in HAProxy settings, but they seem to be good, besides this is not the only site I am opening via HAProxy and this is the only one that is experiencing such issues.
Yes, that in public/legacy/config.php file.
Please set your site_url to your external URL of your HAProxy for your Suite, like this: 'site_url' => 'https://crm.mysite.tld/'
…and try to browse to your public Suite URL, from outside your network.
Report back here, does it work or no.
That 502 Bad Gateway is from HAProxy.
The logs you shared were from suite’s apache. Instead, you need to look at the php error log, and the suite application error log. More info here:
Since there no special error_log definition in my php.ini-- the PHP errors are being logged in the regular Apache’s error.log.
There is nothing there except for the errors I deliberately generated to confirm where the errors are being logged (last two lines):
marek@suitecrm:/var/www/html/suitecrm/public$ tail -f /var/log/apache2/error.log
[Sun May 05 00:00:01.566951 2024] [ssl:warn] [pid 117855] AH01906: suitecrm.net-extend.pl:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sun May 05 00:00:01.567041 2024] [ssl:warn] [pid 117855] AH01909: suitecrm.net-extend.pl:443:0 server certificate does NOT include an ID which matches the server name
[Sun May 05 00:00:01.567232 2024] [mpm_prefork:notice] [pid 117855] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Sun May 05 00:00:01.567240 2024] [core:notice] [pid 117855] AH00094: Command line: '/usr/sbin/apache2'
[Sun May 05 18:42:02.420105 2024] [php:warn] [pid 132446] [client 192.168.131.1:13618] PHP Warning: Undefined variable $undefinedVariable in /var/www/html/suitecrm/public/test.php on line 3
[Sun May 05 18:42:07.310184 2024] [php:warn] [pid 132446] [client 192.168.131.1:13618] PHP Warning: Undefined variable $undefinedVariable in /var/www/html/suitecrm/public/test.php on line 3
There is not much in the suitecrm.log either. I set the log level to Error in the configuration.
There is no difference between the bad (via HAProxy) and good (direct) environments:
Bad:
Sun May 5 20:12:43 2024 [133476][1][ERROR] Unable to find relationship projects_contacts_resources
Sun May 5 20:12:43 2024 [133476][1][ERROR] Unable to find relationship am_projecttemplates_contacts_resources
Sun May 5 20:12:43 2024 [133476][1][ERROR] Unable to find relationship projects_contacts_resources
Sun May 5 20:12:43 2024 [133476][1][ERROR] Unable to find relationship am_projecttemplates_contacts_resources
Sun May 5 20:12:43 2024 [133486][1][ERROR] Unable to find relationship projects_contacts_resources
Sun May 5 20:12:43 2024 [133486][1][ERROR] Unable to find relationship am_projecttemplates_contacts_resources
Sun May 5 20:12:43 2024 [133486][1][ERROR] Unable to find relationship projects_contacts_resources
Sun May 5 20:12:43 2024 [133486][1][ERROR] Unable to find relationship am_projecttemplates_contacts_resources
Good:
Sun May 5 20:13:07 2024 [133474][1][ERROR] Unable to find relationship projects_contacts_resources
Sun May 5 20:13:07 2024 [133474][1][ERROR] Unable to find relationship am_projecttemplates_contacts_resources
Sun May 5 20:13:07 2024 [133474][1][ERROR] Unable to find relationship projects_contacts_resources
Sun May 5 20:13:07 2024 [133474][1][ERROR] Unable to find relationship am_projecttemplates_contacts_resources
Sun May 5 20:13:07 2024 [133477][1][ERROR] Unable to find relationship projects_contacts_resources
Sun May 5 20:13:07 2024 [133477][1][ERROR] Unable to find relationship am_projecttemplates_contacts_resources
Sun May 5 20:13:07 2024 [133477][1][ERROR] Unable to find relationship projects_contacts_resources
Sun May 5 20:13:07 2024 [133477][1][ERROR] Unable to find relationship am_projecttemplates_contacts_resources
So, it must be something about HAProxy.
I have plenty of web applications what are being opened through HAproxy (Discourse forum like this one included), and I do not experience such issues
hi @mwojtaszek ,
did you solve the problem? I have the same error setting up Ngnix as reverse proxy.
If you solved maybe could help me. Anyway I think I will open a new topic as well here.
Actually, I gave up for now. What worked for me was either using a Cloudflare Zero Trust (aka Cloudflare tunnel) or a port forwarding on a router. I was not able to make the reverse proxy working, unfortunately.
The menu does not appear and if we inspect what is going on, a 502 Bad Gateway error is returned when requesting a POST to https://xxxx.xxxx.xxx.xx/api/graphql
We can see that there are some requests to the same graphql uri that do work.
The one that doesn’t work is the one that is close to 3 MB. Could it be that HAProxy is closing this connection too soon?
The number of headers received by the POST to https://xxxx.xxxx.xxx.xx/api/graphql was larger than the default maximum in HAProxy. Changed this configuration and voilá… fixed.