WWBN / AVideo-Encoder

Encoder Server for AVideo Platform Open-Source
https://platform.avideo.com
GNU Affero General Public License v3.0
152 stars 189 forks source link

Encoder broken #500

Open para2022 opened 1 year ago

para2022 commented 1 year ago

The encoder is now broken after yesterdays update. Todays update doesn't fix it either. The encoder page is now a black blank page and nothing is recorded in logs. A fresh install doesn't fix it and nothing was changed on the server. Also been getting lots of php warnings in the log about other things from about a week ago that were not there before. I never had any errors in my logs as it worked perfectly until recently.

Thanks

DanielnetoDotCom commented 1 year ago

check your encoder and apache logs

para2022 commented 1 year ago

I have done and my php logs but no errors reported. I refresh the encoder page then check logs and nothing is reported. But in dev tools i get:

GET 500 (Internal Server Error)

The site is working but the encoder is now broken no matter how many times i reinstall it. It was fine before these updates. I did a git pull on the site and encoder and then went to the encoder page as i noticed those files were updated and at that point it never worked again, just a blank page. Rebooted. Switched php versions and cleared caches and nothing fixes the issue. I always check through the site after updates to see if anything breaks.

Thanks

para2022 commented 1 year ago

These errors also never end in my logs, it used to very clean before the updates i never had errors and its running about 2/3 speed now it has definitely slowed down:

[24-Mar-2023 21:31:02 Europe/London] PHP Warning: Undefined array key "HTTP_REFERER" in path/to/my/streamer/site/plugin/VideoHLS/VideoHLS.php(18) : eval()'d code(1) : eval()'d code on line 491

[24-Mar-2023 21:29:48 Europe/London] PHP Warning: Undefined array key "HTTP_REFERER" in path/to/my/streamer/site/plugin/CustomizeUser/CustomizeUser.php on line 470

[24-Mar-2023 21:29:48 Europe/London] PHP Warning: Undefined array key "HTTP_REFERER" in path/to/my/streamer/site/plugin/SecureVideosDirectory/SecureVideosDirectory.php(18) : eval()'d code(1) : eval()'d code on line 535

[24-Mar-2023 21:29:42 Europe/London] PHP Warning: imagecreatefromwebp(): gd-webp cannot allocate temporary buffer in path/to/my/streamer/site/objects/functions.php on line 1788

[24-Mar-2023 21:29:42 Europe/London] PHP Warning: imagecreatefromwebp(): "path/to/my/streamer/site/videos/cache/_jpg_641e164667451.jpg" is not a valid WEBP file in path/to/my/streamer/site/objects/functions.php on line 1932

[24-Mar-2023 21:29:42 Europe/London] PHP Warning: imagecreatefromwebp(): gd-webp cannot allocate temporary buffer in path/to/my/streamer/site/objects/functions.php on line 1788

[24-Mar-2023 23:28:41 Europe/Helsinki] PHP Warning: Undefined variable $id in path/to/my/streamer/site/objects/video.php on line 539

DanielnetoDotCom commented 1 year ago

you MUST find this 500 error, it MUST be somewhere in your logs.

try to change your apache conf to show all the errors

para2022 commented 1 year ago

no defo nothing in the logs only dev tools reports an error:

GEThttps://mysite.com/encoder/?noNavbar=1&webSiteRootURL=https://mysite.com/&user=Sammy&pass=_user_hash_ZSt6b2l5RnNyOGh3dHJ6NFY2c1lPRmZjUXVNeXV6ZDdXbGVLQkJranhwejhzZGJVc29wRWFoUUxjbjFnNkJXeXdSS2RMMjQyUWxRS3MrT3F2NWZ1Rm1SQ1huVis5WkhmZ2VUVk9rYjJPQ2M9&encodedPass=1 [HTTP/1.1 500 Internal Server Error 75ms]

DanielnetoDotCom commented 1 year ago

sorry if you cannot find the error I cannot help you

para2022 commented 1 year ago

The twin server hasnt been updated in 3 weeks it runs fine and the encoder works fine and i have no errors in the logs there as they are clean like the other server was before recent updates. I never make any server changes to the main server as it is a production server and runs as sweet as a nut it has 99.99% uptime. Thanks.

para2022 commented 1 year ago

It is a compatability issue with php8+ it works fine with php7.4 if i use any php8+ version it breaks and all those errors start in my avideo.log. Php 8+ is working fine on anything else utilising it. My marketing platform runs on that machine and it does not complain and runs fine with php8+. I have no errors in php logs.

DanielnetoDotCom commented 1 year ago

you must find the error to get some help, and it does work with php8, most of my servers are php 8.1 and 8.2, some 7.4 and 7.2

para2022 commented 1 year ago

Ok buddy i'll investigate further and report back when i fix it. As this hasnt been reported as yet by others on here it may well be a PHP problem here, which is odd, but il let you know.

para2022 commented 1 year ago

the server that was working fine (test server) was just updated also and as soon as i did the encoder broke. both have the exact same problem now on updating both sites. The sites both had no problems whatsoever until they were both updated and now both sites have broken encoders with the exact same issue. with php7.4 the encoder page will load and function, but it will not encode, it just hangs. No errors in the server logs regarding this, even in debug mode, php and apache. The encoder page is blank on both sites. The working test site was not updated for a couple of week and as soon as i did the encoder broken there too. So it is clearly not the servers but something after a recent change.

para2022 commented 1 year ago

The only error i can find on my system is this one in the encoder avideo.log not my streamer site avideo.log. I get the following error whenever i try to go to the encoder page:

[25-Mar-2023 01:40:18 UTC] PHP Fatal error: Uncaught Error: Class "Locale" not found in /www/html/public/encoder/locale/function.php:14 Stack trace:

0 /www/html/public/encoder/view/index.php(23): require_once()

1 {main}

thrown in /www/html/public/encoder/locale/function.php on line 14

DanielnetoDotCom commented 1 year ago

It seems like you are encountering a PHP Fatal error, and it might be caused by a missing PHP extension called intl. The Locale class is part of the Internationalization Functions (Intl) extension, which provides localization capabilities to PHP applications.

To resolve this issue, you need to install the intl extension on your Ubuntu server. You can do this by running the following command:

sudo apt-get install php-intl

para2022 commented 1 year ago

Thank you, you are an absolute legend. Maybe it may resolve some other subtle bugs too. Thanks bro

hnagasawa commented 1 year ago

Same error occured Our AVideo. I checked /var/www/html/AVideo-Encoder/videos/avlog.log. I found next messages. PHP Fatal error: Uncaught Error: Class "Locale" not found in /var/www/html/AVideo-Encoder/locale/function.php:14 Stack trace:

0 /var/www/html/AVideo-Encoder/view/index.php(23): require_once()

1 {main}

thrown in /var/www/html/AVideo-Encoder/locale/function.php on line 14

I tried to install php-intl.

apt-get install php-intl

Reading package lists... Done Building dependency tree Reading state information... Done php-intl is already the newest version (2:8.2+93+ubuntu20.04.1+deb.sury.org+2). The following packages were automatically installed and are no longer required: libffi6 libicu65 libonig4 Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Why ?

DanielnetoDotCom commented 1 year ago

make sure what PHP version your apache is using, and install a specific version...

for example sudo apt-get install php8.1-intl

hnagasawa commented 1 year ago

Our Avideo's php and apache2 Version is next.

apachectl -v

Server version: Apache/2.4.52 (Ubuntu) Server built: 2023-03-08T17:32:01

php -v

PHP 8.2.4 (cli) (built: Mar 16 2023 14:34:48) (NTS) Copyright (c) The PHP Group Zend Engine v4.2.4, Copyright (c) Zend Technologies with Zend OPcache v8.2.4, Copyright (c), by Zend Technologies

I tried "sudo apt-get install php8.2-intl" next messages displayed.

apt-get install php8.2-intl

Reading package lists... Done Building dependency tree... Done Reading state information... Done php8.2-intl is already the newest version (8.2.4-1+ubuntu22.04.1+deb.sury.org+1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Same error occured

DanielnetoDotCom commented 1 year ago

Check it here to make sure what version your apache is using

image

if you installed the correct version check your logs again for new errors

hnagasawa commented 1 year ago

I ran Health check after git pull( both AVideo and AVideo-Enconder) and reboot AVideo Server. AVideo detected PHP v8.0.28.

But I ran next commands under Ubuntu22.04

php -v

PHP 8.2.4 (cli) (built: Mar 16 2023 14:34:48) (NTS) Copyright (c) The PHP Group Zend Engine v4.2.4, Copyright (c) Zend Technologies with Zend OPcache v8.2.4, Copyright (c), by Zend Technologies

update-alternatives --config php

There are 4 choices for the alternative php (providing /usr/bin/php).

Selection Path Priority Status

Do we change form PHP8.2 to PHP8.0 ? avideo1

DanielnetoDotCom commented 1 year ago

you are using php 8.0 in apache

so try this

sudo apt-get install php8.0-intl

then restart apache

hnagasawa commented 1 year ago

I did "apt-get install php8.0-intl", This problem fix. Mr Daniel Thank you for your support. I have a qusetion. Why does not AVideo detect PHP8.2 ?

DanielnetoDotCom commented 1 year ago

It is not AVideo, it is apache.

you may need to google to find how to change, but I do not recommend that because 8.1 is already working fine.

hnagasawa commented 1 year ago

Thank you for your support. That's all for my question. There is no problem with closing this thread.