News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Package Manager 1.1 Beta 3 Error..

Started by Togster, July 04, 2005, 08:38:42 AM

Previous topic - Next topic

Togster

When I try and download any mods using the package manager I get the following error:-

An Error Has Occurred!
You cannot download or install new packages because the Packages directory is not writable!

now, when I go into my site Via FTP and to the packages directory, it is CHMOD correctly, and the file for the mod I just tried to download/install is there, I found this odd and so though maybe CHMOD the directory from writtable, then to writtable again, my FTP client would not let me do this, saying I didnt have the permissions, which was when I noticed the file owner's are different for a lot of the files since the upgrade, this appears to be the problem.

I felt sure older versions of SMF had a file manager in the admin panel that I used to cure this before (that else it was some other forum ive used before, sorry ;p), but since I can find it I post here for help

Thanks in advance

EDIT:-

it let me delete the packages directory and re-upload the one from the upgrade package which has changed the owner of the directory, but still the error, I noticed the different owners on files in Sources directory too, and I can even CHMOD or DELETE them, on my own site, lol..

Togster

#1
sorry to double post...

in addition to this I have had my hosts update all the file ownerships in the forum directory and it still does as above..

One last thing so I am giving all the info possible, if I try and upload the file from my Computer using the package manager on the forums, its says not valid or corrupt file..

Grudge

Togster,

You need to chmod ALL the main SMF directories to 777 (Sources, Themes, Themes/default, Themes/default/languages, Themes/default/images) and all the files inside. You ALSO need to chmod installed.list and server.list to 777, AND index.php and SSI.php. SMF should prompt for ftp information though?
I'm only a half geek really...

Togster

still no go, I even CHMOD the directory to 644, then the package manager said it wasnt writtable, put in FTP info, the package manager CHMOD the directory to 777 (i checked) and... STILL the same error message, very odd

Isaac

Quote from: Togster on July 05, 2005, 02:03:12 AM
still no go, I even CHMOD the directory to 644, then the package manager said it wasnt writtable, put in FTP info, the package manager CHMOD the directory to 777 (i checked) and... STILL the same error message, very odd
Did you CHMOD everything else grudge said to 777?

[Unknown]

The error you're getting occurs in only the following cases:

  - it tries to write to a file in the Packages directory, and cannot.
  - after downloading the package, it tries to read it and it gets an error.
  - trying to create a temp directory fails.

To find out which it is, open PackageGet.php, and find this:

if (empty($context['package']))
fatal_lang_error('package_cant_download', false);


Replace it with:

if (empty($context['package']))
fatal_error('found me!', false);


If you get "found me!" when trying to download, it's trying to read the package.  If you get the old error still, it's trying to write.

-[Unknown]

Togster

#6
An Error Has Occurred!
found me!

hmmmm, its reading the package thats the issue then..

just as further info, it does download them to the package directory ok it seems, and it sticks them there with a CHMOD of 666, and I cant CHMOD them to change them.. permission problem preventing them being read??

Now, if I use the cleanup permissions tool in the options part of the package manager, it does CHMOD them to 777, but they dont show up as packages in the browse package tab..

------------------------------------------------------------------

I will try a package upload install from my HD drive again:-

ok, tried, doing this hangs the page totally in my browser, make it so I cant goto the URL for about 3 or 4 mins.. though I can still use FTP, and see it uploaded the package with 777, and creates a temp directory which ISNT 777

In the temp directory it creates 2 files, one is called _StaticPageMod.php (the mod im using to test, that and memberpermissions one mostly) with 666 and the other .pureftpd-upload.(load of chars) with 644


(and yes, thanks for the help so far guys, this has got me scratching my head, though im no expert ;))

mager

I am getting the same thing, cant seem to find a fix for it  :'(
http://www.dnlforum.com  Dark and Light Unofficial Forum

mager

I get "Found me"  btw when I try and download something, anyone know how to fix this?
http://www.dnlforum.com  Dark and Light Unofficial Forum

FinalSoul

Quote from: mager on July 06, 2005, 12:26:37 AM
I am getting the same thing, cant seem to find a fix for it  :'(
Me, too. :(

[Unknown]

Shortly above that, find this:

$rf = @fopen($url . $_REQUEST['package'], 'rb');
if (!$rf)
{
fwrite($fp, fetch_web_data($url . $_REQUEST['package']));
}
else
{
while (!feof($rf))
fwrite($fp, fread($rf, 1024));
fclose($rf);
}
fclose($fp);


Let's try replacing that with:

$rf = fopen($url . $_REQUEST['package'], 'rb');
if (!$rf)
{
echo 'Looks like allow_url_fopen is disabled!<br />';
fwrite($fp, fetch_web_data($url . $_REQUEST['package']));
}
else
{
while (!feof($rf))
fwrite($fp, fread($rf, 1024));
fclose($rf);
}
fclose($fp);

echo 'File size is: ', filesize($boarddir . '/Packages/' . $package_name), '<br />';


From this we can tell:

1. Which code is being used.
2. If the file is being downloaded in full.

-[Unknown]

Togster

ok, done that, still get:-

An Error Has Occurred!
found me!

:o

FinalSoul

QuoteAn Error Has Occurred!
found me!
:-\

Noiz

#13
Quote from: Grudge on July 04, 2005, 04:18:10 PM
Togster,

You need to chmod ALL the main SMF directories to 777 (Sources, Themes, Themes/default, Themes/default/languages, Themes/default/images) and all the files inside. You ALSO need to chmod installed.list and server.list to 777, AND index.php and SSI.php. SMF should prompt for ftp information though?

Urgh, I was having the same problem so I tried the above but it's completely killed the forum! I now get a "500 Internal Server Error" for the entire forum. :(

Of course there's a whole load of files in those folders listed above so I have no idea what files would need to be changed to what in order to fix it back. Argh!

Any help will be very much appreciated. :)

Edit: As per the "why 777 isn't a security risk" post, I chmodded the entire forum tree to 777 and it still gives error 500. :(

Edit 2: The site error log has a whole load of these:


[2005-07-08 16:31:53]: error: directory is writable by others: (/home/shiftrun/public_html/forums)
[2005-07-08 16:31:09]: error: directory is writable by others: (/home/shiftrun/public_html/forums)
[2005-07-08 16:30:55]: error: directory is writable by others: (/home/shiftrun/public_html/forums)
[2005-07-08 16:30:05]: error: directory is writable by others: (/home/shiftrun/public_html/forums)
[2005-07-08 16:29:55]: error: directory is writable by others: (/home/shiftrun/public_html/forums)
[2005-07-08 16:14:05]: error: file is writable by others: (/home/shiftrun/public_html/forums/index.php)
[2005-07-08 16:14:01]: error: file is writable by others: (/home/shiftrun/public_html/forums/index.php)
[2005-07-08 16:13:21]: error: file is writable by others: (/home/shiftrun/public_html/forums/index.php)
[2005-07-08 16:13:14]: error: file is writable by others: (/home/shiftrun/public_html/forums/index.php)
[2005-07-08 16:13:07]: error: file is writable by others: (/home/shiftrun/public_html/forums/index.php)
[2005-07-08 16:10:49]: error: file is writable by others: (/home/shiftrun/public_html/forums/index.php)


Edit 1,000,000: I changed the forums directory and index.php to 755 and it's now working again. I'm hoping they're good values to use...

[Unknown]

Noiz, some servers use 755 instead of 777.

Oikay, please try replacing this:

$rf = @fopen($url . $_REQUEST['package'], 'rb');
if (!$rf)
{
fwrite($fp, fetch_web_data($url . $_REQUEST['package']));
}
else
{
while (!feof($rf))
fwrite($fp, fread($rf, 1024));
fclose($rf);
}
fclose($fp);

(original - same code I posted above.)

With:

fwrite($fp, fetch_web_data($url . $_REQUEST['package']));
fclose($fp);


That's probably better anyway.

-[Unknown]

Togster

It Works!!!!!!!!!! Genious!!

Thanks Unknown.... thats awsome..

* Togster bows to unknown...

bambi



:D

¡Albricias!  ¡Funciona!   ¡It works!

mager

http://www.dnlforum.com  Dark and Light Unofficial Forum

FinalSoul

Quote from: Togster on July 09, 2005, 03:49:05 AM
It Works!!!!!!!!!! Genious!!

Thanks Unknown.... thats awsome..

* Togster bows to unknown...
I love it when people spell genius wrong. :P

And yes, it worked for me too.

freep99

ok, all of the above has been done and still no go.

i'm on a dedicated server which uses 0777. i've double and triple checked the permissions and everything is writable. i can download packages, list the files and delete the packages from the manager but i'm still getting "You cannot download or install new packages because the Packages directory is not writable! " when i try to apply the mods.

what else could be causing this?

Advertisement: