Topic: [pun_repository bug] Extension installing system

Hi, I get the following errors whe nI try to autoamtically install extensions:

These two are php errors:
Notice: Undefined index: Install extensions in [mypath]/extensions.php(664) : eval()'d code on line 195

Notice: Undefined index: admin_extensions_install in [mypath]/extensions.php(664) : eval()'d code on line 195

And this appears in a red box in the admin panel:
ERROR! Files couldn't be extracted from the downloaded archive. The next errors appear while extracting:
Error while opening {'../extensions/pun_bbcode/styles.css'} in write binary mode

What is wrong? The extensions folder is chmoded to 777.

Re: [pun_repository bug] Extension installing system

I'm not 100% sure, but your server probably can't fully extract the .zip file.

Re: [pun_repository bug] Extension installing system

maststef wrote:

I get the following errors when I try to automatically install extensions

You mean you use pun_repository?
Try to remove the pun_bbcode.tgz file form /extensions/ - looks like it was broken while downloading.
If this doesn't help, try to uninstall all extensions and remove their directories - except pun_repository! - and try to download/install again.

Carpe diem

Re: [pun_repository bug] Extension installing system

Yes, I use the repository.

There is no tgz file in the extensions dir. Seems that it isn't even downloaded. But the extensions directory is 777 (I did just recheck).

Hotfix installation works without problems (is this even based on the same technology?).

Re: [pun_repository bug] Extension installing system

Do you use latest version of pun_repository?

Carpe diem

Re: [pun_repository bug] Extension installing system

I use 1.2.1.

Re: [pun_repository bug] Extension installing system

pun_repository contains no calls to Install extensions or admin_extensions_install. This looks like problem with other extension. Try to disable them one by one. Maybe it is pun_admin_extensions_improved (not updated for 1.3 yet).

Carpe diem

Re: [pun_repository bug] Extension installing system

Sorry, I was wrong. This issue actually was fixed in [892] 9 days ago.
New version of pun_repository is available in http://punbb.informer.com/extensions/.

Carpe diem

Re: [pun_repository bug] Extension installing system

I just installed 1.2.2. The PHP Errors are gone, but the following is still there.
"ERROR! Files could not be extracted from the downloaded archive. The next errors appear while extracting:
Error while opening {'../extensions/pun_bbcode/styles.css'} in write binary mode"

extensions directory is set to 777.

But still, it seems that the file isn't even downloaded (because it isn't on the ftp). The archives are to downloaded to the extensions dir, aren't they?

Re: [pun_repository bug] Extension installing system

maststef wrote:

But still, it seems that the file isn't even downloaded (because it isn't on the ftp). The archives are to downloaded to the extensions dir, aren't they?

pun_repository removes the archive even on errors.

other extensions installed? can you post results of "ls -la ./extensions/" command here?

Carpe diem

Re: [pun_repository bug] Extension installing system

I also have the official PM system installed, latest version. But that's all.

How do I run that command? I have no root access, only ftp. But it gives only the file list, am I right? There's index.html and the two folders pun_repository and pun_pm, no hidden files.

Re: [pun_repository bug] Extension installing system

PunBB 1.3, all current hotfixes (three) installed, pun_repository 1.2.2 and pun_pm 1.2.2. 0777 set for ./extensions/. Yup?

OS/Apache/PHP versions?

We'll try to reproduce.

Carpe diem

Re: [pun_repository bug] Extension installing system

Exactly, this is my configuration.

PHP: 5.2.6-0.dotdeb.1
MySQL Standard 5.0.51a
OS: Debian
Apache 2

Is it possible that some needed PHP function is disabled?

Also, when I try to download the tgz manually to my computer it takes like 2 seconds to set up the connection. But on the forum the error message appears without delay. Can it be that the file isn't even tried to be downloaded?

Re: [pun_repository bug] Extension installing system

Sorry for double post. But are there any news on the issue?

Is setting "extensions" to 0777 the only requirement? Or could it be that I must change some others things?

Re: [pun_repository bug] Extension installing system

Anatoly wrote:

PunBB 1.3, all current hotfixes (three) installed, pun_repository 1.2.2 and pun_pm 1.2.2. 0777 set for ./extensions/. Yup?

OS/Apache/PHP versions?

We'll try to reproduce.

                        Carpe diem

Running punbb 1.3 (migration from old 1.2 install, never got any errors on database conversion)
All three hotfixes installed successfully
Only extension installed is pun_repository 1.2.2

Path permissions should be fine:
[root@nozomu ~]# ls -ld /some_path/forum/extensions/
drwxrwxrwx 3 user group 4096 Nov 21 10:29 /some_path/forum/extensions/

OS (CentOS 5.x)
[root@nozomu ~]# cat /etc/redhat-release
CentOS release 5.2 (Final)

Apache Version:
[root@nozomu ~]# httpd -v
Server version: Apache/2.2.3
Server built:   Jan 15 2008 20:33:30

PHP Version:
[root@nozomu ~]# php -v
PHP 5.2.6 (cli) (built: May  5 2008 18:16:01)
Copyright (c) 1997-2008 The PHP Group

MySQL Version:
[root@nozomu ~]# mysql -V
mysql  Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (i686) using readline 5.0

Errors:

From forum software:
ERROR! Files could not be extracted from the downloaded archive. The next errors appear while extracting:
Error while opening {'../extensions/pun_antispam/index.html'} in write binary mode

From apache error_log:

[Fri Nov 21 10:23:22 2008] [error] [client x.x.x.x] PHP Notice:  Undefined index:  Install extensions in /some_path/forum/admin/extensions.php(664) : eval()'d code on line 195, referer: http://some_domain/forum/admin/extensions.php?section=manage
[Fri Nov 21 10:23:22 2008] [error] [client x.x.x.x] PHP Notice:  Undefined index:  admin_extensions_install in /some_path/forum/admin/extensions.php(664) : eval()'d code on line 195, referer: http://some_domain/forum/admin/extensions.php?section=manage

I was able to install the extensions manually.

16 (edited by Parpalak 2008-11-21 18:45)

Re: [pun_repository bug] Extension installing system

Thanks for the detailed information. Looks like a command fopen('...', 'wb') fails. Is there a directory in extensions/ after this failure? In other words, please, run this command

ls /some_path/forum/extensions/ -la

EDIT: Well, I have already understood that there will be nothing smile

I couldn't reproduce this bug on my hosting. I ask you to edit sources of pun_repository (for bug searching). Can you do it for PunBB, please? smile

If yes, comment or remove the following lines (about 129-130) in pun_repository.php

        unlink(FORUM_ROOT.'extensions/'.$ext_id.'.tgz');
        @pun_repository_rm_recursive(FORUM_ROOT.'extensions/'.$ext_id);

and then see the output ofls /some_path/forum/extensions/ -la and ls /some_path/forum/extensions/pun_antispam/ -la (or any other extension that you will to install via pun_repository).

Re: [pun_repository bug] Extension installing system

maststef wrote:

Is setting "extensions" to 0777 the only requirement? Or could it be that I must change some others things?

I tell you how the pun_repository extension works. It creates a directory in extensions/. For example, if you install pun_antispam, it creates extensions/pun_antispam directory. Then it tries to download the extension archive from server and saves it to creates extensions/pun_antispam/pun_antispam.tgz. After it extracts files from the archive and deletes the archive. Finally it make a redirect as if you press 'Install' link smile

Seems like the 0777 permissions for extensions directory is the only one requirement that makes pun_repository working.

Any ideas why it doesn't work?

Re: [pun_repository bug] Extension installing system

You mean the direction of the addon that should be installed?

Nope, the directory is not there.

By the way, should uninstalling an extension delete the actual files, too (or only the db content)? Because I tested deleting an extension and the files stayed.

Re: [pun_repository bug] Extension installing system

maststef wrote:

You mean the direction of the addon that should be installed?

I've already understood this and edited my post smile
See it, please.

maststef wrote:

By the way, should uninstalling an extension delete the actual files, too (or only the db content)?

No. You have to delete extension files manually, because you have to upload them manually too. Forum core doesn't know, that with pun_repository you do not really have to upload them smile

20 (edited by guest1234 2008-11-21 19:01)

Re: [pun_repository bug] Extension installing system

I did it.

The tgz file is there, the (empty!) folder is created with 0777. So the problem is at extracting the files.
Is it possible that my PHP configuration does not allow extraction? Where can I check this?

Re: [pun_repository bug] Extension installing system

maststef wrote:

The tgz file is there

Can files be extracted from the archive manually?

maststef wrote:

Is it possible that my PHP configuration does not allow extraction? Where can I check this?

We've modified the code from PHP PEAR (or something else, I don't remember) and included in pun_repository. So extraction shouldn't depend on PHP configuration. But who knows... Please send me what phpinfo() outputs via PM or e-mail.

Obviously the following line (871, pun_repository_tar_extract.php) fails:

if (($v_dest_file = @fopen($v_header['filename'], "wb")) == 0) {

You could try to make it more accurate (though I don't really believe this will help, we should check out this way too):

if (($v_dest_file = fopen($v_header['filename'], "wb")) === false) {

Re: [pun_repository bug] Extension installing system

Changing this line did nothing.

What exactly do you need from the php info? It's very long wink

Re: [pun_repository bug] Extension installing system

maststef wrote:

What exactly do you need from the php info?

I don't know yet smile
Maybe I'll find there something.

We'll try to reproduce this bug on the test server next week.

Re: [pun_repository bug] Extension installing system

parpalak wrote:

Thanks for the detailed information. Looks like a command fopen('...', 'wb') fails. Is there a directory in extensions/ after this failure? In other words, please, run this command
ls /some_path/forum/extensions/ -la
EDIT: Well, I have already understood that there will be nothing

I couldn't reproduce this bug on my hosting. I ask you to edit sources of pun_repository (for bug searching). Can you do it for PunBB, please?

If yes, comment or remove the following lines (about 129-130) in pun_repository.php
        unlink(FORUM_ROOT.'extensions/'.$ext_id.'.tgz');
        @pun_repository_rm_recursive(FORUM_ROOT.'extensions/'.$ext_id);
and then see the output ofls /some_path/forum/extensions/ -la and ls /some_path/forum/extensions/pun_antispam/ -la (or any other extension that you will to install via pun_repository).

Last edited by parpalak (Yesterday 12:45:50)

No, there was no directory in there when I got a failed install originally (I did install these manually later, but I still want to troubleshoot how pun_repository works).

I commented out those lines for you in pun_repository.php, I assume that means that it won't remove the directory and archive if it fucks up.  Right now, I am testing by installing extension pun_bbcode via pun_repository.

This is what happens when I now attempt it:

Error from forum:
ERROR! Files could not be extracted from the downloaded archive. The next errors appear while extracting:
Error while opening {'../extensions/pun_bbcode/styles.css'} in write binary mode

ls -lah /some_path/forum/extensions | grep pun_bbcode
drwxrwxrwx 2 apache  apache 4.0K Nov 22 12:17 pun_bbcode
-rw-r--r-- 1 apache  apache  13K Nov 22 12:17 pun_bbcode.tgz

NOTE:  My punbb install is on a Plesk domain, and Plesk typically forces web content to have the following ownership scheme
user: username associated with domain
group: always 'psacln'

Now, there's nothing at all in the apache error_log, so this has got to be a permissions issue based on my environment.  This is further proven since the archive has 644 perms belonging to the apache user, and the resulting directory is empty.

Is there anyway anything can be done from the development end to catch this?  Or should I just continue to install extensions manually?

Re: [pun_repository bug] Extension installing system

My system also runs on Plesk. Maybe it has really to do with it?