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

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

Open
eduardomozart opened this issue Feb 9, 2023 · 7 comments

Comments

@eduardomozart
Copy link

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.

@mightymt
Copy link
Contributor

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.

@cziehr
Copy link

cziehr commented Jun 24, 2024

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?

@eduardomozart
Copy link
Author

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: #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).

@cziehr
Copy link

cziehr commented Jun 30, 2024

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!

@eduardomozart
Copy link
Author

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.

@tokubi
Copy link

tokubi commented Nov 10, 2024

Unfortunately, I too have been struggling with the same problem for a long time.

From the synchronization behavior I can observe it seems that synchronization does not work with PHP version 8 and higher. To verify this, I set up two identical environments with two instances of Dokuwiki using two independent Raspberry Pi 5, both in the same local network segment. Here is the configuration:

Revision        : d04170
Model           : Raspberry Pi 5 Model B Rev 1.0
 
Linux: Linux version 6.6.51+rpt-rpi-2712 ([email protected])
Build: (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40)
Release  : 6.6.51+rpt-rpi-2712
Version  : #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) 
 
PHP 8.2.24 (cli) (built: Sep 27 2024 04:16:10) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.24, Copyright (c) Zend Technologies with Zend OPcache v8.2.24, Copyright (c), by Zend Technologies
 
Dokuwiki:
Release 2024-02-06b "Kaos"
 
Apache:
Server version: Apache/2.4.62 (Debian)
Server built:   2024-10-04T15:21:08

Both Dokuwiki's have synchronization enabled and configured correctly.

The test scenario consists of synchronizing the playground namespace between the two dokuwikies.

If we try to select a synchronization profile on the synchronization page, this error occurs:

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

Everything should be clearly visible from the screenshots:

024-11-10_dokuwiki_1731254538

024-11-10_dokuwiki_1731254543

However, the strange thing is that this error does not always occur. By retrying the profile selection, in one case out of many, this error does not occur and synchronization can be started.

024-11-10_dokuwiki_1731254555

However, then again this same error is visible:

024-11-10_dokuwiki_1731254562

Logs:

024-11-10_dokuwiki_1731254569

2024-11-10 15:17:07E_WARNING: Undefined array key "startsync"/var/www/html/wiki/lib/plugins/sync/admin.php(145)
    #0 /var/www/html/wiki/lib/plugins/sync/admin.php(145): dokuwiki\ErrorHandler::errorHandler()
    #1 /var/www/html/wiki/inc/template.php(205): admin_plugin_sync->html()
    #2 /var/www/html/wiki/inc/Action/Admin.php(43): tpl_admin()
    #3 /var/www/html/wiki/inc/template.php(120): dokuwiki\Action\Admin->tplContent()
    #4 [internal function]: tpl_content_core()
    #5 /var/www/html/wiki/inc/Extension/Event.php(134): call_user_func_array()
    #6 /var/www/html/wiki/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
    #7 /var/www/html/wiki/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
    #8 /var/www/html/wiki/lib/tpl/dokuwiki/main.php(60): tpl_content()
    #9 /var/www/html/wiki/inc/actions.php(30): include('...')
    #10 /var/www/html/wiki/doku.php(131): act_dispatch()
    #11 {main}
2024-11-10 15:17:07E_WARNING: Undefined array key "ltime"/var/www/html/wiki/lib/plugins/sync/admin.php(324)
    #0 /var/www/html/wiki/lib/plugins/sync/admin.php(324): dokuwiki\ErrorHandler::errorHandler()
    #1 /var/www/html/wiki/lib/plugins/sync/admin.php(188): admin_plugin_sync->_profileform()
    #2 /var/www/html/wiki/inc/template.php(205): admin_plugin_sync->html()
    #3 /var/www/html/wiki/inc/Action/Admin.php(43): tpl_admin()
    #4 /var/www/html/wiki/inc/template.php(120): dokuwiki\Action\Admin->tplContent()
    #5 [internal function]: tpl_content_core()
    #6 /var/www/html/wiki/inc/Extension/Event.php(134): call_user_func_array()
    #7 /var/www/html/wiki/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
    #8 /var/www/html/wiki/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
    #9 /var/www/html/wiki/lib/tpl/dokuwiki/main.php(60): tpl_content()
    #10 /var/www/html/wiki/inc/actions.php(30): include('...')
    #11 /var/www/html/wiki/doku.php(131): act_dispatch()
    #12 {main}
2024-11-10 15:17:29E_WARNING: Undefined array key "sync_pages"/var/www/html/wiki/lib/plugins/sync/admin.php(110)
    #0 /var/www/html/wiki/lib/plugins/sync/admin.php(110): dokuwiki\ErrorHandler::errorHandler()
    #1 /var/www/html/wiki/inc/template.php(205): admin_plugin_sync->html()
    #2 /var/www/html/wiki/inc/Action/Admin.php(43): tpl_admin()
    #3 /var/www/html/wiki/inc/template.php(120): dokuwiki\Action\Admin->tplContent()
    #4 [internal function]: tpl_content_core()
    #5 /var/www/html/wiki/inc/Extension/Event.php(134): call_user_func_array()
    #6 /var/www/html/wiki/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
    #7 /var/www/html/wiki/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
    #8 /var/www/html/wiki/lib/tpl/dokuwiki/main.php(60): tpl_content()
    #9 /var/www/html/wiki/inc/actions.php(30): include('...')
    #10 /var/www/html/wiki/doku.php(131): act_dispatch()
    #11 {main}
2024-11-10 15:17:29E_WARNING: Undefined array key "sync_media"/var/www/html/wiki/lib/plugins/sync/admin.php(110)
    #0 /var/www/html/wiki/lib/plugins/sync/admin.php(110): dokuwiki\ErrorHandler::errorHandler()
    #1 /var/www/html/wiki/inc/template.php(205): admin_plugin_sync->html()
    #2 /var/www/html/wiki/inc/Action/Admin.php(43): tpl_admin()
    #3 /var/www/html/wiki/inc/template.php(120): dokuwiki\Action\Admin->tplContent()
    #4 [internal function]: tpl_content_core()
    #5 /var/www/html/wiki/inc/Extension/Event.php(134): call_user_func_array()
    #6 /var/www/html/wiki/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
    #7 /var/www/html/wiki/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
    #8 /var/www/html/wiki/lib/tpl/dokuwiki/main.php(60): tpl_content()
    #9 /var/www/html/wiki/inc/actions.php(30): include('...')
    #10 /var/www/html/wiki/doku.php(131): act_dispatch()
    #11 {main}
2024-11-10 15:17:29E_WARNING: Undefined array key "startsync"/var/www/html/wiki/lib/plugins/sync/admin.php(145)
    #0 /var/www/html/wiki/lib/plugins/sync/admin.php(145): dokuwiki\ErrorHandler::errorHandler()
    #1 /var/www/html/wiki/inc/template.php(205): admin_plugin_sync->html()
    #2 /var/www/html/wiki/inc/Action/Admin.php(43): tpl_admin()
    #3 /var/www/html/wiki/inc/template.php(120): dokuwiki\Action\Admin->tplContent()
    #4 [internal function]: tpl_content_core()
    #5 /var/www/html/wiki/inc/Extension/Event.php(134): call_user_func_array()
    #6 /var/www/html/wiki/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
    #7 /var/www/html/wiki/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
    #8 /var/www/html/wiki/lib/tpl/dokuwiki/main.php(60): tpl_content()
    #9 /var/www/html/wiki/inc/actions.php(30): include('...')
    #10 /var/www/html/wiki/doku.php(131): act_dispatch()
    #11 {main}
2024-11-10 15:17:29E_WARNING: Undefined array key "ltime"/var/www/html/wiki/lib/plugins/sync/admin.php(324)
    #0 /var/www/html/wiki/lib/plugins/sync/admin.php(324): dokuwiki\ErrorHandler::errorHandler()
    #1 /var/www/html/wiki/lib/plugins/sync/admin.php(188): admin_plugin_sync->_profileform()
    #2 /var/www/html/wiki/inc/template.php(205): admin_plugin_sync->html()
    #3 /var/www/html/wiki/inc/Action/Admin.php(43): tpl_admin()
    #4 /var/www/html/wiki/inc/template.php(120): dokuwiki\Action\Admin->tplContent()
    #5 [internal function]: tpl_content_core()
    #6 /var/www/html/wiki/inc/Extension/Event.php(134): call_user_func_array()
    #7 /var/www/html/wiki/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
    #8 /var/www/html/wiki/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
    #9 /var/www/html/wiki/lib/tpl/dokuwiki/main.php(60): tpl_content()
    #10 /var/www/html/wiki/inc/actions.php(30): include('...')
    #11 /var/www/html/wiki/doku.php(131): act_dispatch()
    #12 {main}
2024-11-10 15:17:52E_WARNING: Undefined array key "no"/var/www/html/wiki/lib/plugins/sync/admin.php(20)
    #0 /var/www/html/wiki/lib/plugins/sync/admin.php(20): dokuwiki\ErrorHandler::errorHandler()
    #1 /var/www/html/wiki/inc/Extension/PluginController.php(130): admin_plugin_sync->__construct()
    #2 /var/www/html/wiki/inc/pluginutils.php(55): dokuwiki\Extension\PluginController->load()
    #3 /var/www/html/wiki/inc/Ui/Admin.php(134): plugin_load()
    #4 /var/www/html/wiki/inc/Ui/Admin.php(32): dokuwiki\Ui\Admin->getPluginList()
    #5 /var/www/html/wiki/inc/template.php(208): dokuwiki\Ui\Admin->show()
    #6 /var/www/html/wiki/inc/Action/Admin.php(43): tpl_admin()
    #7 /var/www/html/wiki/inc/template.php(120): dokuwiki\Action\Admin->tplContent()
    #8 [internal function]: tpl_content_core()
    #9 /var/www/html/wiki/inc/Extension/Event.php(134): call_user_func_array()
    #10 /var/www/html/wiki/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
    #11 /var/www/html/wiki/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
    #12 /var/www/html/wiki/lib/tpl/dokuwiki/main.php(60): tpl_content()
    #13 /var/www/html/wiki/inc/actions.php(30): include('...')
    #14 /var/www/html/wiki/doku.php(131): act_dispatch()
    #15 {main}

Deprecated warnings:

024-11-10_dokuwiki_1731254549

@eduardomozart
Copy link
Author

I figure out that using the refactory branch with bugfixes applied (#74) does make the migration more stable. This issue still occurs to me, but less than before, at least I'm able to sync my Wikis. One is running PHP 8 (the wiki with the remote plugin) and the other one is running PHP 7.4 (the remote wiki).

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

4 participants