[1.6.0] Cron job fails with HTML output

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
User avatar
Ipstenu
Bear Rating Trainee
Bear Rating Trainee
Posts: 19
Joined: 25 Jun 2012, 19:49

[1.6.0] Cron job fails with HTML output

Postby Ipstenu » 23 Oct 2012, 21:19

I use a cron job to kick off the update, and I get this:

Code: Select all

 <html>
      <head>
      <title>Database Updater</title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <link rel="stylesheet" type="text/css" href="utility.css">
      </head>

      <body>
      <div class="floatingLogo"><img src="images/logo_wide.png"></div>
      <h1>Update</h1>

      <div class="error" id="">
         <img src="images/sign_excl.png">Please run this script from the command line.</div>
      </body></html>


I just updated to PHP 5.3.18 and upgraded ttRSS to 1.16 at the same time (silly me).

If I run command line "php ./update.php -daemon" I get the same thing, however "php ./update.php -feeds" works!

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Cron job fails with HTML output

Postby fox » 23 Oct 2012, 21:22

Maybe you should update the database. Try thinking about it.

User avatar
Ipstenu
Bear Rating Trainee
Bear Rating Trainee
Posts: 19
Joined: 25 Jun 2012, 19:49

Re: Cron job fails with HTML output

Postby Ipstenu » 23 Oct 2012, 22:25

I did. WHen I did the manual update, it directed me to the DB updater, told me to backup (did) and then ran without any errors.

Should I run it a second time?

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Cron job fails with HTML output

Postby fox » 23 Oct 2012, 23:18

If you have updated everything properly, it is not going to prompt you for update.

User avatar
Ipstenu
Bear Rating Trainee
Bear Rating Trainee
Posts: 19
Joined: 25 Jun 2012, 19:49

Re: Cron job fails with HTML output

Postby Ipstenu » 23 Oct 2012, 23:36

It doesn't prompt all the time. -feeds works via CLI, but not Cron. -daemon fails every time.

Hence my confusion. Can I manually rerun the updater? If so, how?

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Cron job fails with HTML output

Postby fox » 24 Oct 2012, 00:00

I'm not sure what you did but you can run the updater (db-updater.php) from the browser.

User avatar
Ipstenu
Bear Rating Trainee
Bear Rating Trainee
Posts: 19
Joined: 25 Jun 2012, 19:49

Re: Cron job fails with HTML output

Postby Ipstenu » 24 Oct 2012, 00:10

Tiny Tiny RSS database is up to date.


I love computers! :D

I commented out this and it works:

Code: Select all

        if (!defined('STDIN')) {
                ?> <html>
                <head>
                <title>Database Updater</title>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                <link rel="stylesheet" type="text/css" href="utility.css">
                </head>

                <body>
                <div class="floatingLogo"><img src="images/logo_wide.png"></div>
                <h1><?php echo __("Update") ?></h1>

                <?php print_error("Please run this script from the command line."); ?>

                </body></html>
        <?php
                exit;
        }


Which makes me think something about my PHP instance is crapping out on the 'Is this command line?' check for some reason. I'll kick PHP around tonight.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Cron job fails with HTML output

Postby fox » 24 Oct 2012, 00:16

Ah, part of the blame is on me then because I never read past the wrong database updater title. I'll fix this in trunk.

Edit: fixed.

Edit2: I guess this makes some sense, cron runs tasks without allocating pty or something like that thus there's no stdin. I'll add a command line option to ignore that check for this case.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Cron job fails with HTML output

Postby fox » 24 Oct 2012, 00:26

Fix: https://github.com/gothfox/Tiny-Tiny-RS ... 30b490886c

Also mentioned in known bugs on the wiki.

User avatar
Ipstenu
Bear Rating Trainee
Bear Rating Trainee
Posts: 19
Joined: 25 Jun 2012, 19:49

Re: Cron job fails with HTML output

Postby Ipstenu » 24 Oct 2012, 01:03

Brillig! Swapped the file in, cron ran and that works now! Woot! Thanks fox! You rock :D

(I know my PHP is being an idiot b/c I can't upload images in WP sometimes. I have to turn CGI back on, but I can't from where I am.)

miqrogroove
Bear Rating Trainee
Bear Rating Trainee
Posts: 39
Joined: 20 Mar 2013, 02:08

Re: [1.6.0] Cron job fails with HTML output

Postby miqrogroove » 20 Mar 2013, 02:25

This seems to be the reason I can't get updates to work on my new install. It would break any time register_argc_argv isn't enabled. Please see http://www.php.net/manual/en/ini.core.p ... -argc-argv

miqrogroove
Bear Rating Trainee
Bear Rating Trainee
Posts: 39
Joined: 20 Mar 2013, 02:08

Re: [1.6.0] Cron job fails with HTML output

Postby miqrogroove » 20 Mar 2013, 02:57

I fixed it by using a different command:

Code: Select all

cd /home/user/public_html/tt-rss && php -d register_argc_argv=On -f /home/user/public_html/tt-rss/update.php -- -feeds >/dev/null 2>&1

miqrogroove
Bear Rating Trainee
Bear Rating Trainee
Posts: 39
Joined: 20 Mar 2013, 02:08

Re: [1.6.0] Cron job fails with HTML output

Postby miqrogroove » 24 Mar 2013, 01:11

For version 1.7.5, the command changes to this:

Code: Select all

cd /home/user/public_html/tt-rss && php -d register_argc_argv=On -f /home/user/public_html/tt-rss/update.php -- --feeds >/dev/null 2>&1

Aldursil
Bear Rating Master
Bear Rating Master
Posts: 106
Joined: 18 Mar 2013, 03:11

Re: [1.6.0] Cron job fails with HTML output

Postby Aldursil » 24 Mar 2013, 09:47

miqrogroove wrote:For version 1.7.5, the command changes to this:

Code: Select all

cd /home/user/public_html/tt-rss && php -d register_argc_argv=On -f /home/user/public_html/tt-rss/update.php -- --feeds >/dev/null 2>&1


Thank you very much for posting this. This works for me on Bluehost without having to change update.php. You rock!

;)

Aldursil
Bear Rating Master
Bear Rating Master
Posts: 106
Joined: 18 Mar 2013, 03:11

Re: [1.6.0] Cron job fails with HTML output

Postby Aldursil » 24 Mar 2013, 20:35

This works for me from the command line but when I put this into a cron job it does not work. Do you have an idea on how to get this to work in a cron job? I set the cron job to email me the output and I never received an email. I did take off the ">/dev/null 2>&1" from the end of the command as well.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 6 guests