dokuwiki-plugin-sync icon indicating copy to clipboard operation
dokuwiki-plugin-sync copied to clipboard

"transport error - Premature End of File (socket) while reading headers" after upgrading Remote Wiki to PHP 8.1

Open eduardomozart opened this issue 2 years ago • 5 comments

I`d upgraded my Local and Remote Wikis to PHP 8.1 and started receiving the following error when selecting a Wiki profile and clicking on "Select" button into the Remote Wiki:

Failed to talk to remote wiki. Make sure the remote wiki allows XMLRPC requests and that you set up the endpoint URL correctly. transport error - Premature End of File (socket) while reading headers

After downgrading the Remote Wiki to PHP 7.4, the plugin worked as expected.

eduardomozart avatar Feb 09 '23 11:02 eduardomozart

I get the same error. My local wiki is on PHP 7.4 (DokuWiki's MicroApache) and the remote server is using PHP 8.1.

mightymt avatar May 17 '23 09:05 mightymt

I get the same error.

Both wikis are on PHP 7.4 (Apache) on Docker, both are on release 2024-02-06a "Kaos". On the server side, xmlrpc is activated, and not restricted to a specific user.

xmlrpc is installed and activated. With a xmlrpc-test-script from the internet, it was possible to establish a connection and transmit data.

On the first try, I typed a wrong password in the sync-profile, and got an error that my credentials are wrong. When I typed in the correct password, I got the error message which is in the topic.

EDIT: I checked the code and have the following suspicion:

If the credentials are correct, the function "dokuwiki.getXMLRPCAPIVersion" is called. This function was moved from the file inc/RemoteAPICore.php to the file inc/Remote/LegacyApiCore.php in Kaos. Maybe this causes the error because something doesn't work as expected?

cziehr avatar Jun 24 '24 22:06 cziehr

I was able to overcome this issue by using https://github.com/splitbrain/dokuwiki-plugin-sync/tree/refactor that is the new upcoming version of this plugin. It's still a little bug and has some issues. Most of them (at least the critical ones) were fixed by this PR: https://github.com/splitbrain/dokuwiki-plugin-sync/pull/74 that you'll need to apply after using the refactor. All plugin development is now moved to there, according to splitbrain (main plugin developer).

eduardomozart avatar Jun 25 '24 11:06 eduardomozart

Thank you for your hint and that you provide a PR. I've tried to use your version, but when I try to start the synchronization after choosing the profile, the page underneath the synchronization headline remains empty and nothing happens (see attached screenshot).

Bildschirmfoto zu 2024-06-30 14-09-47

Thanks again for your help!

cziehr avatar Jun 30 '24 12:06 cziehr

Can you provide your local Wiki logs on Manage > View Logs? On your remote wiki, which PHP version you're using? The server side seems to be troublesome on PHP 8+ yet. My remote wiki still runs PHP 7 because of that.

eduardomozart avatar Jul 01 '24 12:07 eduardomozart