Undefined pop-up error after installing Moodle

Undefined pop-up error after installing Moodle

by Akshay Kumar -
Number of replies: 15

I have been trying to install Moodle 4.1 from scratch for my institution. My domain is hosted on godaddy.com. I have tried two methods:

1. Method 1: Installing it in a subdomain (moodle.domain.com)

2. Method 2: Installing it in a subfolder on main domain (domain.com/moodle)

I am failing in both the methods, each with its unique error.

In Method 1: Everytime the installation reaches the last stage, it gives me an error that says "Your session has most likely timed out. Please login again." Clicking on continue button does not help, as it keeps cycling back to the page where I have to enter admin password for the first time to complete setting up the moodle site. When I request for more information, it says "error/moodle/invalidsesskey" and leads me to this page: https://docs.moodle.org/20/en/error/moodle/invalidsesskey

In Method 2: The installation is able to complete properly, and I am able to login into the Moodle site. However, a pop-up with "Undefined" keeps coming up whenever I try to go to site-edit mode. And subsequently, whenever I try to click on "Add new activity or resource" for any new course, nothing happens. See attached screenshot of the "Undefined" pop-up.

Please suggest how to proceed here. Also, any suggestions on whether I should use sub-domain or sub-directory will also be helpful. In my opinion, both ought to be the same thing in Godaddy because ultimately, the sub-domain points to a sub-directory in the public_html folder of main domain.

very incidentally, I had succeeded installing Moodle 4.1 just one week ago in sub-domain. However, when I had installed a few plugins, I had been plagued with the undefined pop-ups even at that time, and had ended up re-installing moodle with a hope to fix the issue.

Attachment undefinedpopup.png
Average of ratings: -
In reply to Akshay Kumar

Re: Undefined pop-up error after installing Moodle

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I guess I would start by looking at the Environment (administration/server) and be sure that GoDaddy actually meets the requirements to run Moodle 4.1.  I would also look at any server logs that GoDaddy provides to see if that gives you some idea.  I suspect that GoDaddy does not have some required extension...

In reply to Akshay Kumar

Re: Undefined pop-up error after installing Moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Two random guesses:
- Try adding the line $CFG->slasharguments=0; to your config.php

- Sie whether there are .htaccess files in the web directories. Often WordPress in the main domain creates them and they become active in the subdomains.

For a targeted analysis one needs to know how you install. If it is GoDaddy one-click something, only a few die-hards GoDaddy here know what happens behind the scenes.

Talking of GoDaddy is newer complete without calling Go Daddy! (Where to?)
big grin

In reply to Visvanath Ratnaweera

Re: Undefined pop-up error after installing Moodle

by Akshay Kumar -
Thanks Visvanath. I tried these:
1. No success when I add $CFG->slasharguments=0
2. Yes, I have a wordpress site in my main domain, and moodle is in the subdomain or subfolder (tried both methods, both not working). there is a .htaccess file in my root public_html folder.
My site is hosted on Go Daddy, but not using their installatron 'one-click' application installer. I install it on my own by unzipping moodle files in its sub-folder and then using web-installation.
In reply to Akshay Kumar

Re: Undefined pop-up error after installing Moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
$CFG->slasharguments=0;
In reply to Visvanath Ratnaweera

Re: Undefined pop-up error after installing Moodle

by Akshay Kumar -
yes, I did have the ; figured it out when I had opened the file.
I have turned on debugging for my moodle site. But my technical expertise is now giving up - on how to access those logs!
In reply to Akshay Kumar

Re: Undefined pop-up error after installing Moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators

Otherwise, this is my take on GoDaddy https://moodle.org/mod/forum/discuss.php?d=193106#p840808. But don't worry, there is a GoDaddy faction in the Moodle forums.
big grin

In reply to Visvanath Ratnaweera

Re: Undefined pop-up error after installing Moodle

by Akshay Kumar -
Thanks Visvanath! I have almost made up my mind to leave my root domain website (on wordpress) with Godaddy on the hosting that I have locked pricing for few years now, and move Moodle elsewhere! I concur, this problem is got to do something with wordpress site and moodle sitting on same place. I never had issues till I was running moodle on different sub-domains. I had one test and one production instance running on different sub-domains. Everything was perfect till the time I did not have a wordpress site. Then I had my wordpress website on the root domain, and that is since when all issues have started cropping up. I am not a very technical person (can only do web-installs, or anything which has a proper user interface, i.e. no command scripts for me!), hence unable to really go into the details of what is going wrong here.
In reply to Akshay Kumar

Re: Undefined pop-up error after installing Moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

> this problem is got to do something with wordpress site and moodle sitting on same place. I never had issues till I was running moodle on different sub-domains.

I am not on GoDaddy nor run WordPress, so can't say for sure. But the problem must be solvable. I have seen discussions on this topic and can't remember anybody saying the opposite. Use the excellent forum search here https://moodle.org/mod/forum/search.php?id=5 to find old discussions. (The link is below the nasty right hand drawer, where advertisements make rounds.) 

> can only do web-installs, or anything which has a proper user interface,

Ha, ha, ha! The Unix command line is a proper, in fact the most powerful, user interface! It must also be the oldest living user interface, designed in 1969! https://en.wikipedia.org/wiki/History_of_Unix

> i.e. no command scripts for me!

Manual commands and scripts are two different things.

Whatever, as you wish.
wink
In reply to Akshay Kumar

Re: Undefined pop-up error after installing Moodle

by Ken Task -
Picture of Particularly helpful Moodlers

First, don't sell yourself short ... you can do command line ... just enough ... to get the job done.   You don't have to be a command line guru!

Second - don't get it ... you plan to run a do it yourself moodle or had one running and was/want to 'teach' or train online.   So you are the server admin, the moodle admin, and the teachers/instructor ... is that correct?

If so, what gives you the license to refuse to learn a little IT?   You don't expect less from those who take your courses, do you?    Then don't do that to yourself.

Is it easy?   No ... not a first ... and you will (probably already have) make mistakes.   But success is not measured by getting everything right the first time ... quite often, success is related to 'failure quotient' ... how many times you can try till you get it right!!!

Ok ... towards all the above ... one question/comment ...

Comment: I wonder if we are not confusing 'subdomain' with 'subdirectory'.

Question:   In the structure of folders/directories of your site (probably in public_html), what does that look like?

public_html is your document root for anything web.   What goes in there should be and be seen by anyone using a browser accessing your top level domain ... yeah, there's a techie term but ya got to understand it to get the rest of this right ...

IN DNS your top level domain, which you have already shared via image:

dhsbgp.com

We know from what you've said that public_html is where your word press resides.

At that level in the file system/code, one will see quite a few directories that begin with 'wp'.    Your moodles then, are in directories that you have named.  Example: moodletest.

So the URL to the moodletest instance is in a subdirectory and is:

https://yourTLD/moodletest/

Note that is not a subdomain ... like mooldetest.dhsbgp.com

Have I got the right so far?

'SoS', Ken



In reply to Ken Task

Re: Undefined pop-up error after installing Moodle

by Akshay Kumar -

Thanks Ken for the motivating reply 🙂

1. I do not have a "running" LMS system full of content and ready to train students yet. I have only been playing around with deploying Moodle on my GoDaddy domain and hosting space - I was successful in deploying two instances - testmoodle.TLD.com and moodle.TLD.com until I also deployed my wordpress site and moodle went through this "undefined" pop-up error after that. I had plans to use one for testing and playing around as I train my teachers to create courses (including H5P and/or SCORM), the other one to be used for production ready courses after they become ready over coming few months.   Short answer - I am the server admin, moodle admin, course teacher but do not have any students who are using any course immediately as of now!

I am exploring what is the best route as I ramp-up in next 3-4 months. Does it make sense to try and do everything (hosting + course creation + user and course management) ourself, or 'invest' in a moodle hosting partner who I can delegate the hosting, site maintenance, upgrades, themes and break-fix responsibility while I figure out how to train my teachers to create content and manage students on the site for about 12 classes, 4-5 subjects for each class and about 1500-2000 students after ramp-up. But yes, always open to learning (including command line too!) whether or not I do the production instance myself. I can take chances and learn on test environment for the next few 3-4 months, but will need reliability for the production environment if I do it myself.

2. In Godaddy, you are right that the public_html is the root folder for anything public web. Yes, there are lots of files for wp_* for the main wordpress site. cPanel of Godaddy provides an option to create sub-domains. When you create a sub-domain (like moodle.TLD.com), it will also create a sub-folder (moodle.TLD.com) within your public_html folder. And then you can dump your moodle install there and access it. You can access it using either moodle.TLD.com or TLD.com\moodle.TLD.com (because it is effectively a sub-folder). When creating the sub-domain, you can rename the target sub-folder as just moodle, then you can access it either by moodle.TLD.com or TLD.com\moodle.

You can also choose not to create a sub-domain, but just create a sub-folder (like public_html\testmoodle). Then you can access it using www.TLD\testmoodle. You will be unable to access it using testmoodle.TLD.com, that is all. That is the only difference between a sub-domain and a sub-directory that I have seen in GoDaddy. When we create a sub-domain, there is also a DNS entry pointing the sub-domain to the hosting IP address (which for some reason happens to be incorrect and needs to be corrected manually to point to the right hosting IP)

In reply to Akshay Kumar

Re: Undefined pop-up error after installing Moodle

by Ken Task -
Picture of Particularly helpful Moodlers

What some would read as 'motivational' others would read as 'insulting' .... it's for the former! smile

Now what we have the 'plan' ... some questions and free advice ... still $0!

With GoDaddy hosting (actually all hosting), one has options in choosing a hosting setup.   There is 'shared hosting' and there is 'managed' or 'un-managed' VPS's (virtual private machines [servers]).    Which did you choose? (specifics please)

You talk about 'ramp-up' so I have to read between the lines there and assume you have shared hosting ... not a VPS.   Uhhhh ... if you are confident in your plan and you will have the # of courses and users you project, then I strongly suggest that 'shared hosting' - at any level - won't be enough.   Ever heard of 'begin with the end in mind'?   You might apply that right now.   Yes, at first, more cost than break even or profit but ... that's up to you to hustle some more (in learning more IT).

Something you should know about most hosting providers ... if you start with shared hosting then see the need to move to a VPS, you will still end up in a user jail on the VPS system cause they just copy your account directory to a new dedicated VPS.   You have /var/www/ but can only access that via root user.   In other words, 'ramping up' will cause disruption at a time when you might want it - while you re-learn the new environment to take advantage of what you leased! smile

So ... question: what did you lease from GD?   Be specific!

Also, a little techie hint ... in description of sites you used a backslash (\) .... that's Windows!   Not same in Linux which is a forward leaning slash (/).  Makes a BIG difference if/when you work with paths.

Also ... I asked for a screen shot of your current directory structure ... you've described it via text ... but it helps to get the 'bigger picture' ... but will repeat ... 'begin with the end in mind' ... and if you will move to a VPS then we need not talk about stuff with shared hosting, but the VPS.

And one last ... you can hire persons to help - this free advice is actually 2 things ... 1) consulting and 2) it is teaching [you are student right now] ... now think about this ... I don't think any user on these forums is independently wealthy ... I know I am not for sure!   And this is global ... 'time is $'!

Anyhoo ... my 10 'sense'!  (nope, I spelled it right!) smile

'SoS', Ken



In reply to Akshay Kumar

Re: Undefined pop-up error after installing Moodle

by Ken Task -
Picture of Particularly helpful Moodlers

For OP and Others ...

Site has WP ... moodle in subdirectory may have issues due to cascading .htaccess rules meant for WP but apply to all subdirectories ... which would include a /moodletest/ or what ever you name directory for moodle code.

OP also shared via PM:

"H5P plugin externally from their website"

Oops!   H5P is in core Moodle since version 3.8 of moodle.   More of H5P in version 4's of Moodle - contentbank.   So mind sharing URL to that so we all can see?

Others responding have given some good advice

Question: don't host with GoDaddy ... but you should have cPanel and a thing called EasyApache ... which is really for setting PHP version per site/domain.

Does that have have a version of PHP less than what you said you have ... PHP8.1 ... set it for 8.0 or the highest 7.4.x available.

'SoS', Ken


In reply to Ken Task

Re: Undefined pop-up error after installing Moodle

by Ken Task -
Picture of Particularly helpful Moodlers

One other ... while not always true ... that popup box looks like it might be coming from Tours.   Turn Tours off! smile

'SoS', Ken


In reply to Ken Task

Re: Undefined pop-up error after installing Moodle

by Akshay Kumar -
This is the link to H5P plugin: https://moodle.org/plugins/mod_hvp
From what I know, this allows a user to create basic H5p content from within moodle itself. Not all types of content may be supported, hence there is the better option of creating h5p content on the site itself, and then providing a URL in moodle.

Also, there is a comparison between the separate vs the core plugin within Moodle, provided by H5P themselves: https://h5p.org/moodle-plugin-vs-moodle-core-vs-h5p-com