Can not create local file pool file, please verify permissions in dataroot and available disk space.

Can not create local file pool file, please verify permissions in dataroot and available disk space.

删除的用户 -
回帖数:32

Hello,

I have installed moodle 2.5.2.

I get the above error when I try to upload files to my 'private files', by drag and drop or by picking them.

However if I use the auto-feature to upload and install a plugin everything works.

The host company have double checked my installation. 

They say ' I can see that the config.php has the correct path and all appears OK. The permissions look OK and I can't see anything wrong there. The only thing I can think of is if Moodle is somehow not using the folder that you've defined.'

So you might also need to know.

I have one account with two domain names with  the same host.

On one web domain I have moodle 2.4 which works fine.

But the second domain where I have installed 2.5.2 works except for not being able to upload any files.

Can anybody think of anything simply I have 'over looked'.

The hosting company are very good and have sorted other problems for me but clearly we are 'missing' something obvious.

Thanks.

回复删除的用户

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Roger Mepham -

Hi I have the same problem that Moodle 2.5 gives the error cannot create local pool file. my host Tsohost.co.uk come back with the same theory somehow not writing to the folder.

This is on the cloud server option Tsohost with a manual 2.5 install. Oddly enough on the cpanel hosting they offer the auto install of moodle 2.5 works fine.

回复Roger Mepham

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Roger Mepham -

I have uploads working on the Cloud server by auto-installing Moodle 2.4.2 to a subfolder with a data folder inside the subfolder and then doing a manual upgrade to 2.5.

Uploads is still working when the data folder is moved outside of the public_html folder.

The next thing to try is getting it work with moodle at the root (i.e. not in a sub folder).

回复Roger Mepham

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Gary Lynch -

I had this problem and found that the server was basically full due to automated back up and course back up files eating into server space.

Cleaned up the drive and this corrected this error for me.
Ensure that you aplly good practice when backing up courses etc by storing them outside your Moodle server.

 

Not very technical answer but worked for me 微笑

回复Gary Lynch

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Roger Mepham -

Ok managed to get things working on TSOHost properly.

  1. Deleted entire site and created new Linux version
  2. Did an auto install of Moodle 2.4.2
  3. Checked site was working
  4. Upgraded to Moodle 2.5
  5. Moved data folder out of web root and altered config.php to point to new location

Phew!

回复Roger Mepham

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

删除的用户 -

Roger seems to have solved this. We both used the same hosting company. So thanks for all the help Roger. Thanks for the heads up with keeping the server clear Gary.

回复删除的用户

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Roger Mepham -

Ok guess I spoke too soon 伤心

Still cannot upload profile pics, or SCORM zip files - getting the cannot create pool file error again.. Managed to get a file folder going in a course and uploaded a ppt file and image. But the image does not show a preview although it can be retrieved from the folder.

Not sure how to proceed now....any suggestions?

回复Roger Mepham

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Roger Mepham -

I had a message from Jez...

"I was setting up Moodle for a friend on TSO Host and hit the same uplod error you mentioned in the forums.
I have another 2.4 install working fine with the same config.
Definitely seems to be a moodle bug conflicting with something in the TSO host setup.
Have you found a solution or raised a bug tracker for it?
Regards, Jez

12:58 AM: I forgot to mention, I checked my data directory and it has other files which have been placed in there by Moodle for caching etc, so Moodle can definitely write to that directory, again suggesting a Moodle bug..."
回复Roger Mepham

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Jez H -

Ok I think I have some information which may be of use to you. I was setting this up for a friend so they can play with Moodle, in the end I just rolled back to 2.4 and doubt I will spend too much time on it.

What I notced relates to installing moodle on a sub domain

  1. Clean 2.4 install works
  2. Clean 2.5 install fails as it cannot read / write data directory
  3. I can install Moodle 2.5 by manually creating config.php but then hit the same file upload error you report. Upgrade 2.4 > 2.5 "should" work (I have not tested this) on the same basis, that the config.php has already been created and copied over from your 2.4 installation

The difference between the two clean installs is that Moodle 2.4 and 2.5 auto detect different paths for the dataroot.

If you enable SSH / Shell access on your host and run (from the relevant point):

ls -l subdomains

You will see sub domains are added with a pointer:

 moodle -> /var/sites/m/moodle.yourdomain.com/public_html

But the main directory for the site would be

/var/sites/y/yourdomain.com/public_html

Notice the /y/ and /m/ letters in the paths generated by the first letter of the domain AND the subsequent creation of the sub domain.

You can therefore resolve the moodle directory on TWO possible paths:

/var/sites/y/yourdomain.com/subdomains/moodle

/var/sites/m/moodle.yourdomain.com/public_html

So, back to the three cases I gave earlier:

  1. When you run a clean install of Moodle 2.4 it picks up the correct paths
  2. When you run a clean install Moodle 2.5 it uses a the alternative subdomain.domain path which does not work
  3. You can get 2.5 to install by manually creating config.php, at which point you will see the file upload error. If you upgrade from 2.4 > 2.5 it should work as that config file was already correctly created by the 2.4 install and copied back over, but you will (are) hitting the same file upload issue after upgrade.

It does not matter whether you create the file manually or copy it over from 2.4 - 2.5, the point is it is pre-created and does NOT use Moodle 2.5 to build it.

This may be coincidental, but I doubt it.

It seems to me that somewhere else in the code Moodle 2.5 may be picking the alternative path again, possibly retrieving it from code (as it does during the installation process) as opposed to using the correct $CFG->dataroot the config dataroot setting.

At least that is my best guess at this time.

To test this further it would be good to know:

  1. whether you are also using subdomains
  2. what results you see when running clean installs of 2.4 and 2.5

Regards the second point, you do not need to actually install Moodle, just look at the first step of the installation where it asks you to confirm the directory paths.

Regards, Jez

 

回复Roger Mepham

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Mr Anchovy -

It is indeed a Moodle bug - well a 'feature' I suppose. I have had the same problem on TSOhost cloud hosting which, due to the way it is implemented, does not allow exclusive locking of files in the web space. You can fix this by editing lib/filestorage/file_storage.php and looking for the line

$newsize = file_put_contents($hashfile.'.tmp', $content, LOCK_EX);

.. replace this with:

$newsize = file_put_contents($hashfile.'.tmp', $content);

Issue submitted: MDL-43390

回复Mr Anchovy

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Tom McManus -

Had the same issue and this worked for me on Vidahost cloud running Moodle 2.6

Thanks.

回复Mr Anchovy

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Andy Fair -

I know this is an old thread, but for those using TSOHost or any other host that prevents file locking, a better solution is to add the following line to your config.php:

$CFG->preventfilelocking=True;

Even though it does work, the problem with MrAnchovy's solution is that his change would need to be made every time Moodle was upgraded; adding the above line to config.php would persist between upgrades without any more changes.


But hey! - either way works just as well!

回复Gary Lynch

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

删除的用户 -
Thanks Gary. The install was brand new and I had no files on the server. However it is shared cloud hosting and I don't know how these things work so maybe the problem is with my hosting server.
回复删除的用户

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Jez H -

Colin, I just noticed your comment:

"The only thing I can think of is if Moodle is somehow not using the folder that you've defined.'"

That is exactly what I am seeing on installation to a sub domain.

There are two possible paths due to TSO Host adding a pointer.

Moodle 2.4 chooses one path, Moodle 2.5 chooses the other.

Moodle 2.4 can read its path, Moodle 2.5 cannot read the path it takes (although it should be able to).

Whether this lies at the root of the file upload issue is another matter, but I think it is quite likely related.

Another important point is that Moodle 2.5 100% CAN write to its dataroot because I have seen it putting cached files in there.

This also leads me think that:

  1. Moodle 2.5 auto detects paths differently from 2.4
  2. There may be a part of Moodle which is resolving the path from code and not using the $CFG->dataroot setting which means we see an exception in 2.5 but not 2.4
回复Jez H

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Jerry Lau -

I have the same problem...

upgraded from 2.2.4+ to 2.5.2 without any problems and ran the upgrade multiple times as practice and have never encountered this

rhel 6.5 / php 5.3.3 / MySQL 5.1.

We tried to install the accessibility plugin

our dataroot has lots of room 32% unused in fact so that can't be the problem

/blocks is writeable and passed the plugin install test

Any thoughts?

 

 

回复Jerry Lau

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Ken Task -
Particularly helpful Moodlers的头像

@Jerry

First ... 'ran the upgrade multiple times' ... assume, on your last upgrade, it was with a newly imported DB, code directory, and copy of data directory.

In 2.5.x one can install plugins via Moodle UI.  Do you have SELinux confiigured?   How about any other PHP protection - Zend Shosin?

Did you try the old way 'manually' (block zip in blocks folder, unzip, manually set ownerships/permissions, hit Notifications to install).   Which way did you try?

Debugging on?

'spirit of sharing', Ken

 

回复Ken Task

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Jerry Lau -

Hi Ken,

Nice to talk with you again!

Yes, we tested and tested and practice an upgrade so we don't have any surprises when we do the actual upgrade on our production server.

We backed up the moodle 2.2.4+ db ... changed the config.php to point to the new "2.5.2+" basic version, moodledata is outside of web access and ran the upgrade.php via CLI method. No errors (as expected).

SELinux is off/disabled

Shosin is not there but zend is there but so are the other 2 test servers

the error is when someone tries to upload a file to an assignment and not just installing plugins. Sometimes and inconsistent at best, we open the document to be uploaded, saved it again as another file and tried to upload again and sometimes this would work but not 100% of the time...weird eh.

Debugging is on

 

 

 

回复Jerry Lau

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Ken Task -
Particularly helpful Moodlers的头像

Is your test environment *exactly* like your production environment?    Same OS version, same versions of Apache/MySQL/PHP, same drive setup?

Do apache error logs mention or show anything?

Where is your moodledata folder located?   Another large partition on same drive of server ... an NSF mount point?  Have you done anything to test IO?   https://code.google.com/p/ioping/

Are there any disk errors?

'spirit of sharing', Ken

回复Ken Task

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Jerry Lau -

Yes it is... same OS and build

Same version of apache and MYSQL and PHP

the moodledata drive setup maybe an issue as it is on a SAN but it always has been without any problems...

apache log file error does not show anything weird

 

 

回复Ken Task

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Jerry Lau -

Turned on debugging and this is what we get in return

 

first screen

Invalid JSON string

 

screen after first one

Invalid JSON string<pre> Warning: copy(/srv/ourmoodledata/filedir/a8/d5/a8d54294223ab7b8702141a866c0cec1c6fdf899.tmp): failed to open stream: Permission denied in /var/www/html/ourMoodleFolder/lib/filestorage/file_storage.php on line 1697 {"error":"Can not create local file pool file, please verify permissions in dataroot and available disk space.","stacktrace":null,"debuginfo":null,"reproductionlink":null}</pre>

We are stumped

 

回复Jerry Lau

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Ken Task -
Particularly helpful Moodlers的头像

What browser are you using to upload?

Where you are trying to upload (course other) what is the upload limit?

Does the name of the file have typical characters?

Are you uploading via some repo?

From a terminal session logged on as root user, can you:

touch /srv/ourmoodledata/filedir/a8/d5/a8d54294223ab7b8702141a866c0cec1c6fdf899.tmp

That creates a blank/empty .tmp file in filedir/a8/d5/

If successful, remove:

rm /srv/ourmoodledata/filedir/a8/d5/a8d54294223ab7b8702141a866c0cec1c6fdf899.tmp

Directories in above example may not exist so you can leave out the /a8/d5/ if the test complains about directories not in existence.

What are the php temp directory settings?   What do you find in /srv/ourmoodledata/temp/

'spirit of sharing', Ken

回复Ken Task

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Jerry Lau -

Ken... I think I found an anomaly ... will keep everyone posted.

回复Ken Task

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Jerry Lau -

same error when installing via Moodle UI too

回复Jerry Lau

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Ken Task -
Particularly helpful Moodlers的头像

Same error!!!  When installing via Moodle UI apache is running under user apache, group apache on a typical RHEL boxen.   Sounds like that user may not have permissions to write to /srv/ourmoodledata/

what does one see via:

ls -ld /srv

ls -ld /srv/ourmoodledata

'spirit of sharing', Ken

回复Ken Task

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Jerry Lau -

drwxr-xr-x. 7 apache apache 4096 Nov 29 02:47 /srv


[me@ourmoodle]$ ls -ld /srv/ourmoodledata


drwxr-xr-x 1274 apache apache 40960 Dec  2 18:01 /srv/ourmoodledata

looks the same to me 微笑

 

tried it on IE, chrome, safari, ff, etc... all the same problem

 

回复Jerry Lau

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Matteo Scaramuccia -

Hi Jerry,
see an happy ending story in MDL-43160: it could help you in finding the reasons for your issue e.g. wrong permissions in some existing subfolder e.g. your /srv/ourmoodledata/filedir/a8/d5.

HTH,
Matteo

回复Jerry Lau

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Ken Task -
Particularly helpful Moodlers的头像

+ 1 for Matteo ... and thus

cd /srv

chown apache:apache ourmoodledata -R

should fix.

'spirit of sharing', Ken

回复Ken Task

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Leon van Romburgh -

Hi All

I am also getting this error message "Can not create local file pool file, please verify permissions in dataroot and available disk space".

I am trying to upload a scorm 1.2 file of 24mb. When I click save I get the error message.

I have done the following trouble shooting:

  1. We are using Moolde 2.6.2 - I've tried uploading the scorm to other activities to try and figure out if the problem is on Moodle. Also created a new course to see if it's not perhaps something wrong with my course. Unfortunately no success. I then used the same activity to upload a scorm file I know works ; this was successful. So now I now it's something with the scorm file.
  2. I am also able to load a much larger scorm file to our site without issues.
  3. We are using Articulate Storyline 2. I've asked the author to re-publish the file as in previous case this worked. Unfortunately not this time.
  4. I then asked another author to re-publish - same results
  5. Went on like this with another 3 authors - same results
  6. So now I started thinking it's the source file...
  7. Then asked someone outside of our company with Articulate 2 to also publish the file (same source file) ; This file I was able to successfully upload.
  8. I then downloaded I Articulate trial version on my home pc and published again - I was also able to successfully upload this file.
  9. So now it's safe to say that when publishing from Articulate with our standard issue computers and build (software), the publishing is not working.
  10. I can also see that the file size is exactly the same when publishing from my company computer and from my home pc.

Any ideas of where the problem could be.

Attached a copy of the error message.

Thanks
Leon

附件 Capture.JPG
回复Leon van Romburgh

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Dan Marsden -
Core developers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Plugins guardians的头像 Testers的头像 Translators的头像

Probably an issue with the version of Moodle you are using. 2.6.2 is quite old and there are some very major security issues that have been fixed recently - you should upgrade to 2.6.8 ASAP

Older versions of Moodle had an issue on certain types of hosting where the file-locking didn't work quite correctly - I'd suggest upgrading to fix the security issues and then you may find the file pool issues have been fixed as well.

回复Dan Marsden

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Leon van Romburgh -

Hi

Looks like it's definately Moodle 2.6.2 then. I uploaded the same "damaged" file to Moodle 2.8 which I got installed on a Virtual Machine without any issues.

I also got the following reply from Derek Henderson on Linkedin.

See: https://moodle.org/mod/forum/discuss.php?d=238349

You can fix this by editing lib/filestorage/file_storage.php and looking for the line:

$newsize = file_put_contents($hashfile.'.tmp', $content, LOCK_EX);

Replace with:
$newsize = file_put_contents($hashfile.'.tmp', $content);

Thank you for the reply!

回复Leon van Romburgh

Re: Can not create local file pool file, please verify permissions in dataroot and available disk space.

Matteo Scaramuccia -

Hi Leon,
it's better to add:

$CFG->preventfilelocking = true;

in your config.php file to remove locking even in other places.

BTW, you should host your Moodle instance on a file system supporting file locking: Moodle frequently uses the file system for sensitive operations like managing the pool of files and supporting MUC with the file stores, enabled by default.

HTH,
Matteo