AVideo
AVideo copied to clipboard
Ajax error on remote encoders only since encoder updates
Hi i have an ajax error on the remote encoders which doesn't affect the local encoder.
Videos still encode but this ajax error is blocking the popup to add additional features what was added recently. The popup only works on the local encoder which doesnt have the ajax error.
this will not stop the upload, but this is something in your streamer server. something related to the apache headers and cors configuration.
I cannot tell you what exactly is.
Uploads are not possible now since your update yesterday. I get cors error and uploads get stuck in the remote encoders. Before you blame it on my setup the encoders worked fine until you updated them now they do not work. The encoders worked even with the ajax error but now they dont. I do not have a clue how to fix cors errors when my setup was fine and i do not want to start messing with my servers and break them for an issue that has just been created.
I just sent a streamer update, please check
Ah thats fix it they are working again now the remote ones. Any idea where ajax error is coming from? Only happens when using the encoders remotely but if i use them all locally there is no ajax error. This didnt used to happen. The ajax error blocks the new popup on the encoders. It happens where the popup should occur. cheers
The ajax is something related to the apache headers and cors
getTimes.json.php | blocked | Access-Control-Allow-Origin | Multiple Values | https://encoder1.ourtube.co.uk, * | |
---|---|---|---|---|---|
status | blocked | Access-Control-Allow-Origin | Multiple Values | https://encoder1.ourtube.co.uk, * |
Any clue? my cors looks fine and i dont any problems with other sites that use cors policy just the AVideo setup
This are my errors when i load the encoder page in the developers tools.
Access to XMLHttpRequest at 'https://ourtube.co.uk/objects/getTimes.json.php' from origin 'https://encoder1.ourtube.co.uk' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values 'https://encoder1.ourtube.co.uk, *', but only one is allowed. script.js:2020
GET https://ourtube.co.uk/objects/getTimes.json.php net::ERR_FAILED 200 (OK)
send @ jquery.min.js:2 ajax @ jquery.min.js:2 getServerTime @ script.js:2020 (anonymous) @ script.js:2897 e @ jquery.min.js:2 t @ jquery.min.js:2 setTimeout (async) (anonymous) @ jquery.min.js:2 c @ jquery.min.js:2 fireWith @ jquery.min.js:2 fire @ jquery.min.js:2 c @ jquery.min.js:2 fireWith @ jquery.min.js:2 ready @ jquery.min.js:2 B @ jquery.min.js:2 Show 12 more frames Show less encoder1.ourtube.co.uk/:1 Access to XMLHttpRequest at 'https://ourtube.co.uk/status' from origin 'https://encoder1.ourtube.co.uk' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values 'https://encoder1.ourtube.co.uk, *', but only one is allowed. (index):1089
GET https://ourtube.co.uk/status net::ERR_FAILED 200 (OK)
send @ jquery.min.js:2 ajax @ jquery.min.js:2 (anonymous) @ (index):1089 e @ jquery.min.js:2 t @ jquery.min.js:2 setTimeout (async) (anonymous) @ jquery.min.js:2 c @ jquery.min.js:2 fireWith @ jquery.min.js:2 fire @ jquery.min.js:2 c @ jquery.min.js:2 fireWith @ jquery.min.js:2 ready @ jquery.min.js:2 B @ jquery.min.js:2 Show 12 more frames Show less
maybe you are setting Access-Control-Allow-Origin somewhere else in your apache config
No ive been through everywhere on apache in virtual hosts and main conf and nothing, it is doing my nut in. Nothing in my .htaccess either its so wierd. I will keeping digging though.
Its just the avideo site i need to be looking not the encoder servers?
Found the issue....root .htaccess. Note the hash disabling the cors and now it works.
Set Access-Control-Allow-Origin for multiple file types
<FilesMatch "\.(php|ico|pdf|flv|jpg|jpeg|png|gif|swf|ts|webp|mp3|mp4|woff2|css|html|htm|key|m3u8)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
replace:
Header set Access-Control-Allow-Origin "*"
with:
Header always set Access-Control-Allow-Origin "*"
Job done. fixed.
Dan i have one last bug with the new encoder popup. On the remote servers when i can click save the box stays open but it closes on the local server. Can you help with this please? I dont see any errors whatsoever in my dev tools now for the first time ever. Im using the avideonetwork. Thanks
Found the issue....root .htaccess. Note the hash disabling the cors and now it works.
Set Access-Control-Allow-Origin for multiple file types
<FilesMatch "\.(php|ico|pdf|flv|jpg|jpeg|png|gif|swf|ts|webp|mp3|mp4|woff2|css|html|htm|key|m3u8)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
If I am in your shoes I wold not touch on that
Good morning,
I too have the same thing: AJAX error in red banner when sending a file to the encoders.
in the media section, I have the encoded file and a fake file.
I haven't changed anything on the avideo master site.
replace:
Header set Access-Control-Allow-Origin "*"
with:
Header always set Access-Control-Allow-Origin "*"
Job done. fixed.
what? does it resolve?
Dan i have one last bug with the new encoder popup. On the remote servers when i can click save the box stays open but it closes on the local server. Can you help with this please? I dont see any errors whatsoever in my dev tools now for the first time ever. Im using the avideonetwork. Thanks
when you click in save, it supposed to stay open till you click outside the window
It resolves the ajax error, the ads that never worked, the encoder popup now works, and the the encoders themselves now work again without all those horrible cors errors. For the first time ever my js panel has no errors whatsoever.
Dan i have one last bug with the new encoder popup. On the remote servers when i can click save the box stays open but it closes on the local server. Can you help with this please? I dont see any errors whatsoever in my dev tools now for the first time ever. Im using the avideonetwork. Thanks
when you click in save, it supposed to stay open till you click outside the window
How come it closes on the local encoder then?
Sorry, I may be confused.
check your js logs then
I tried but they are really clean. I have never seen my js logs this clean since the Allow-Origin changes
but when you click in save, does it really save?
what is the ajax response?
Well if I try and add a title it wont let me unless its 10 chars long however i can add a short title in the traditional way under the popup. The way we used to change the title and description, so i assume this is a bug. Some titles are shorter than 10 chars. For instance i couldn't add a title called ENC_01 for testing but i can add it the old way before the popup addition.
Hello, my host prohibits touching the Apache configuration. It doesn't matter, what matters is being able to send. and again, afterwards, I delete the video in error
Hello, my host prohibits touching the Apache configuration. It doesn't matter, what matters is being able to send. and again, afterwards, I delete the video in error
You dont need to. Its been worked out and dan has kindly done an update. You can do a git pull now to fix the issue.
I had to change it to Header setifempty Access-Control-Allow-Origin "*"
some other sites fail with Header always set Access-Control-Allow-Origin "*"
Header setifempty Access-Control-Allow-Origin "*"
I get the errors back again with that so i am using the one below instead:
Header always set Access-Control-Allow-Origin "*"
Everything works fine for me with that. However I do not get the ajax error with your adjustment but i get loads of cors errors and the popup on the encoder gets blocked.
Good morning,I'm at work, it's morning for me 8:54 a.m.so I'm off schedule, 7am with Daniel, he arrives at the end of the day for me.I don't have a pop-up that blocks sending to the encoder, just the red banner marked Error AJAX and an empty video.the title of this video bears the name of the file with the modified encoder, before this change, the video had a title made up of letters and numbers.as soon as I get home, I make a backup of the site and do a git pull.Message ID: @.***>
@para2022 it may be the header set somewhere in your apache
I have no headers set in apache ive been through all my apache files. I even stopped nginx to see if that was causing some issue. Its weird. I will just have to leave it at Header always set Access-Control-Allow-Origin "*" it works for me.