Login problem

Login problem

by Ax Iomicon -
Number of replies: 9

Hi all.  I have been trying to post this for days, but it keeps getting flagged as spam, so I made it as a screenshot.  Sorry about that.

errors

Attachment configPHP.png
Attachment nginx.png
Attachment server.png
Average of ratings: -
In reply to Ax Iomicon

Re: Login problem

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

The system administrators are not familiar with Moodle, not even versed in basic system administration. No space in the system partition is the next worse thing that can happen to a server - just next to a defective hard disk!

Ideally they should either restore the VM to its last (healthy) snapshot or https://docs.moodle.org/en/Site_restore the last (health)y https://docs.moodle.org/en/Site_backup.

Less than ideal, but still has a fair chance is to enlarge the partition. First enlarge the virtual disk from the management console of virualization software and then from within Linux enlarge the partition. With good Linux skills you can enlarge the partition even in a running server, for certain filesystem types, like ext4.

The story of two domain names does not sound feasible. Moodle wants to know how it is called. You will have less trouble, if it has a unique URL. There are hacks, but again, needs more skills.

In short, if the system administrators can't do it, you as a user have no chance of salvaging a dying machine - even without the Great Bamboo Firewall between you.

P.S. Isn't this a duplicate of https://moodle.org/mod/forum/discuss.php?d=418705 ?

(Edited by Mary Cooch on request of poster - original submission Tuesday, 23 February 2021, 6:02 AM)

Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Login problem

by Ax Iomicon -
Hi Visvanath Ratnaweera

Thank you for your reply. You are correct in pointing out that the administrators are not familiar with Moodle.
They have now created 16GB of free space in the system partition. We are still unable to log in.

That is a good idea about restoring the VM to its last snapshot. Thank you for the suggestion.

I think there is definitely an issue with http and https. I get "Mixed Content" errors in the Chrome Developer tools. I allowed Insecure Content in Chrome's site settings, and the "Mixed Content" messages became warnings. But I think we need to change something in config.php.

Regarding the duplicate: Yes, sorry, I kept getting this post flagged as spam, so I created a new account to attempt to post it. It got flagged as spam again and my account was locked. I cannot delete the post now. Apologies.

In reply to Ax Iomicon

Re: Login problem

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Hello. I will delete the other post as it does not have any responses.
Average of ratings: Useful (1)
In reply to Ax Iomicon

Re: Login problem

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

> They have now created 16GB of free space in the system partition.

What does 'df -h' show now? What is the error message Moodle shows? If it is non-informative, raise https://docs.moodle.org/en/Debugging.

> That is a good idea about restoring the VM to its last snapshot.

Please note that you need only one: Either enlarge the partition OR restore a VM snapshot OR https://docs.moodle.org/en/Site_restore.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Login problem

by Ax Iomicon -
Hi Visvanath Ratnaweera

'df - h' shows the attached screenshot dfh.jpg.

No error messages were shown after editing config.php. We added the code from https://docs.moodle.org/en/Debugging

 // 7. SETTINGS FOR DEVELOPMENT SERVERS ...

and 

define('MDL_PERF', true); ...

Nothing of significance was displayed.  See screenshot errors1.jpg

One teacher was desperate for some files on his Moodle course.  We entered the Moodle database on the server and ran some SQLs to allow Guest Access to his course, make visible all sections, and make visible all modules.  We then ran php admin/cli/purge_caches.php from inside /opt/public/moodle.

The teacher could then log in with Guest Access to his course and download the necessary files.  This shows Moodle is still intact and working normally except for the login page.

If we change $CFG->wwwroot = 'http://___.___.cn/moodle'; 

to

$CFG->wwwroot = 'https://___.___.cn/moodle'; 

or

$CFG->wwwroot = 'https://___.___.cn'; 

we get a 503 error (website down).  So we changed it back to http.

We then ran php admin/cli/cron.php from inside /opt/public/moodle

It freed up a lot of space and took about 10 minutes.

We then looked at /etc/nginx/conf.d/moodle.conf and the administrator suggested ipv6only=on could be a problem.  He did not edit the file.  See screenshot moodle_conf_and_login_index.png
We then looked at /opt/public/moodle/login/index.php and the administrator suggested $CFG->httpswwwroot/login/index.php could be a problem.  He did not edit the file.  See screenshot moodle_conf_and_login_index.png

Another thing I noticed is when I use the web VPN, and try to log in, no Moodle cookies are set.
When I use the EasyConnect desktop VPN and log in, I get one cookie, under Cookies:

Name: MoodleSession
Content: vv4ik21btc1foc___7kk2730b7
Domain: ___.__.cn
Path: /moodle/

In my own testing of another instance of Moodle, I get this MoodleSession cookie, but also a cookie:

Name: MOODLEID1_
Content: deleted
Domain: 167.XXX.XX.177
Path: /

I don't know if this is noteworthy.
 
So, Moodle looks to be mostly functioning correctly except for the login page.  It would be great if we could get this fixed.  I appreciate all users who have replied here with helpful suggestions.  Thank you.
Attachment dfh.png
Attachment errors1.jpg
Attachment moodle_conf_and_login_index.png
In reply to Ax Iomicon

Re: Login problem

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

> 'df - h' shows the attached screenshot dfh.jpg.

45 GB available in the partition. That is huge progress.

> No error messages were shown after editing config.php. We added the code from https://docs.moodle.org/en/Debugging

Not good. The four lines following '// Force a debugging mode regardless the settings in the site administration' are known to display debug traces on the screen. Check the logs of web server to be double sure.

> We entered the Moodle database on the server and ran some SQLs to allow Guest Access to his course, make visible all sections, and make visible all modules.

Well, if the patient has been in the OP then the surgeons should take over. This is casual advice from an old general practitioner.
wink

> If we change $CFG->wwwroot = 'http://___.___.cn/moodle'; to $CFG->wwwroot = 'https://___.___.cn/moodle'; or $CFG->wwwroot = 'https://___.___.cn'; we get a 503 error (website down). So we changed it back to http.

The URL of the site is not something for trial-and-error. The administrator of the site must have given the hosting provider a contract, take the one in the contract. From what I see in the Nginx conf file, it is HTTP (port 80). So stick to it.

> We then looked at /etc/nginx/conf.d/moodle.conf and the administrator suggested ipv6only=on could be a problem. He did not edit the file. See screenshot moodle_conf_and_login_index.png
We then looked at /opt/public/moodle/login/index.php and the administrator suggested $CFG->httpswwwroot/login/index.php could be a problem. He did not edit the file. See screenshot moodle_conf_and_login_index.png

Highly adventurous. I am excited to hear his story. The well-trodden (boring) path I take is named https://docs.moodle.org/en/Nginx.

Oh, wait, Moodle 2.9! Ha, ha, did you check the https://docs.moodle.org/dev/Moodle_2.9_release_notes#Server_requirements ?

> Another thing I noticed is when I use the web VPN, and try to log in, no Moodle cookies are set.
When I use the EasyConnect desktop VPN and log in, I get one cookie, under Cookies:

That I don't know. The network comes before the application. I don't know how to reverse engineer the network layers by looking at how Moodle behaves. This sounds like an aggressive Chinese medicine - not the TCM. My Ayurveda is no match. I retire.
smile
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Login problem

by Ax Iomicon -
Hi Visvanath Ratnaweera and Leon

Our Moodle is now fixed.

I don't fully understand why.  I was told that the administrators in China changed in config.php:

$CFG->wwwroot = 'http://______.___.cn/moodle';

to:

$CFG->wwwroot = 'http://[ip_address]/moodle';

Also, in /etc/nginx/conf.d/moodle.conf, they changed:

server_name ______.___.cn;

to:

server_name [ip_address];

The administrator stated there is a problem with domain name redirecting which is caused by the web-based VPN service.

I am happy that it is solved.  Thank you to Visvanath Ratnaweera and Leon who offered excellent advice that somehow put the administrators on the path to find a solution.  I appreciate all contributors to this community.

In reply to Ax Iomicon

Re: Login problem

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

A Moodle site must have one URL only and this URL must be correctly configured in $CFG->wwwroot. All users of the site – whether they connect from the same internal network as the server, connect via VPN, or connect via the Internet without VPN – must use the same URL.

$CFG->wwwroot is the URL used in each Moodle page which gets sent to the browser so that the browser can load the files (images, JavaScript, CSS) needed for the page to work.

HTTPS and HTTP URLs are not the same: https://moodle.example.com is not the same URL as http://moodle.example.com. The Mixed Content error can occur if the site has been accessed in the browser with the secure HTTPS URL but $CFG->wwwroot is 'http://…'. This results in the page containing links to non-HTTPS URLs which the browser blocks because only HTTPS URLs are allowed on an HTTPS page.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: Login problem

by Ax Iomicon -
Hi Leon

Thank you for your reply. I have replied to Visvanath Ratnaweera above, but my reply relates to your helpful suggestions too.