• Resolved kennethrg

    (@kennethrg)


    I love the idea of this plugin. Any opportunity to make a blog more accessible across more protocols is a welcome enhancement. I’ve been playing around with it for a couple days, though, and I seem to be encountering a problem I’m not sure how to debug. Reading some previous forum posts it sounded like a firewall or cache issue, but that doesn’t seem to be the case (disabled firewalls temporarily and problem persists).

    The symptom is that, while my profile shows up from a mastodon instance, I cannot seem to follow. When I click follow either it thinks I am following or it says a request is pending, but the WordPress side does not show any followers.

    I checked the server logs upon the follow request and I saw something that may indicate the problem:

    "POST /wp-json/activitypub/1.0/users/1/inbox HTTP/2" 401 97 "-" "http.rb/5.1.1 (Mastodon/4.3.0-alpha.0+glitch; +https://mastodon.instance/)"

    So some request is generating a http 401 code (I think that’s “unauthorized” or something). Simultaneously in the error log are some PHP warnings:

    [STDERR] PHP Warning:  Undefined array key "date" in wp-content/plugins/activitypub/includes/class-signature.php on line 445
    [STDERR] PHP Warning:  Trying to access array offset on value of type null in wp-content/plugins/activitypub/includes/class-signature.php on line 445
    [STDERR] PHP Warning:  Undefined array key "date" in wp-content/plugins/activitypub/includes/class-signature.php on line 457

    These are just warnings, not errors, but they still might be indicative of something going wrong. Unfortunately, I’m out of ideas on what it means.

    As another debugging step, I installed the ActivityPub on a fresh WordPress install on the same server (all the same software) and follows appear to work flawlessly, with no warnings or anything else in the error log. So that makes it seem like a plugin conflict, but I can’t imagine what it would be.

    I’ll continue to see what I can figure out, but I wanted to post this here in case anyone has any suggestions and so that whenever I do figure it out I can share my experience with others.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter kennethrg

    (@kennethrg)

    Update: my website is being proxied through Cloudflare. If I completely bypass Cloudflare it seems to work. But even when Cloudflare is passing the request through directly (i.e. no cache) it seems that something is lost which creates the error.

    Thread Starter kennethrg

    (@kennethrg)

    Well it looks like the problem is some bizarre behavior of Cloudflare. I had a hard time believing that this is really what’s going on, because it seems like it would break a ton of stuff, but evidently Cloudflare is removing the “date” header from requests. The ActivityPub plugin uses the date to verify the signature of incoming requests, and without it the plugin fails and does not process the requests.

    I was able to create a workaround. It’s not at all pretty. I added a custom Cloudflare rule to add an additional header (“x_date”) containing the current timestamp. Then I added some custom PHP code to check for a missing “date” header and recreate it from the “x_date” header. With all this, the plugin appears to work.

    It’s hard to call this resolved, but if we can say that the plugin is incompatible with Cloudflare then I guess it is.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘cannot follow’ is closed to new replies.