Upgrade errors to 3.3

Upgrade errors to 3.3

by Jamie Tinley -
Number of replies: 20

I have 4 issues going on with my upgrade I thought had finally installed just fine so I went on vacation to Hawaii and as luck would have it I'm having to fix this instead of enjoy the trip. Thanks in advance . . .

Production server Ubuntu 14.04 Moodle version was 3.05 upgraded to 3.3 (6/10/2017 version) and php was 5.5 now it's 7.1

errors I"m listing them all together in case they are related.  Thanks in advance.

1. login now says 

You are already logged in as [any user name], you need to log out before logging in as different user.

I read mdl-41233 here but not sure if that's it.  I don't see $_SERVER etc anywhere in my index.php file.

here similarly suggests using "redirect($CFG->wwwroot);" under the call to "complete_user_login($user)" but I don't see any wording of complete nor user_login in index.php.

I tried renaming my cache folder in moodle data and clearing cache in admin/server without success.

2. many pages fail to load giving this error 

This page should automatically redirect. If nothing is happening please use the continue link below.
Continue which never loads or it says this page isn't redirecting properly

3. on quizzes that were working now it says 

"a required parameter cmid is missing.

4.  lastly on my environment page I see many extensions that say they are not installed yet it also says ok and when I  type php -m all those extensions show just fine.  ex, curl says "must be installed and enabled" but says it's ok.  Maybe the message that it needs to be installed is a generic message not indicative of it's current state which would make sense as I did install each one and they do show up in php-m.

Attachment 3.3 environ missing extensions.
Average of ratings: -
In reply to Jamie Tinley

Re: Upgrade errors to 3.3

by Jamie Tinley -

I turned on developer mode and login shows these errors if that helps anyone help me:


Notice: Undefined property: DOMAttr::$name in /var/www/html/moodle/lib/htmlpurifier/HTMLPurifier/Lexer/DOMLex.php on line 212

Notice: Undefined property: DOMAttr::$value in /var/www/html/moodle/lib/htmlpurifier/HTMLPurifier/Lexer/DOMLex.php on line 212

Notice: Undefined property: DOMElement::$tagName in /var/www/html/moodle/lib/htmlpurifier/HTMLPurifier/Lexer/DOMLex.php on line 172

This page should automatically redirect. If nothing is happening please use the continue link below.
Continue

In reply to Jamie Tinley

Re: Upgrade errors to 3.3

by Jamie Tinley -

I'm reading a lot of posts on Moodle with different suggestions for the message "you are already logged in  as xxxxx, you need to log out before logging in as different user.  

 The best one here by Tim Hunt says it may be due to images not loading well into either draftfile.php or pluginfile.php.  I also see these suggestions.


1. look at error log for ?  at . a/lang/en/error.php    maybe my language is set wrong
2. chmod 0770 on moodledata and config.php (currently I have it 0755)
3. remove picture or link to moodle for front page or pages that cause that error message.
4 change Theme to clean . (currently essential)
5. Tim Hunt suggests to comment out // define('NO_DEBUG_DISPLAY', true);   in pluginfile.php
6. site cache clear in more places. (currently I cleared cache on my browsers and in moodle at admin/server/clear cache with no help - I still get the message that you are already logged in . . ."
any advice is appreciated.

Average of ratings: Useful (1)
In reply to Jamie Tinley

Re: Upgrade errors to 3.3

by Jamie Tinley -

answers so far:

changing theme to clean did not help.

I set permissions as follows. some reduced debugging messages but only on the login page and they all showed up again on other pages like selecting themes. 

moodle is 0755. was that already
moodledata 0770 (was 755) some dom errors on debugging now don't show
config.php directory permissions 0770 (was 777) removed debugging error but only on login page of this
        /var/www/html/moodle/lib/htmlpurifier/HTMLPurifier/Lexer/DOMLex.php on line 212
ect/php 0770 was 755 .   this change seems like no effect.

I see new errors like this one 
pix_url is deprecated. Use image_url for images and pix_icon for icons.
not sure what to try next . . . 


In reply to Jamie Tinley

Re: Upgrade errors to 3.3

by Jamie Tinley -

dying here. may have to give up on 3.3 for another year and revert to 3.0.10

looked at apache logs and just see the same errors posted on moodle.  I would mostly like to fix the error You are already logged in as .  and the quiz cmid error.  

In reply to Jamie Tinley

Re: Upgrade errors to 3.3

by Ken Task -
Picture of Particularly helpful Moodlers

Been reading your 'saga' ... frustrating some times.

Now I don't know for sure, but am going to suggest you might have put yourself on the bleeding edge with PHP 7.1.

And, if you  hyperjumped from 3.0.10 -> 3.3 ... then, if giving up for this year ... you might be hyperjumping to 3.4 by then.

https://docs.moodle.org/dev/Moodle_and_PHP7

says 3.2 can run under PHP7.   Now am not saying to try/do anything you see in the above link.

Do know this ... have CentOS 7 running PHP 7.0.highest and all the moodles running ... Moodle 3.0.highest (all are highest), 3.1.x, 3.2.x and a 3.3.x ... don't have the issues you are seeing.

I know folks say one can hyperjump ... some get away with ... many do not.   Have always found 'marching' a moodle upwards to be easy to do ... if using git.    And when one arrives at destination, there seems to be less problems (barring old plugins that didn't make the trip ... and of recent, DB requirements).

So you had a 3.0.10 running under PHP 7.1.x with no issues?   or did you do an upgrade of PHP 5.6 to 7.1 *and* a hyperjump right after ... without checking out how the 3.0.10 was doing?

'spirit of sharing', Ken


In reply to Ken Task

Re: Upgrade errors to 3.3

by Jamie Tinley -

Thanks Ken for being my voice in the darkness.  I upgraded from 3.0.5 to 3.0.10 BEFORE upgrading to php7.1 and it looked good but I did not run it through all its paces. Moodle 3.3 looked pretty good and I thought I had tested all my major modules and did not see that login error at first so i don't know if I did something to cause it.  I left windows to use git and ubuntu to be like you but i did not understand ubuntu has flavors (i'm guessing centos is a flavor?). maybe i learn to make a virtual copy and play with it maybe install from scratch or try centos and then learn to copy one virtual server over my  current one when ready. being on vacation in Hawaii annoying my family as i fumble in the darkness is not worth it.  i wish there was a moodle coding for dummies that showed how all the tables and components interact with each other. thanks for listening.

In reply to Jamie Tinley

Re: Upgrade errors to 3.3

by Jamie Tinley -

reset my moodle back to image from 7/10 and everything is working perfectly no errors.  But not knowing why makes me very very nervous as the errors will all show up again.  I looked through all the pages of changes moodle noted before i reverted (wish I could download them) but the changes did not grab my attention with anything unusual. I added back a theme aigne and put limits on students changing their name etc so they can't.  cron I see in the new one updated all my language packs.  I guess I try to reproduce it somehow so I know how it happened.

In reply to Jamie Tinley

Re: Upgrade errors to 3.3

by Ken Task -
Picture of Particularly helpful Moodlers

Next time take it slow with PHP ... upgrade it to 7.0.x but go no further.

Don't upgrade PHP until your Moodle code is at least 3.0.x (highest).

IF one could side load git core code for the version you are on right now and update to highest whatever that is via command line, then there's a good chance, that 3.1 will fly.   It can still be set for utf8_unicode_ci for collation.

3.1 is long term support until 2019.

Dunno if one desires the feature of Search added in 3.1 or not ... that alone was difficult for many ... including myself.  :|

Can you do virtual domains where you are hosted? ... ie, multiple moodle sites by different fully qualified domain name?  like ...  production.mynet.net .... sandbox.mynet.net?

Interestingly enough, the environment stuff that used to be only in Moodle code is now in moodledata ... and with an md5 key too boot.     Hmmmmmm ....

'spirit of sharing', Ken

In reply to Ken Task

i cant access my moodle site anymore

by Mbongeni Lukhele -

hi

I need help I am new to moodle and I am an entry level developer, so I logged myself out of my moodle by enabling the use of https without having ssl certificate in my server now I cant go to my site URL it gives me error 404 not found please help

In reply to Mbongeni Lukhele

Re: i cant access my moodle site anymore

by Ken Task -
Picture of Particularly helpful Moodlers

IF you changed the config in moodle for 'use https for login' and set to yes (on) but the server doesn't have a valid cert, you can reverse the setting via adding a line to config.php:

$CFG->loginhttps='0';

Did you edit config.php for the URL to the site also?   The 'wwwroot' variable.   IF so, change it back to http:// ... ie, remove the 's'.

If you desire to use https, acquire a valid cert for server and get apache (assuming apache) to respond on port 443.   Then change the apache config to add your valid cert.   Check access again to 443 and pay attention to the security icon in the browser URL bar for a valid cert.

Last steps involve changing config.php of Moodle ... as above.

One can an apache re-write rule such that any request for http://yoursite gets re-routed to https://.

If you have developed anything in Moodle it has recorded the old URL (http) and you will need to login via https but then go to https://yourside/admin/tool/replace/ to do a search and replace for all those site URL's recorded in the DB for the moodle as http:// and change them to https://

Once your site is responding to only https, you can remove the config.php line you added.

'spirit of sharing', Ken



Average of ratings: Useful (1)
In reply to Ken Task

Re: i cant access my moodle site anymore

by Mbongeni Lukhele -

thanks a lot it worked. my other problem is that my site gives me sesskey errors especial when i try to switch user accounts, how can i prevent that? because i do log off and login with different account but it will take time to realize is another account, it will keep on poping up sessikey or session time out

In reply to Mbongeni Lukhele

Re: i cant access my moodle site anymore

by Ken Task -
Picture of Particularly helpful Moodlers

Welcome.

Set the moodle to use files for sessions rather than DB.

Make sure your cron job is running frequently for there is a task (job) to clean up session information.

'spirit of sharing', Ken

In reply to Ken Task

Re: i cant access my moodle site anymore

by Mbongeni Lukhele -

how do i do that? sorry to bother but i am new to this

In reply to Mbongeni Lukhele

Re: i cant access my moodle site anymore

by Ken Task -
Picture of Particularly helpful Moodlers

After you login as admin level user, use the 'search' box in the site admin menu to search for:

'session'

and then again for

'cron'

Setting up cron depends upon platform.   Linux has crond Windows doesn't.

Also search for 'task' and you'll see the task list ... there is one for session cleanup.

Moodle has docs:

https://docs.moodle.org/33/en/

For Cron:

https://docs.moodle.org/33/en/Cron

For some things, I've found it handy to use two browsers .... FireFox (logged on as admin) and Chrome (logged on as student).   Browsers don't share cookies.

'spirit of sharing', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: i cant access my moodle site anymore

by Mbongeni Lukhele -
thanks a lot one more last thing is this error


 <Error> <Code>MethodNotAllowed</Code> <Message> The specified method is not allowed against this resource. </Message> <Method>POST</Method> <ResourceType>OBJECT</ResourceType> <RequestId>17BF681346EB025D</RequestId> <HostId> GhhLr4q5SQee4yuFfwyMkGGSzNnydNKHLQjE1V6mftslrx3QauM7jHIXHGBjfIlY1DxyP6f3AXU= </HostId> </Error>

In reply to Mbongeni Lukhele

Re: i cant access my moodle site anymore

by Ken Task -
Picture of Particularly helpful Moodlers

Have not a clue without more info ...

That from debug of Moodle a server log error?

What were you doing or the system doing when this appeared?

'spirit of sharing', Ken

In reply to Ken Task

Re: i cant access my moodle site anymore

by Mbongeni Lukhele -

it happens sometimes when i try to save changes on whatever i was busy with

In reply to Mbongeni Lukhele

Re: i cant access my moodle site anymore

by Ken Task -
Picture of Particularly helpful Moodlers

That response is *not* specific enough ... give specifics as to what you were doing at the time.

'spirit of sharing', Ken