Plesk issues with trying to run UNA - APACHE/NGINX Issues (solved go to bottom for my current nginx directives)(Still Upstream Errors)

I seen media manager and the photo editor teases and I had to come back. I was getting a little discouraged and the media manager is a feature I have been wanting for a long time so happy to see it is in the works. I decided to not use Cyberpanel this time and use PLESK instead. Still having issues so site is inoperable. If you had similar issues with Plesk, please share and help if able.

**Update I got cron working, just did full path to the cron file and it is good. Noticing every time I log in and out in multiple browsers I have to refresh though. That is not normal. Same thing with going into studio sometimes have to relog in like 5 times. Logs showing no errors. 

I am going to paste what troubleshooting I have done so far just for help for other in case they have issues as well. 

Kyle
05:10
Nope i hit run now which is nice comes up sucessful and no email with errors. I even toggled between php 7.4 and 8 in the system and on the scheduled task but same thing. No java error and logs are good. I noticed no una logs in the una log folder though is that normal? No errors in UNA side for the cron jobs jsut shows message no cron tab created for radiomyvybz (radio site) which is 100% the case, but shows me its working.
Kyle
05:33
image_transcoder.php?o=bx_froala_image&h=5426&dpx=1&t=1632569033
Kyle
05:41

What I do have are some CHMOD errors in one of the site logs I am looking through: Warning: file_exists(): open_basedir restriction in effect. File(/var/www/vhosts/) is not within the allowed path(s): (/var/www/vhosts/domain/:/tmp/) in /var/www/vhosts/domain /httpdocs/inc/classes/BxDolStorageLocal.php on line 140PHP message: PHP Warning: mkdir(): open_basedir restriction in effect. File(/var/www/vhosts/) is not within the allowed path(s): (/var/www/vhosts/domain /:/tmp/) in /var/www/vhosts/domain /httpdocs/inc/classes/BxDolStorageLocal.php on line 141PHP message: PHP Warning: chmod(): open_basedir restriction in effect. File(/var/www/vhosts/) is not within the allowed path(s): (/var/www/vhosts/domain /:/tmp/) in /var/www/vhosts/domain/httpdocs/inc/classes/BxDolStorageLocal.php on line 142', referer: domain / --- I am stumped, because I remember something similar I had to do with Cyberpanel and do not remember what we did. I am going to skim the php.ini and remove the allowed path and see what it does. Sorry for the bold, I wanted it to stand out from the error. *update* atleast got rid of the chmod error - looks like the liveupdate php also handles the cache so could have been related. Restarted Apache and PHP and going to try a couple different browsers/private modes. Nope same thing, log in, does not show you in unless you refresh the page and same with any changes like themes etc. on a side note now I see the php being recognized by the server audit which is wierd and did not matter, but nice anyways, It has version there just no OK until now. Rewrite module shows undefined, but that is fine it is there and in apache. It is just behaving like it did with Cyberpanel and showing undefined. Also I now have the UNA update file in log folder so CHMOD was fixed but still same problem sadly :D listed my new error below from site error log.

Kyle
7 minutes ago

After fixing the CHMOD error which was blocking the BXDOLLiveUpdates I am now getting the following I believe when logging in and out and testing so may be a step closer. I am going to manually clear the cache.[Sat Sep 25 06:10:31.509352 2021] [proxy_fcgi:error] [pid 84104:tid 139710521407232] [client IP :0] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to a member function genDbCacheKey() on null in /var/www/vhosts/domain/httpdocs/inc/classes/BxDolLiveUpdates.php:200\nStack trace:\n#0. Manually clearing cache and reboot Apache and PHP 8.0 failed, trying server reboot.

Reboot failed to clear, going to reinstall UNA and repopulate database. Possibly due to the errors on first install, maybe something was missed or corrupted. 

I even uninstalled just now/ reinstalled and did so with both PHP7.4 and php 8.0 and same exact thing. I wonder if it is the cron, but everything is pointing at it running correctly. I am absolutely stumped. Cron logs shows the cron job running every minute as it should be. Both when I had it on 7.4 and now back on 8.0. However I am still still the error up above I am realtime watching the log as I log out, refresh, login, refresh and that same error. Each install I have completely cleared the database. 

Everything at this point is surrounding this error I believe: [proxy_fcgi:error] [pid 84104:tid 139710521407232] [client IP :0] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to a member function genDbCacheKey() on null in /var/www/vhosts/domain/httpdocs/inc/classes/BxDolLiveUpdates.php:200\nStack trace:\n#0. 

Here is the full log entry every time same error: 

[Sat Sep 25 08:42:05.998139 2021] [proxy_fcgi:error] [pid 19779:tid 140580906587904] [client IP0] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Call to a member function genDbCacheKey() on null in /var/www/vhosts/domain/httpdocs/inc/classes/BxDolLiveUpdates.php:200\nStack trace:\n#0 

/var/www/vhosts/domain/httpdocs/inc/classes/BxDolLiveUpdates.php(193): BxDolLiveUpdates->_getCacheKey()\n#1 

/var/www/vhosts/domain/httpdocs/inc/classes/BxDolLiveUpdates.php(205): BxDolLiveUpdates->_getCacheInfo()\n#2 

/var/www/vhosts/domain/httpdocs/inc/classes/BxDolLiveUpdates.php(233): BxDolLiveUpdates->_getCached()\n#3 

/var/www/vhosts/domain/httpdocs/inc/classes/BxDolLiveUpdates.php(113): BxDolLiveUpdates->_getCachedSystems()\n#4 

/var/www/vhosts/domain/httpdocs/live_updates.php(16): BxDolLiveUpdates->perform()\n#5 {main}\n  thrown in 

/var/www/vhosts/domain/httpdocs/inc/classes/BxDolLiveUpdates.php on line 200', referer: https://domain/

image_transcoder.php?o=bx_froala_image&h=5429&dpx=1&t=1632604006

I tried and and had Leonid helping me too, but still same thing. It is fine until you do a login/logout action and then it is all refreshing from there. At this time it is basically the barebones, I have not installed anything no modules or anything at this point. Plesk does use Nginx and Plesk and does caching by default so this could be a big part of it. 

image_transcoder.php?o=bx_froala_image&h=5430&dpx=1&t=1632604946

I had Plesk take a look and this is what they shared after doing the same troubleshooting we tried: 

Thank you for providing additional details, I was able to reproduce it.


Now allow me to summarize my findings.

In regards to the reported issue, the PHP-FPM pool(/var/log/plesk-php80-fpm/error.log) throws an exception(that is being redirected to the apache2 logs):

[26-Sep-2021 08:19:39] WARNING: [pool myvybz.com] child 45723 said into stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function genDbCacheKey() on null in /var/www/vhosts/myvybz.com/httpdocs/inc/classes/BxDolLiveUpdates.php:200"
[26-Sep-2021 08:19:39] WARNING: [pool myvybz.com] child 45723 said into stderr: "Stack trace:"
[26-Sep-2021 08:19:39] WARNING: [pool myvybz.com] child 45723 said into stderr: "#0 /var/www/vhosts/myvybz.com/httpdocs/inc/classes/BxDolLiveUpdates.php(193): BxDolLiveUpdates->_getCacheKey()"
[26-Sep-2021 08:19:39] WARNING: [pool myvybz.com] child 45723 said into stderr: "#1 /var/www/vhosts/myvybz.com/httpdocs/inc/classes/BxDolLiveUpdates.php(205): BxDolLiveUpdates->_getCacheInfo()"
[26-Sep-2021 08:19:39] WARNING: [pool myvybz.com] child 45723 said into stderr: "#2 /var/www/vhosts/myvybz.com/httpdocs/inc/classes/BxDolLiveUpdates.php(233): BxDolLiveUpdates->_getCached()"
[26-Sep-2021 08:19:39] WARNING: [pool myvybz.com] child 45723 said into stderr: "#3 /var/www/vhosts/myvybz.com/httpdocs/inc/classes/BxDolLiveUpdates.php(113): BxDolLiveUpdates->_getCachedSystems()"
[26-Sep-2021 08:19:39] WARNING: [pool myvybz.com] child 45723 said into stderr: "#4 /var/www/vhosts/myvybz.com/httpdocs/live_updates.php(16): BxDolLiveUpdates->perform()"
[26-Sep-2021 08:19:39] WARNING: [pool myvybz.com] child 45723 said into stderr: "#5 {main}"
[26-Sep-2021 08:19:39] WARNING: [pool myvybz.com] child 45723 said into stderr: " thrown in /var/www/vhosts/myvybz.com/httpdocs/inc/classes/BxDolLiveUpdates.php on line 200"

Hence, the _getCacheKey($sType) returns a variable without any value(e.g. zero) to the listening function. Further questions in regards to this behavior are to be addressed to the application developers.


I would also have to add the following information to your request. Using a chrome tab with image_transcoder.php?o=bx_froala_image&h=5431&dpx=1&t=1632668994 option checked, the issue wasn't reproduced.

image_transcoder.php?o=bx_froala_image&h=5432&dpx=1&t=1632669004


Hence, the application indeed supplies with an incorrect cache.


Now in regards to your other thoughts:


a) It is possible to change the myvybz.com from Apache2+Nginx to Nginx only hosting following the steps from the next article:

  1. Log in to Plesk.

  2. Go to Domains > domain > Apache & nginx Settings.

  3. In the Nginx settings section, disable the Proxy mode setting.

b) By default Plesk is using brotli compression via Nginx, and I can see it enabled:

# curl -ILs https://domain -H "Accept-Encoding: gzip,br" | grep content-encoding
content-encoding: br

It can be disabled by adding an extra Nginx directive as described here:

  1. Log in to Plesk.

  2. Go to Domains > domain > Apache & nginx Settings.

  3. Add an extra Nginx add directive: "brotli off;"


In addition. For some reason, the application is making attempts to reach the apache2ctl binary:

[26-Sep-2021 08:16:59] WARNING: [pool domain] child 45524 said into stderr: "which: no apachectl in ((null))"
[26-Sep-2021 08:16:59] WARNING: [pool domain] child 45524 said into stderr: "which: no apache2ctl in ((null))"
[26-Sep-2021 08:16:59] WARNING: [pool domain] child 45524 said into stderr: "which: no /usr/local/apache/bin/apachectl in ((null))"
[26-Sep-2021 08:16:59] WARNING: [pool domain] child 45524 said into stderr: "which: no /usr/local/apache/bin/apache2ctl in ((null))"

Meanwhile, this isn't connected to the reported issue, it is a good security question to the application developers.

Hence, summarizing the investigation results:

There is a code issue, that makes a child process crash when handling a cache. In case switching to Nginx only mode and disabling the brotli cache doesn't help here, please consider contacting the application developers in regards to the PHP error within the log files. 

Latest Update: If you disable Apache Proxy and go straight NGINX it will not load images or load your uploaded images, but there is no longer a cache issue. Just all images end up being not found even if you upload them. At this point I guess I need to go full NGINX and figure out how to setup a config, always have used Apache. Anyone have a sample config they can share? Tried the one here by Alex https://unacms.com/page/view-discussion?id=133, but images are not loading. 

Decided not to due to the full path and do the following: 

location / {

            index index.html index.htm index.php;

 

            rewrite "^/page/(.*)$" /page.php?i=$1 last;

            rewrite "^/m/(.*)$" /modules/index.php?r=$1 last;

            rewrite "^/s/([a-zA-Z0-9_]+)/([a-zA-Z0-9\.]+)" /storage.php?o=$1&f=$2 last;

 

            if (!-e $request_filename ) {

                rewrite  ^/(.+)$  /r.php?_q=$1  last;

                break;

            }

        }

If you use Plesk, just edit the following and do not worry like me, red it not bad if the code is correct: 

image_transcoder.php?o=bx_froala_image&h=5433&dpx=1&t=1632673519

If anyone know how to get GZIp to work with NGINX etc please share if you know. 

What I got so far in my Additional nginx directives box (Was advised to make all changes here so make sure formatting is exact to not get errors) : As you can tell in Plesk it knew already being these settings are for this domain so no need to put path. 

location / {

    index index.html index.htm index.php;

    rewrite "^/page/(.*)$" /page.php?i=$1 last;

    rewrite "^/m/(.*)$" /modules/index.php?r=$1 last;

    rewrite "^/s/([a-zA-Z0-9_]+)/([a-zA-Z0-9\.]+)" /storage.php?o=$1&f=$2 last;

    if (!-e $request_filename ) {

        rewrite  ^/(.+)$  /r.php?_q=$1  last;

        break;

    }

}

# PROXY SETTINGS

proxy_buffer_size          128k;

proxy_buffers              4 256k;

proxy_busy_buffers_size    256k;

# FASTCGI

fastcgi_buffers 16 16k;

fastcgi_buffer_size 32k;

# GZIP COMPRESSION

gzip on;

gzip_proxied any;

gzip_types text/plain text/xml text/css application/x-javascript;

gzip_vary on;

gzip_disable “MSIE [1-6]\.(?!.*SV1)”;

Brotli is enabled by default. I wanted to give it a try so I re enabled it after disabling it earlier. This will be completely up to you. I will update if I run into any issues with it. Compared to GZIP it has better compression in terms of size and better performance. 

To keep GZIP do the following in SSH: sudo plesk bin nginx -d brotli to disable Brotli 

If going Brotli do not do anything it is already there in latest version of PLESK. If you accidentally disable it or change your mind do the following in SSH: sudo plesk bin nginx -e brotli

I noticed GZIP still loading so added the following directives to bottom: 

gzip off;

brotli on;

Due to some modules I use and love, I also reverted back to PHP 7.4 for now. 

I now ran into more issues with timeout in Apps Market and other areas of site so did following: 

sesion time

proxy_connect_timeout 900;

proxy_send_timeout 900;

fastcgi_send_timeout 900;

fastcgi_read_timeout 900;

Still dealing with an upstream issue I can not figure out. It is still there when installing modules sadly not sure why no blocked ports it would not go through at all. Guess at this point I will never know, but for other who have PLESK/NGINX in the future here are my NGINX directives: 

location / {

    index index.html index.htm index.php;

    rewrite "^/page/(.*)$" /page.php?i=$1 last;

    rewrite "^/m/(.*)$" /modules/index.php?r=$1 last;

    rewrite "^/s/([a-zA-Z0-9_]+)/([a-zA-Z0-9\.]+)" /storage.php?o=$1&f=$2 last;

    if (!-e $request_filename ) {

        rewrite  ^/(.+)$  /r.php?_q=$1  last;

        break;

    }

}

# PROXY SETTINGS

proxy_buffering on;

proxy_buffer_size 128k;

proxy_buffers 4 256k;

proxy_busy_buffers_size 256k;

# FASTCGI

fastcgi_buffers 16 16k;

fastcgi_buffer_size 32k;

sesion time

proxy_connect_timeout 900;

proxy_send_timeout 900;

fastcgi_send_timeout 900;

fastcgi_read_timeout 900;

gzip off;

brotli on;

Alex T⚜️ LeonidS 

  • 4269
  • More
Replies (2)
    Login or Join to comment.