tatewake/dokuwiki-plugin-backup

not working on Release 2016-06-26 "Elenor of Tsort"

jkldgoefgkljefogeg opened this issue · 16 comments

Fatal error: Call to undefined method admin_plugin_backup::render() in /var/www/dokuwiki/lib/plugins/backup/admin.php line 289, 315

It worked fine before the upgrade.

It's not working for me too after upgrade to Elenor of Tsort.

For me, shows this error:

Warning: exec() has been disabled for security reasons in [...]/lib/plugins/backup/admin.php on line 350

When I try to create the backup (PEAR Archive Library), shows:

Fatal error: Call to undefined method PEAR::_Archive_Tar() in /usr/local/lib/php/PEAR.php on line 219

A file *.tar.gz is created; but when I try to acces them via ftp, the file is broken.

As the same, the plugin works well in Detritus, before upgrade.

dsp77 commented

Could you both post what php version you are running?

You can get the version via the ?do=check call:

http://yourdomain/yourwiki/doku.php?do=check

dsp77 commented

@carlosnasci I found this answer on stackoverflow:

http://stackoverflow.com/questions/11711675/warning-exec-has-been-disabled-for-security-reasons

It seems like that your service provider disabled the use of exec() for your hosting. Not sure why it worked before. Could you investigate changes of your hosting provider.

@dsp77

?do=check answer:

DokuWiki version: Release 2016-06-26 "Elenor of Tsort"
PHP version 5.3.29
More than 32MB RAM (134217728 bytes) available.
Changelog is writable
conf directory is writable
mb_string extension is available and will be used
Your locale C seems not to be a UTF-8 locale, you should fix this if you encounter problems.
Debugging support is disabled
You are currently logged in as XXXXXX (X)
You are part of the groups admin, user
Your current permission for this page is 255
The current page is writable by the webserver
The current page is writable by you
The search index seems to be working

About host: I've run backup plugin just before the upgrade, normally, without any problem; when I try to run backup again after the upgrade, the plugin got errors. In this case, I think that the problem isn't with the host server. May be any conflict with new directives of PHP inside dokuwiki core?

The upgrade was made with the "upgrade plugin" (made by Andreas Gohr).

dsp77 commented

I did a fresh install under apache2 with php5.6 and the plugin installed with the plugin manager.

DokuWiki version: Release 2016-06-26 "Elenor of Tsort"
PHP version 5.6.23-1+deb.sury.org~xenial+2
More than 32MB RAM (134217728 bytes) available.
Changelog is writable
conf directory is writable
mb_string extension not available - PHP only replacements will be used
Your locale C seems not to be a UTF-8 locale, you should fix this if you encounter problems.
Debugging support is disabled
You are currently logged in as hugo
You are part of the groups admin, user
Your current permission for this page is 255
The current page is writable by the webserver
The current page is writable by you
The search index seems to be working

I am getting backups created with the setting "GNU Tar (filtered)" and all possible selections checked. However, I don't see the created file in the web page. Only if I go into the file system under data/media/wiki/backup/ I see the file. I am also able to unpack it.

Will look into that further.

Now I changed my PHP to version 5.6.22 (previous was 5.3.29).

The errors messages gone away, but the page itself continues completely broken: (a) the upper, the lower and the sidebar had completely disappeared, (b) the files just created are not shown, (c) the message about the creation of the backup file disappeared (now it's only seen a empty green message box in the space that used to be notify about the creation of the file, with file name, file size, etc.).

I've tryed PHP 7.0 too, but the result was worst than the 5.6 (didn't create the backup file and shows several error messages).

After this quick tests (changing the PHP engine in cPanel), I believe even more in a incompatibility between the backup plugin AND the way that the dokuwiki's core works with the PHP engine (but I don't know identify what or why it's happening).

P.S.: The files in /data/media/wiki/backup generated in PHP 5.6 can be opened via FTP without erros; so, the problem isn't with the way plugin generate the files.

It was working before Release 2016-06-26 "Elenor of Tsort" on PHP version 5.6.19

After upgrade to Elenor of Tsort, I get the error as reported.

Then I switched to PHP version 7.0.6 and started seeing a lot more warnings

Warning: Declaration of admin_plugin_backup::getMenuText() should be compatible with DokuWiki_Admin_Plugin::getMenuText($language) in /dokuwiki/lib/plugins/backup/admin.php on line 344

Warning: Cannot modify header information - headers already sent by (output started at /dokuwiki/lib/plugins/backup/admin.php:344) in /dokuwiki/inc/actions.php on line 210

Warning: Cannot modify header information - headers already sent by (output started at /dokuwiki/lib/plugins/backup/admin.php:344) in /dokuwiki/lib/tpl/dokuwiki/main.php on line 12

Fatal error: Uncaught Error: Call to undefined method admin_plugin_backup::render() in /dokuwiki/lib/plugins/backup/admin.php:289 Stack trace: #0 /dokuwiki/inc/template.php(263): admin_plugin_backup->html() #1 /dokuwiki/inc/template.php(164): tpl_admin() #2 /dokuwiki/inc/events.php(111): tpl_content_core('admin') #3 /dokuwiki/inc/events.php(238): Doku_Event->trigger('tpl_content_cor...', true) #4 /dokuwiki/inc/template.php(83): trigger_event('TPL_ACT_RENDER', 'admin', 'tpl_content_cor...') #5 /dokuwiki/lib/tpl/dokuwiki/main.php(59): tpl_content() #6 /dokuwiki/inc/actions.php(199): include('/home/sfdaasdf2...') #7 /dokuwiki/doku.php(124): act_dispatch() #8 {main} thrown in /dokuwiki/lib/plugins/backup/admin.php on line 289

Despite the fatal error, backup file was created and delete function works.

dsp77 commented

The core seems to be this problem: Fatal error: Call to undefined method admin_plugin_backup::render()

I added debug information and a list of existing backup files are passed to that function, but it does not display them.

I am looking into finding a fix for php5.6 first.

Appears fixed by @dsp77 with commit ad918cb . Let me know if this fixes the issue. If so, I'll close the ticket. Thanks.

I've changed /lib/plugins/backup/admin.php as indicated in [https://github.com/tatewake/dokuwiki-plugin-backup/commit/ad918cbec8d63c7b35c3638a4b539c8a5d39c503] and it's working pretty fine now (better than in the past, before upgrading to Elenor of Tsort, when some errors messages appeared here).

This modifications in admin.php will be included in a final version? Or will be necessary to do this change manually in the future/in other installations?

@carlosnasci , this change was committed 5 hours ago, meaning if you download the "latest version", it will have this patch in. So in other words, it's in, you won't need to manually change anything.

I'll also take this as confirmation that @dsp77 's code change works, so I'm going to close this ticket and consider the issue resolved.

If you like this project, don't forget to donate!

http://tjgrant.com/wiki/donate

tested no error with PHP version 5.6.19 and 7.0.6. Thanks.

when will the extension get updated?

Like I said, it's updated. Uninstall and reinstall it if you're having issues.

dsp77 commented

Well, that is probably my fault. I did not updated the date in plugin.conf. Will fix that later.

@dsp77 , thanks again for your help.