Forum

Thread tagged as: Problem, Error, Twitter

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

Harry Ray

Harry Ray 0 points

  • 3 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Please post your Diagnostics Report.

Hi Rachel,

No worries - see below:

PERCH INFORMATION
Perch: 2.8.31
Production mode: Production (100)
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), perch_shop_paypal (1.2.3), perch_forms (1.8.3), perch_blog (5.0), perch_comments (1.2), perch_members (1.5), perch_twitter (3.5.1)
DB driver: PDO
DB tables: perch2_blog_authors (9), perch2_blog_comments (2), perch2_blog_index (1611), perch2_blog_posts (42), perch2_blog_posts_to_tags (39), perch2_blog_sections (1), perch2_blog_tags (26), perch2_blogs (1), perch2_categories (1), perch2_category_counts (0), perch2_category_sets (3), perch2_comments (104), perch2_comments_votes (0), perch2_content_index (4617), perch2_content_items (1614), perch2_content_regions (421), perch2_courses (1), perch2_forms (2), perch2_forms_responses (235), perch2_members (0), perch2_members_forms (1), perch2_members_member_tags (0), perch2_members_sessions (1), perch2_members_tags (0), perch2_navigation (4), perch2_navigation_pages (50), perch2_page_templates (21), perch2_pages (105), perch2_resource_log (5314), perch2_resource_tags (143), perch2_resources (1678), perch2_resources_to_tags (442), perch2_scheduled_tasks (0), perch2_settings (38), perch2_shop_categories (11), perch2_shop_courses (5), perch2_shop_log (13), perch2_shop_orders (12), perch2_shop_product_options (0), perch2_shop_products (18), perch2_shop_products_to_categories (0), perch2_shop_products_to_courses (0), perch2_twitter_scheduled_tweets (0), perch2_twitter_settings (1), perch2_twitter_tweets (2460), perch2_user_passwords (3), perch2_user_privileges (81), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (13)
Users: 13
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_blog',
        'perch_members',
        'perch_twitter',
        'perch_forms',
        'perch_comments',
        'perch_shop_paypal'
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Scheduled tasks for perch_comments: delete_spam_comments (1440 mins)
Scheduled tasks for perch_twitter: post_tweets (1 mins), update_tweets (10 mins)
Editor plug-ins: markitup
H1: b33b7f8ff9b9dce06d63b995b8256efd
L1: decc131a5977ddd7a8d783c56351db03
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.25: done
latest_version: 2.8.15
on_sale_version:
headerScheme: light
perch_blog_site_name:
perch_blog_post_url: /news/post.php?s={postSlug}
perch_blog_slug_format: {postTitle}-{postID}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 1
content_frontend_edit: 0
perch_blog_comment_notify: 1
perch_blog_update: 5.0.1
perch_members_update: 1.4
perch_twitter_update: 3.5
perch_members_login_page: /members/login.php?r={returnURL}
update_2.8.31: done
perch_shop_update: 1.0.6
perch_comments_akismet_key:
perch_comments_max_spam_days: 0
perch_shop_price_tax_mode: exc
perch_shop_site_url: https://
perch_shop_product_url: /training-and-courses/product.php?s={productSlug}
perch_shop_default_currency:
perch_shop_reporting_currency:
perch_shop_invoice_number_format: Invoice%d
perch_shop_display_oos: 1
perch_shop_paypal_email: info@activegloucestershire.org
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: 6462610784
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: 5740189789
PERCH_DB_PREFIX: perch2_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: info@activegloucestershire.org
PERCH_EMAIL_FROM_NAME: Active Gloucestershire
PERCH_LOGINPATH: /cms
PERCH_PATH: /var/www/vhosts/activegloucestershire.org/httpdocs/cms
PERCH_CORE: /var/www/vhosts/activegloucestershire.org/httpdocs/cms/core
PERCH_RESFILEPATH: /var/www/vhosts/activegloucestershire.org/httpdocs/cms/resources
PERCH_RESPATH: /cms/resources
PERCH_HTML5: 1
PERCH_SCHEDULE_SECRET: xGBXuRh4rLtzNq4M
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /var/www/vhosts/activegloucestershire.org/httpdocs/cms/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile
HOSTING SETTINGS
PHP: 5.4.13
Zend: 2.4.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: 5.5.30
MySQL server: 5.5.30
Free disk space: 32.50 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, zlib, bz2, calendar, ctype, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, sockets, mbstring, tokenizer, xml, cgi-fcgi, curl, dom, fileinfo, gd, imagick, imap, json, ldap, exif, mcrypt, mysql, mysqli, odbc, PDO, pdo_mysql, PDO_ODBC, pdo_sqlite, Phar, snmp, sqlite3, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip, mhash, ionCube Loader
GD: Yes
ImageMagick: Yes
PHP max upload size: 128M
PHP max form post size: 8M
PHP memory limit: 128M
Total max uploadable file size: 8M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
PATH: /sbin:/usr/sbin:/bin:/usr/bin
PP_CUSTOM_PHP_INI: /var/www/vhosts/system/activegloucestershire.org/etc/php.ini
PP_CUSTOM_PHP_CGI_INDEX: fastcgi
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
REQUEST_URI: /cms/core/settings/diagnostics/?extended
QUERY_STRING: extended
REQUEST_METHOD: GET
SERVER_PROTOCOL: HTTP/1.0
GATEWAY_INTERFACE: CGI/1.1
REMOTE_PORT: 52038
SCRIPT_FILENAME: /var/www/vhosts/activegloucestershire.org/httpdocs/cms/core/settings/diagnostics/index.php
SERVER_ADMIN: jamesh@thirdfloordesign.co.uk
DOCUMENT_ROOT: /var/www/vhosts/activegloucestershire.org/httpdocs
REMOTE_ADDR: 82.35.54.156
SERVER_PORT: 80
SERVER_ADDR: 205.186.165.244
SERVER_NAME: activegloucestershire.org
SERVER_SOFTWARE: Apache
SERVER_SIGNATURE: <address>Apache Server at activegloucestershire.org Port 80</address>
HTTP_COOKIE: _ga=GA1.2.740022276.1522140883; _gid=GA1.2.1902877570.1522140883; PHPSESSID=e6su5r9a1hph85rngiu8cnu2f0; cmsa=1
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.9
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_REFERER: https://activegloucestershire.org/cms/core/settings/diagnostics/
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_CONNECTION: close
HTTP_X_ACCEL_INTERNAL: /internal-nginx-static-location
HTTP_X_FORWARDED_FOR: 82.35.54.156
HTTP_X_REAL_IP: 82.35.54.156
HTTP_HOST: activegloucestershire.org
UNIQUE_ID: WroXcs26pfQAAF20ha4AAAAG
FCGI_ROLE: RESPONDER
PHP_SELF: /cms/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1522145139.2814
REQUEST_TIME: 1522145139
Drew McLellan

Drew McLellan 2638 points
Perch Support

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

Drew McLellan

Drew McLellan 2638 points
Perch Support

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.

Drew McLellan

Drew McLellan 2638 points
Perch Support

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:

[Tue Mar 27 09:07:10 2018] [warn] [client 179.53.202.225] mod_fcgid: stderr: PHP Warning: include(updater.class.php): failed to open stream: No such file or directory in /var/www/vhosts/activegloucestershire.org/httpdocs/inc/libs/filtering.class.php on line 3 
[Tue Mar 27 09:07:10 2018] [warn] [client 179.53.202.225] mod_fcgid: stderr: PHP Warning: include(updater.class.php): failed to open stream: No such file or directory in /var/www/vhosts/activegloucestershire.org/httpdocs/inc/libs/filtering.class.php on line 3 
[Tue Mar 27 09:07:10 2018] [warn] [client 179.53.202.225] mod_fcgid: stderr: PHP Warning: include(): Failed opening 'updater.class.php' for inclusion (include_path='.:') in /var/www/vhosts/activegloucestershire.org/httpdocs/inc/libs/filtering.class.php on line 3 
[Tue Mar 27 09:07:10 2018] [warn] [client 179.53.202.225] mod_fcgid: stderr: PHP Notice: Use of undefined constant mobile - assumed 'mobile' in /var/www/vhosts/activegloucestershire.org/httpdocs/inc/header.php on line 145 
Drew McLellan

Drew McLellan 2638 points
Perch Support

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:

[Tue Mar 27 09:44:17 2018] [warn] [client 82.35.54.156] mod_fcgid: stderr: 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
Drew McLellan

Drew McLellan 2638 points
Perch Support

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, and Overhead are completely blank for perch2_scheduled_tasks, and Collation is listed as in use.

Also, clicking on the table to open it up displays this error:

#144 - Table './admin_activeglos_live/perch2_scheduled_tasks' is marked as crashed and last (automatic?) repair failed

Any idea what might have caused this to come out of the blue?

Drew McLellan

Drew McLellan 2638 points
Perch Support

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!