Forums | Mahara Community

Support /
Problems with file uploads


anonymous profile picture
Account deleted
Posts: 91

02 March 2009, 8:58

Moving Post ...Sorry Embarassed
anonymous profile picture
Account deleted
Posts: 91

27 February 2009, 13:15

I took a look at my headers after Nigel said he saw a 500 error in one of yours, you can view them here if you are interested:

http://pastebin.com/m10a5afb4

What is in that pastebin is all there is from the failing system, it always gets stuck at that point...but on our test system (which works) the headers are the same up to that point but are followed with more heasders, this being the beginning of the first one:

http://mahara.bcu.ac.uk/artefact/file/myfiles.json.php

POST /artefact/file/myfiles.json.php HTTP/1.1

The Apache logs arent much help, they just tell me:

 [Fri Feb 27 15:37:55 2009] [error] [client 10.10.10.10] File does not exist: /var/www/mahara/htdocs/admin/site/blank.html, referer: http://mahara.bcu.ac.uk/admin/site/files.php

(I just blanked my IP above... it is not an error)

Sooo... any ideas why a request would be made for "blank.html"???

Edit: not sure that blank.html error is actually related as it is not appearning now.

Also, I am within the upload limit and have /usr/bin/file installed... and do not believe there are any other limitations... as mentioned user profile images upload fine...

 

Jez

 

anonymous profile picture
Account deleted
Posts: 1643

28 February 2009, 3:06

Hi - those headers sent from the "failing" system actually look ok, so I think maybe you are having a different issue?

The blank.html is not related to any issue, I think it's something to do with the default src attribute for a hidden iframe used on the page.

Mahara 1.1 doesn't require /usr/bin/file. So I'm not sure exactly what the issue is with your install...

I'll reply in your other thread too.

anonymous profile picture
Account deleted
Posts: 91

02 March 2009, 8:59

Ok luckily we had another Ubuntu Install which was working... we copied the php.ini file from that and got this one working too.

After a lot of messing we found that the latest php.ini file created by the Ubuntu packages had lines in it referring to ClamAV.

Once these clamAV lines were commented out of php.ini and apache was restarted file uploads worked as they should.

I still have clamAV running and activated in the Mahara Config... just no references to it in php.ini

My guess is that user icon / avatar uploads are not virus scanned which is why the avatar uploads worked and the file uploads failed?

Jez
anonymous profile picture
Account deleted
Posts: 16

02 March 2009, 15:07

That's interesting Jez. I will check our php.ini file out at school tomorrow.
anonymous profile picture
Account deleted
Posts: 16

03 March 2009, 9:20

Hi Jez and Nigel,

I have commented out the section in php.ini about clamAV (see below) and file uploads seem to be working now - at least some of them! This was right at the end of the php.ini file.

; Commented out all extensions below to try out fix for Mahara - JWS 03-03-09
;extension=clamav.so
[clamav]
;clamav.dbpath=/var/lib/clamav
;clamav.maxreclevel=0
;clamav.maxfiles=0
;clamav.archivememlim=0
;clamav.maxfilesize=0
;clamav.maxratio=0

 I have successfully uploaded a ods file, but when I try to upload a doc or ppt file it tells me I am not allowed to upload files of this type! (I have checked and both doc and ppt are allowed in the site config.)

Now files are uploading I think I will upgrade to the latest version and see if we can get doc and ppt uploading once there is no relience on /file for the uploads.

Jon

anonymous profile picture
Account deleted
Posts: 1643

02 March 2009, 17:07

Hi - it's worth pointing out that ClamAV integration was done waaaay back in the original development of Mahara, and hasn't been tested by us for a couple of years! So there might be issues around it...

anonymous profile picture
Account deleted
Posts: 16

03 March 2009, 13:44

Hi Nigel,

I don't think this has anything to do with the ClamAV integration into Mahara. (We have not even tried to link Clam AV into Mahara!)

It seems to me that when you do an apt-get install of clam av it adds these lines into your php.ini file. For some reason these are stopping the files from uploading to Mahara...

We have Clam Av running within Moodle and even with these lines commented out it still functions correctly in Moodle.

I will have a little look around to see if I can find anymore info about why clam AV is writing into teh php.ini file...

Jon

anonymous profile picture
Account deleted
Posts: 16

03 March 2009, 14:03

OK,

with the clam AV extension loaded by teh php.ini file it gives you access to these extra functions for scanning uploaded files:

cl_info
cl_scanfile
cl_scanbuff
cl_setlimits
cl_scanfile_ex
cl_scanbuff_ex
cl_pretcode
clam_scan_buffer
clam_scan_file
clam_get_version

I'm wondering if it is one of these functions being called within the upload script for artifacts that is clashing with the Clam AV functions???

anonymous profile picture
Account deleted
Posts: 91

03 March 2009, 18:59

Pretty sure its going to be something along those lines... it certainly has no relation to the clam av settings in Mahara, and as you say it does not seem to affect Moodle.

I think the key to understanding the problem may be to compare the AV handling in upload file vs upload profile image processes, as upload profile image works even with these lines in php.ini...

 Jez