Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Note Publish 500 error #167

Closed
mediaformat opened this issue Mar 7, 2024 · 14 comments
Closed

Note Publish 500 error #167

mediaformat opened this issue Mar 7, 2024 · 14 comments

Comments

@mediaformat
Copy link

This seems similar to #160, but I'm running 0.12.0

I first noticed this trying to reply from the feed-reader, but it happens from the post page as well.

When I attempt to Publish I get an ajax 500 error which leaves the editor in an unpublished state, however the post does publish, and federate. I just need to refresh the whole page, same happens when trying to delete a Note.

Sorry I don't have any useful logs right now.
Here is a partial list of plugins:

  • ActivityPub
  • IndieAuth
  • IndieBlocks
  • IndieWeb
  • Webmention
@janboddez
Copy link
Owner

janboddez commented Mar 12, 2024

If you enabled WordPress' error logging, you should find the root cause in WordPress' (or your PHP's) debug log.

The other issue occurred during sending of a webmention, and only if the remote sender returned a server error.

This here issue is something that happens during (or rather, after) publish, so it could be any of the plugins that hook into any of the actions that run on save.

Since the editor expects a JSON response but WordPress returns an (HTML) error page, it seemingly gets "stuck" in the state you mention.

@mediaformat
Copy link
Author

Ok, I managed to get the error:

Call to undefined function IndieBlocks\Mf2parse() in .../includes/class-parser.php:111

@janboddez
Copy link
Owner

Oh, that's strange.
There should be a backslash: IndieBlocks\Mf2\parse().

It should be called as Mf2\parse() here: https://plugins.trac.wordpress.org/browser/indieblocks/tags/0.12.0/includes/class-parser.php#L111.

And it should be defined here: https://plugins.trac.wordpress.org/browser/indieblocks/tags/0.12.0/build/vendor/mf2/mf2/Mf2/Parser.php#L44

Do you have that build/vendor file? Does it have the IndieBlocks\Mf2 namespace?

@mediaformat
Copy link
Author

My bad, I mis-transcribed, it is indeed called as IndieBlocks\Mf2\parse().

Both files, and selected lines are there too.

@janboddez
Copy link
Owner

janboddez commented Mar 15, 2024

Looks like the autoloader not doing its thing ... Since everything is prefixed, I would not have expected issues there.

Have you ever played around with Composer, on your WordPress install?

I'm guessing deleting and re-installing the plugin don't work? Because that should solve it (unless there's a conflict somewhere).

What OS and PHP version are you on? (Although I'd expect errors if there was an issue there.)

@janboddez
Copy link
Owner

Actually, I had the same issue before, and it must've been me messing up because when I reinstalled ("from scratch") the issue was gone ...

@mediaformat
Copy link
Author

No composer use on the server, I've also tried deleting and reinstalling both IndieBlocks and Feed Reader, getting the same error still.

Debian 11, PHP 8.2

@janboddez
Copy link
Owner

Feed Reader uses the same parser class, and Webmention may very well, too. But at least IndieBlocks and Feed Reader use (different) namespace prefixes, so there should not be a conflict ...

Have you ever tried it with all other (than IndieBlocks) plugins disabled?

@janboddez
Copy link
Owner

janboddez commented Mar 22, 2024

Oh, wait, I'm only now reading through the other issue. Looks like there may be a conflict, still. (Even if I use both plugins together without issue, but I may also be using a later version.)

So, the issue I had before, was caused by humbug/php-scoper#298

Could be I just need to update the plugin, either one of them, or both, in the repo.

Fun fact: if I hadn't used a prefixer/scoper, there would probably not be an issue ...

Different question: have you tried installing/replacing Feed Reader and IndieBlocks with the version(s) here on GitHub?

@janboddez
Copy link
Owner

Right, I think the issue is that Feed Reader's autoloader actually dates from before I fixed it (even if the commit dates seem to suggest otherwise).

The GitHub version should work.

I'll update the WP version soon.

@janboddez
Copy link
Owner

I'm 95% sure the PHP-Scoper bug is what caused this conflict, so I pushed a long overdue update of Feed Reader to the WP.org repo.

I myself am currently running this alongside the WP.org version of IndieBlocks just fine. Hope this solves it for you, too?

@mediaformat
Copy link
Author

Thanks @janboddez that update seems to have cleared things up!!

@janboddez
Copy link
Owner

Believe it or not, I'm experimenting with a plugin that similarly uses PHP-Scoper and I'm running into this exact problem again.

@janboddez
Copy link
Owner

OK, I think it may have been because I used A\Certain\Namespace rather than, well, one word.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants