WWBN / AVideo-Encoder-Network

Encoder Network Servers for AVideo Platform Open-Source
https://network.avideo.com
GNU General Public License v3.0
14 stars 40 forks source link

little bug on YouPHPTube-Encoder-Network #8

Open maxlinux2000 opened 4 years ago

maxlinux2000 commented 4 years ago

When the network server and an encoder reside on the same server, the network believes that the encoder is offline, even if it is working. I guess the ping is too low, and this is why the network declares the encoder offline. Have a look to the picture below at the ping values

Captura de pantalla de 2019-09-28 14-25-55

akhilleusuggo commented 4 years ago

Well , that's not true . I have the encoder and network-encoder on the same server with 0.0018ms and still showing online

DanielnetoDotCom commented 4 years ago

@maxlinux2000 maybe there is something blocking the network to ping itself

maxlinux2000 commented 4 years ago

I don `t believe it. I have added another server from another network (digitalocean in a germany vps) and it does the same. It is offline, even if it works perfectly. By the way the server "en3" runs on ubuntu 16.04 while the other two on ubuntu 18.04. I know it has nothing to do, but it's weird. Nor is it important ... it really works and ffmpeg does its job. It is just a curiosity.

But what does the network aggregator consider important to mark a server, such as "online"?

Captura de pantalla de 2019-09-30 21-15-01

DanielnetoDotCom commented 4 years ago

Ido not have it on the top of my mind, but I am pretty sure is the serverStatus request

image

maxlinux2000 commented 4 years ago

here the pictures of inpector (chrome this time) while en2 is encoding

Captura de pantalla de 2019-10-01 14-37-34

DanielnetoDotCom commented 4 years ago

you have to look into the server status response of the offline encoder, if is possible open the request in a new tab (right click)

maxlinux2000 commented 4 years ago

Hi, here the answer of server:

Access to XMLHttpRequest at 'https://en2.iesus.win/serverStatus' from origin 'https://network.iesus.win' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values ', ', but only one is allowed.

Captura de pantalla de 2019-11-14 19-25-05

How to fix it?

maxlinux2000 commented 4 years ago

OK Daniel

I think that we can fix this bug commenting one line in the Encoder-server at view/status.php. Just comment the header line

<?php
//header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');
require_once dirname(__FILE__) . '/../videos/configuration.php';

Captura de pantalla de 2019-11-16 16-04-12

DanielnetoDotCom commented 4 years ago

Thanks for sharing this.

I am just afraid that will break something else.

some times I am in circles with the Cors and Access-Control-Allow-Origin issues.