Forum

Thread tagged as: Problem, Blog

Webmentions not displayed in Perch admin

I've installed Blog 5.6 but I'm seeing a problem with webmentions on a Runway site. I have a cron job running my scheduled tasks every hour but I've been submitting a URL response manually to try and see where this is failing for me.

When I submit manually via the ping form at the bottom of my post webmentions are added to the perch3_blog_webmention_queue table. I can see the data is incremented each time. I run the scheduler manually, data is cleared from the table, but doesn’t appear in the perch3_blog_comments table, which I assume it should? As a result, my webmention is not in Perch admin or displayed on the site.

I checked the scheduled task list in Perch admin and I can see that a webmention is logged after I run the scheduler. There are no errors in the error log.

My web host has confirmed that XML, mbstring and cURL extensions are installed.

I have Sending and Receiving Webmentions boxes checked.

I cannot see what I'm missing here.

My short diagnostics report:

Perch Runway: 3.0.8, PHP: 7.0.10, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.0.8), assets (3.0.8), categories (3.0.8), perch_blog (5.6)
App runtimes: <?php $apps_list = [ 'perch_blog', ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/clivewalker/public_html/perch
PERCH_CORE: /home/clivewalker/public_html/perch/core
PERCH_RESFILEPATH: /home/clivewalker/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 8M, Max POST 8M, Memory: 128M, Total max file upload: 8M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: /home/clivewalker/public_html
HTTP_HOST: www.clivewalker.me
Clive Walker

Clive Walker 22 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

  1. Turn debug on
  2. In perch/core/scheduled/run.php uncomment the PerchUtil::output_debug(); on the last line
  3. Visit your schedule task URL in a browser

What does it output?

Here's the output:

[32] SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0
[1] SHOW TABLES LIKE "perch3_scheduled_tasks"
[nil] SELECT * FROM perch3_backup_plans WHERE planActive='1' ORDER BY planCreated ASC
[3] SELECT taskApp, taskKey, MAX(taskStartTime) AS t FROM perch3_scheduled_tasks WHERE taskApp IN ('perch_blog', 'Backup') GROUP BY taskApp, taskKey
INSERT INTO perch3_scheduled_tasks(taskApp,taskKey,taskStartTime,taskResult,taskMessage) VALUES('perch_blog','publish_posts','2017-07-17 19:44:53','FAILED','Task failed to complete, or is still running.')
[1] SELECT * FROM perch3_scheduled_tasks WHERE taskID='46' LIMIT 1
[nil] SELECT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch3_blog_index idx JOIN perch3_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch3_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='_id' WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID, idx2.indexValue, postID ) as tbl WHERE (postStatus='Published' AND postDateTime<='2017-07-17 19:44:00' AND postIsPublished=0) GROUP BY itemID, sortval ORDER BY sortval ASC
UPDATE perch3_scheduled_tasks SET taskApp='perch_blog', taskKey='publish_posts', taskStartTime='2017-07-17 19:44:53', taskEndTime='2017-07-17 19:44:53', taskResult='OK', taskMessage='0 posts published.' WHERE taskID='46'
INSERT INTO perch3_scheduled_tasks(taskApp,taskKey,taskStartTime,taskResult,taskMessage) VALUES('perch_blog','process_webmentions','2017-07-17 19:44:53','FAILED','Task failed to complete, or is still running.')
[1] SELECT * FROM perch3_scheduled_tasks WHERE taskID='47' LIMIT 1
[1] SELECT * FROM perch3_blog_webmention_queue ORDER BY entryCreated ASC LIMIT 1
UPDATE perch3_scheduled_tasks SET taskApp='perch_blog', taskKey='process_webmentions', taskStartTime='2017-07-17 19:44:53', taskEndTime='2017-07-17 19:44:53', taskResult='OK', taskMessage='0 webmentions processed.' WHERE taskID='47'
[3] SELECT taskApp, taskKey FROM perch3_scheduled_tasks GROUP BY taskApp, taskKey
DELETE FROM perch3_scheduled_tasks WHERE taskID IN (SELECT * FROM ( SELECT taskID FROM perch3_scheduled_tasks WHERE taskApp='perch_blog' AND taskKey='delete_spam_comments' ORDER BY taskStartTime DESC LIMIT 10, 9999999 ) AS tmp)
DELETE FROM perch3_scheduled_tasks WHERE taskID IN (SELECT * FROM ( SELECT taskID FROM perch3_scheduled_tasks WHERE taskApp='perch_blog' AND taskKey='process_webmentions' ORDER BY taskStartTime DESC LIMIT 10, 9999999 ) AS tmp)
DELETE FROM perch3_scheduled_tasks WHERE taskID IN (SELECT * FROM ( SELECT taskID FROM perch3_scheduled_tasks WHERE taskApp='perch_blog' AND taskKey='publish_posts' ORDER BY taskStartTime DESC LIMIT 10, 9999999 ) AS tmp)
[1] OPTIMIZE TABLE perch3_scheduled_tasks
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you check that these database columns exist?

perch3_blog_posts: postPublished

and

perch3_blog_comments: webmention and webmentionType

If not, the update hasn't run correctly.

postIsPublished?

Yes, they exist.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you still have mentions in the queue?

I've just added one.

I've run the scheduler again with debug on and I see "Target URL does not exist in source" message. My entryTarget URL in the queue is "http" whereas in the source it is "https". Yet, I used the ping form on the https URL. Why does it get entered into the queue as "http"?

The protocols need to match, is that right?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, they need to match. Did you recently switch?

No. The site's been https from the start ... April

Drew McLellan

Drew McLellan 2638 points
Perch Support

Any idea where the non https link is coming from?

I think it comes from <perch:blog id="postURLFull" escape="true" /> in the ping form. View source here https://www.clivewalker.me/blog/2017-04-24-inspirational-parkrun

How is this generated in Perch and can I force it to be https?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Try replace="https:|https:"

Of course! That's fixed it. Thanks