Forum
Perch Twitter - CRON Job
Hi guys,
On Sunday at 10:30, a CRON job that was working for months to fetch new tweets suddenly stopped working and has since been sending me this error:
PHP Fatal error: Call to a member function update() on a non-object in /var/www/vhosts/activegloucestershire.org/httpdocs/cms/core/lib/PerchScheduledTasks.class.php on line 99
I'm not sure what could have caused this, but I logged in to my client's Twitter account and set up a new Application so that I could get a fresh Consumer Key and Secret.
I've put the new Key and Secret in to the "Twitter > Settings" fields in the back end of Perch, but when I save with these details in place, I get this error appearing at the very top of the page:
There was an error: Desktop applications only support the oauth_callback value 'oob' /oauth/request_token
Any ideas what's going on here?
Thanks, Harry
Please post your Diagnostics Report.
Hi Rachel,
No worries - see below:
Do you have the Callback URL set in your Twitter dev account?
The current app doesn't have a Callback URL, no - do we require one for this to work? I wasn't sure where to point it.
EDIT
I've updated the callback URL to just point the site, and have re-authenticated through the Perch Twitter app. I no longer get an error when I try to save the details now, but I'm still getting this error from the CRON Job:
PHP Fatal error: Call to a member function update() on a non-object in /var/www/vhosts/activegloucestershire.org/httpdocs/cms/core/lib/PerchScheduledTasks.class.php on line 99
Obviously it's a bit hard to debug on such an old version of the software. It looks like the task isn't getting created. Can you see it listed in the schedule task list in the control panel?
In the dashboard > Settings > Scheduled Tasks, it doesn't show any tasks - just tells me how to configure tasks.
Although, in the debug, you can see some scheduled tasks - so I'm not sure what's going on there.
Do you have any other errors logged?
Hi Drew,
These errors also appear, although they appear in the error log for the site as opposed to being emailed to me by the Cron Daemon:
I don't think any of that is Perch.
Are you able to run the task scheduler via its URL rather than cron?
I tried that a little earlier but I got a 500 request - I've just retried it and still the same issue.
When I try it via URL, I see the CRON error in the error log:
Same error then. Does your
perch2_scheduled_tasks
table look healthy?I'm not quite sure what to suggest. What's the reason you can't run the current version?
ooh - no, it doesn't!
In the phpmyadmin dashboard,
Rows
,Type
,Size
, andOverhead
are completely blank forperch2_scheduled_tasks
, andCollation
is listed asin use
.Also, clicking on the table to open it up displays this error:
Any idea what might have caused this to come out of the blue?
You should be ok to delete that one table. Perch will then try to recreate it for you.
Table crashes are pretty uncommon, but you tend to see them most on over-worked shared hosting.
I couldn't drop it but I emptied it and then browsed it, and the columns had returned - I've just tested the CRON job via URL and it's working as expected.
Thanks for the help here, Drew!