Jeff VIP
Total posts: 745
24 Oct 2013 04:29

Google: https://www.phpbb.com/customise/db/mod/phpbb_digests/faq/f_904

I am getting a HTTP 406 (Not Acceptable) error when I run the job through a cron process. How can this be fixed?

Your method (such as curl) of calling mail_digests.php may need to send HTTP headers because your installation of PHP is configured to only accept requests from what it believes are browsers. In essence you need to tell the calling program to masquerade as a browser by sending a browser-like user agent string. Using curl, for example, this would work:

curl -A=Mozilla/4.0  http://www.example.com/phpBB3/mail_digests.php 


stblink VIP
Total posts: 501
24 Oct 2013 08:17

ngarasan when you insert the cron url into the browser u get an error page or blank page?


ngarasan VIP
Total posts: 181
24 Oct 2013 09:04

Did you mean write this: curl -c --url " http://website.com/ " in the browser? When I did it, the browser show me a result of the search engine. And if write this: http://myite.com/index.php?option=com_cobalt& ;task=cron.sendAlert&secret=123456, the email notifications are sent. And if write this: http://website.com/ , it will go to the website :)


Sergey
Total posts: 13,748
24 Oct 2013 09:56

Did you mean write this: curl -c --url " http://website.com/ " in the browser?

No just the URL

https://mysite.com/index.php?option=com_cobalt& ;task=cron.sendAlert&secret=123456

If it is sent then it is all about CRON CURL. Somehow you have to open this url with lynx, wget or curl.


ngarasan VIP
Total posts: 181
24 Oct 2013 10:12

wget: permission denied.

lynx: is not available

and curl get this message:

% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed



0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

123 370 123 370 0 0 842 0 --:--:-- --:--:-- --:--:-- 92500

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<html><head>

<title>406 Not Acceptable</title>

</head><body>

<h1>Not Acceptable</h1>

<p>An appropriate representation of the requested resource / could not be found on this server.</p>

<p>Additionally, a 404 Not Found

error was encountered while trying to use an ErrorDocument to handle the request.</p>

</body></html>

What should I do?


Sergey
Total posts: 13,748
24 Oct 2013 10:20

What should I do?

Contact your server administrator.


Jeff VIP
Total posts: 745
24 Oct 2013 18:35

@ngarasan

Since emails are sent successfully by inserting http://mysite.com/index.php?option=com_cobalt& ;task=cron.sendAlert&secret=123456 directly into your browsers url bar, there must be permission issues in your webserver environment.

This issue should have been reported to your server administrator/web hoster at the first place.

Please contact them and share their reply with us.

Have you tried:

curl -A=Mozilla/4.0  http://mysite.com/index.php?option=com_cobalt& ;task=cron.sendAlert&secret=123456

ngarasan VIP
Total posts: 181
25 Oct 2013 02:08

I tried this:

curl -A=Mozilla/4.0 http://mysite.com/index.php?option=com_cobalt& ;task=cron.sendAlert&secret=123456

I get this:


% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 109 879 109 879 0 0 4554 0 --:--:-- --:--:-- --:--:-- 4725 <!DOCTYPE HTML> <html lang="en-gb" dir="ltr" class="uk-height-1-1"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>500 - Error: 500</title> <link rel="apple-touch-icon-precomposed" href="/templates/yoo_nano3/apple_touch_icon.png"> <link rel="stylesheet" href="/templates/yoo_nano3/styles/orange/css/bootstrap.css"> <link rel="stylesheet" href="/templates/yoo_nano3/styles/orange/css/theme.css"> </head> <body class="uk-height-1-1 uk-vertical-align uk-text-center"> <div class="uk-vertical-align-middle uk-container-center"> <i class="tm-error-icon uk-icon-frown"></i> <h1 class="tm-error-headline">500</h1> <h2 class="uk-h3 uk-text-muted">Error: 500</h2> <p>View not found [name, type, prefix]: cobalt, html, cobaltView</p> </div> </body> </html>

stblink VIP
Total posts: 501
25 Oct 2013 08:11

I really don't know how if this will work.. since wget is not allowed in your webserver.

But you could try cron services like this one and see if it is possible to set a cron not to execute wget, but to only "visit" the url.

Anyway, you should contact ur hosting company to allow wget


ngarasan VIP
Total posts: 181
25 Oct 2013 09:58

Hi,

I have report it to the webhoster, and curl should be work.

They suggest me to use this syntax:


curl -A "websitecron" http://website.com/index.php?option=com_cobalt& ;task=cron.sendAlert&secret=123456

But I still get this message:


% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 109 879 109 879 0 0 749 0 0:00:01 0:00:01 --:--:-- 4602 <!DOCTYPE HTML> <html lang="en-gb" dir="ltr" class="uk-height-1-1"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>500 - Error: 500</title> <link rel="apple-touch-icon-precomposed" href="/templates/yoo_nano3/apple_touch_icon.png"> <link rel="stylesheet" href="/templates/yoo_nano3/styles/orange/css/bootstrap.css"> <link rel="stylesheet" href="/templates/yoo_nano3/styles/orange/css/theme.css"> </head> <body class="uk-height-1-1 uk-vertical-align uk-text-center"> <div class="uk-vertical-align-middle uk-container-center"> <i class="tm-error-icon uk-icon-frown"></i> <h1 class="tm-error-headline">500</h1> <h2 class="uk-h3 uk-text-muted">Error: 500</h2> <p>View not found [name, type, prefix]: cobalt, html, cobaltView</p> </div> </body> </html>

Jeff VIP
Total posts: 745
25 Oct 2013 18:39

Could you please switch your site to a Joomla default template eg Protostar, and try it again with:

curl -A "websitecron"  http://website.com/index.php?option=com_cobalt& ;task=cron.sendAlert&secret=123456

Sergey
Total posts: 13,748
28 Oct 2013 00:05

But I still get this message:

Do you have SEF extension? If you place this URL in browser does it change it to SEF?


ngarasan VIP
Total posts: 181
31 Oct 2013 10:41

Ah, finally..

The problem solved.

My server administrator suggest me to use this syntax:

curl -A "websitecelcron" " http://website.com/index.php?option=com_cobalt& ;task=cron.sendAlert&secret=123456"    

I missed the double-quote.

And it works like a charm..

Thank you everyone for your help..

regards

ngarasan

Powered by Cobalt