error/hashpoolproblem migration

Re: error/hashpoolproblem migration

by Ken Task -
Number of replies: 10
Picture of Particularly helpful Moodlers

First, learn your own poison ... Fedora 23.
I can't seem to find docs for that version but here are docs for Fedora 22
https://docs.fedoraproject.org/en-US/Fedora/22/html/System_Administrators_Guide/ch-Web_Servers.html#s1-The_Apache_HTTP_Server

IF 23 is same as 22:

fgrep 'User' /etc/httpd/conf/httpd.conf
You'll get several lines finding the term 'User' (case sensitive).
What you are looking for is a line that should be:

#  . On SCO (ODT 3) use "User nouser" and "Group nogroup".
User apache  <- this one

Do that same for 'Group'.

On Fedora, the user:group for the user that runs apache web service (called httpd) should
be apache:apache

If you don't see that then stop ... do not do the rest of this.

cd /path_to_moodledata/ (where you can see 'moodledata' directory - ***might/should be in /var/www/ on a stock Fedora box.***   Your config file clip shows /var/XXXXdata.   Apache should already have access to /var/www/.    The html directory is where the moodle code resides.   Suggest 'moodledata' should be in /var/www/ to assure the apache user and the apache group can have access.

Then issue the following command:

chown apache:apache moodledata -R

That sets User:Group to 'apache' for the moodledata directory and does so recursively ... i.e., all
directories/files in moodledata.

Then:

chmod ugo+rw moodledata -R

This makes sure that user (apache), group (apache), others can both 'read' and 'write' to everything in
moodledata.

The clip of the phpMyAdmin reference to the contenthash/file shows 'draft'.
Suggest editing the link to that file in Moodle to see if the icon for the file shows while editing.
No need to change anything really IF the file (Presentation1DB.ppt from your clip) appears to be there.
Just save the link.
Then see if one can access it ...

One more item ... is seLinux running?   That would cause problems as well - especially considering you've moodledata in /var/

To find out:

/usr/sbin/sestatus

as root user

'spirit of sharing', Ken

In reply to Ken Task

Re: error/hashpoolproblem migration

by Omar Al Sayyed -

Hi Ken

just one file can be access and download and other files same problem,

I tried to edit files there is a problem (error/hashpoolproblem) and also when to add  any file (resource )

the error appears

I wondering why just one file can access not all files

I did all things you told me

many thanx again Ken

 

In reply to Omar Al Sayyed

Re: error/hashpoolproblem migration

by Ken Task -
Picture of Particularly helpful Moodlers

Am not sure you've done all things suggested ... here's why ...

In a previous response you showed clips of screen shots from PHPMyAdmin.   That shows what's in the database ... reference to contenthash.   BUT did you then confirm that file actually did exist from the command line ... did you find a moodledata/xx/xx/contenthash file?

Have asked about seLinux ... on or off?

Am beginning to think that you might need to start over in creating a sandbox/clone of your production server onto a private clone of the production site for testing/tinkering purposes.

A migration consist of the code directory, the data directory, and an sql dump of the DB.

Since it's on the same family of server this shouldn't be that difficult.

Does the production server work?

'spirit of sharing', Ken


In reply to Ken Task

Re: error/hashpoolproblem migration

by Omar Al Sayyed -

Hi Ken

thanx for ur reply

Yes the files is there (all the files are in /var/mooldedata) all the files are 3 and one jpg file

when I changed as you advise the  permissions just one file can be read. the selinux is active.

i will tell you what finally I want, I need to make a backup server for all I have in this server

( lms.uop.edu.jo ) ( lms.uop.edu.jo/gp ) ( lms.uop.edu.jo/itsaf ) and many site on this

Please take a look on it, When my main server is down I can use the backup server.

I copied the code and data directory in binary and export the sql

 

In reply to Omar Al Sayyed

Re: error/hashpoolproblem migration

by Ken Task -
Picture of Particularly helpful Moodlers

Please clarify ... each moodle site (lms, gp, itsaf - maybe others you've not mentioned) has a *separate* moodledata directory.  

In the config.php file for lms, as an example, has $CFG->dataroot variable pointed to a unique data directory for the lms site.

Is that correct?

OR ... do all sites have their $CFG->dataroot variable pointed to the *same* /var/moodledata/ directory?

If the case is the latter (the OR above), that's the problem and error report you are seeing.

Each Moodle site must have it's own (unique, not shared) moodledata directory.

The contenthash calculation that each Moodle instance uses is unique to the site and won't match the contenthash calculation that another instance of Moodle would calculate, even if on same host.

What you are seeking is what sounds to be 'fail-over'.    That's a totally different situation.   If the entire server fails, for some reason, you'd have to have another IP addressed server that has rsynced the entire web root + data directories + databases for each site.   Only  change to DNS and firewalls would be needed to 'cutover' to the 'backup' server.   It would not be instant.  DNS changes take time to propagate (ie, get out to other DNS servers).

IF, however, it's just one Moodle instance that fails, that changes the picture and how one goes about 'fail-over'.   IF this is what is desired, each site could rsync code directory, data directory, and database by a slightly different name, to other directories on the server.   Apache config would then need to have changes made so that access to say the failed gp site points to it's rsync'd directory.   The one file that shouldn't be rsync'd every time rsync runs is config.php cause it would have paths, db, etc. pointing to the 'cloned' code, data directory, and database by a slightly different name.

The above is a basic idea.

'spirit of sharing', Ken


In reply to Ken Task

Re: error/hashpoolproblem migration

by Omar Al Sayyed -

He Ken

Yes, I have for each site it own directory var\gpdata , var\lmsdata .....

and each site has his own database 

in each site config.php pointintg to their data and data base.

NOW : I want to install Redhat or centos (which one you refer) and sync all my sites code and data and database .

can you put me in first step and continue with you

Many thanx

In reply to Omar Al Sayyed

Re: error/hashpoolproblem migration

by Ken Task -
Picture of Particularly helpful Moodlers

Do you still have the errors?   Must fix those before thinking about moving otherwise the move brings along the errors.   RedHat or CentOS or whatever, won't automagically fix it/them.

Fedora is Linux and could do rsync as well.

Can offer 2 cent opinion on RHEL or CentOS ... up to you ... RH is commercial - entitlement required to get updates to the OS and, other than having a company to contact for technical issues, really isn't any better than CentOS ... which is based upon RHEL but no RH eye candy and no licensing/entitlement cost/issues.    But, with free there comes ... slightly behind latest/greatest and slightly behind on updates/upgrades to PHP, etc..   With CentOS one has to use 3rd party repos for things like PHP 7 which RHEL doesn't normally provide with their boxen.  Managed boxen ... ie, they (whomever 'they' is) do the OS updates/fixes/patches/firewall, etc. cost.  Un-managed means you do.

But ... CentOS is 'long term support' ... version 6 of their OS supported for fixes until November 30, 2020.   and 7 until June 30, 2024

https://wiki.centos.org/FAQ/General

The above is your first step.

Remember, however, these forums shouldn't be used for CentOS server admin 101/installing the OS from scratch, etc..    For that, one could find many blogs out there ... just Google for them ... tons!

'spirit of sharing', Ken

In reply to Ken Task

Re: error/hashpoolproblem migration

by Elliott Benzle -

Hi, I found this post as I was having the same problem after transferring to a new server. My solution was to move the moodledata directory to /var/www/html/ previously it was in /var/moodledata

Hope that helps.


In reply to Elliott Benzle

Re: error/hashpoolproblem migration

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Please reconsider!

You have moved your moodledata into your web root and as such have made it entirely open to public access.

In reply to Richard Oelmann

Re: error/hashpoolproblem migration

by Elliott Benzle -

Hi Richard,

Actually my server is setup so the web root is /var/www/html/lms/ so the /html/ directory is not visible to the public.

Thanks for noting that though, I understand that for most users this would be publicly available and they should probably put it in/var/www/ or one directory under their root Moodle installation.

Average of ratings: Useful (1)
In reply to Elliott Benzle

Re: error/hashpoolproblem migration

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Phew! - but that might have been useful to note in a post that offers a 'solution' to the problem noted previously, for the benefit of future readers, even if you understand the process yourself smile

Note for those future readers: One directory under root Moodle may still be available to public on the web - just because Moodle is installed in a sub-directory does not prevent the rest of /var/www/html being accessible. That would be controlled by something such as .htaccess or some other set of web-server rules (which Elliott has done by setting the server webroot up to the /lms subfolder rather than the more usual default /html). For future readers, please ensure that your moodledata is outside a web-reachable location, depending on your system (it can even go in the main moodle code folder - and is set up that way by some hosting 'one-click' solutions - provided that location is then protected from public access through the .htaccess file or similar restrictions - but its definitely NOT recommended!)


Richard