Session Error

Session Error

by Ahmed Al Kahky -
Number of replies: 19
After upgrading to 4.1.6 and php 8.1 and trying to access the website, the following error is appearing 

Error

error/An error occurred whilst communicating with the server
Debug info:
Error code: An error occurred whilst communicating with the server
$a contents:
Stack trace:
  • line 159 of /lib/classes/session/manager.php: core\session\exception thrown
  • line 139 of /lib/classes/session/manager.php: call to core\session\manager::start_session()
  • line 841 of /lib/setup.php: call to core\session\manager::start()
  • line 39 of /config.php: call to require_once()
  • line 94 of /admin/index.php: call to require()
There is no session db configured in the config.php.

Have you faced this issue before or have any solutiion for it?
Average of ratings: -
In reply to Ahmed Al Kahky

Re: Session Error

by Ken Task -
Picture of Particularly helpful Moodlers
You upgraded moodle to 4.1.6 from what lower version of moodle?
Sequence of upgrading php to 8.1 and upgrading moodle ... which was first?
Did you restart web services after upgrading php?
Did you run Server Environment check to assure you had all required PHP extensions and other settings?
Did you check addons (especially addon themes) for compatibility with destination version of 4.1?
You could add a line to config.php to force the site to use 'boost':
$CFG->theme='boost';
Have you purged all caches by going directly to:
https://site/admin/purgecaches.php

'SoS', Ken


In reply to Ken Task

Re: Session Error

by Ahmed Al Kahky -
Hello Ken, Moodle was upgraded from 4.1.3
PHP was upgraded first
the web server was restarted after upgrading PHP
server environment check ran and all extensions are there
All cache was purged too and deleted the sessions
I applied the required change of the theme to be boost and restart the server and still facing the same issue
In reply to Ahmed Al Kahky

Re: Session Error

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
The most common culprits are the caches, from the browser side and the server. Purging browser cache is documented everywhere. On the server side look under the moodledata/ for directories with *cache* in their name.
In reply to Visvanath Ratnaweera

Re: Session Error

by Ahmed Al Kahky -
I cleared the cache of the server and used another browser that I have never used to login to moodle and got the same error.
In reply to Ahmed Al Kahky

Re: Session Error

by Ken Task -
Picture of Particularly helpful Moodlers
The only file that contains that error:

./lang/en/moodle.php:$string['servererror'] = 'An error occurred whilst communicating with the server';

So what is default lang for site?
And what's in moodledata/lang/

All settings related to lang:

cd /path/to/moodlecode/admin/cli/
php cfg.php |grep lang

I do re-call that in upgrading, sometimes see a notification about checking/re-aquiring language packs.

Try going directly to:
/admin/tool/langimport/index.php
and click button that says:
'Update All language packs'.

'SoS', Ken
In reply to Ken Task

Re: Session Error

by Ahmed Al Kahky -
I followed these steps and this is the result of getting the language from the command line:
filter_multilang_converted 1
fullnamedisplay language
alternativefullnameformat language
autolang 1
lang en
langmenu 1
langlist
langrev 1699868808
langcache 1
langstringcache 1
doclang
filter_multilang_force_old 0
autolangusercreation 1
langmenuinsecurelayout 0
langotherroot /var/www/moodledata/lang
langlocalroot /var/www/moodledata/lang

and I visited /admin/tool/langimport/index.php directly and got this message:
Your server does not seem to fully support the following languages:

English ‎(en)‎
Instead, the global locale (en_AU.UTF-8) will be used to format certain strings such as dates or numbers.

then I clicked on Update All language packs button and it displayed "All your language packs are up to date, no update is needed"

and still the same error exists.
In reply to Ahmed Al Kahky

Re: Session Error

by Ken Task -
Picture of Particularly helpful Moodlers
Think this is important:
"Your server does not seem to fully support the following languages:

English ‎(en)‎
Instead, the global locale (en_AU.UTF-8) will be used to format certain strings such as dates or numbers.
"

So how many languages do you have installed?
In my 4.1.6+ I see no en_AU in the list of languages.

What is in /var/www/moodledata/lang/
Actually go look and do an ls -lR there.

Install and another 'en_whatever' language.
See:

'SoS', Ken


 

In reply to Ken Task

Re: Session Error

by Ahmed Al Kahky -
There are no languages installed, I am using the default of Moodle, running ls -lR command returns .:
total 0
In reply to Ahmed Al Kahky

Re: Session Error

by Ken Task -
Picture of Particularly helpful Moodlers
Also ... Go to Site Admin, Server, Environment check.  Update component.

php_intl must be installed and enabled

en_AU is the default for Moodle - according to the language FAQ doc.

Your profile shows you hail from Egypt.   Are you using other languages in your Moodle site?
Did you customize anything language in your Moodle?
Those would show in moodledata/lang/local_lang/

'SoS', Ken

In reply to Ken Task

Re: Session Error

by Ahmed Al Kahky -
en_AU is installed on the server and there no other languages using in Moodle site and there is no folder called local_lang in /moodledata/lang/
In reply to Ahmed Al Kahky

Re: Session Error

by Ken Task -
Picture of Particularly helpful Moodlers
Make sure your moodledata/sessions diretory is rwx by all.

0 in local lang is ok ... means you haven't customized anything language on your site.

If you can, go to:
/admin/settings.php?section=langsettings
directly.

What is language autodetect set to: should be yes.
What is default language?  default should be en

There is a scheduled task
/admin/tool/task/scheduledtasks.php#tool_langimport-task-update_langpacks_task
Update all installed language packs
Does that show it ran?

In installed language packs, if default, there would be only one
in the "installed language packs' box on the left of
/admin/tool/langimport/index.php
That should be 'en' and is en_AUS.

*** Look at available language packs on that same page and select something appropriate for your site.

'SoS', Ken

In reply to Ahmed Al Kahky

Re: Session Error

by Ken Task -
Picture of Particularly helpful Moodlers
Well, think we've covered moodle ... but in re-reading what it says ..."Your server does not seem to fully support" that's php/operating system.
So do you have your php set to use some other language?

'SoS', Ken

In reply to Ken Task

Re: Session Error

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
In reply to Visvanath Ratnaweera

Re: Session Error

by Ken Task -
Picture of Particularly helpful Moodlers
@Mr. V ... +20 smile
'SoS', Ken

In reply to Ken Task

Re: Session Error

by Ahmed Al Kahky -
Thanks a lot, running locale command is returning the following values:

# locale
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE=C.UTF-8
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=
In reply to Ahmed Al Kahky

Re: Session Error

by Ken Task -
Picture of Particularly helpful Moodlers
Sent you a private message on this system with a question/request.  Please respond there!

'SoS', Ken