No theme at all !

No theme at all !

by Zied ALAYA -
Number of replies: 17

hi ,

we are migrating our Moodle from one server to another. I did a complete backup and a restore to the new server. But I have no theme at all when I acess to the website !

 

I activated all debug messages (under admin/settings.php) but I have no message.

I tried to purge the cache (with command line and under the page admin/purgecaches.php)

I tried selected different themes

I tried diffrent navigator

I even changed the config.php file with the ip adress

 

but still have the issue !

Any idea is welcome. thanks for your help.

 

Moodle: 2.6.1+ ; Mysql: 5.5.35 (the same in the old server)

Php: 5.5.3 (was 5.3.10) ; Apache: 2.4 (was 2.2)

OS: Ubuntu server 13.10 (was Ubuntu server 12.04)

Average of ratings: -
In reply to Zied ALAYA

Re: No theme at all !

by Ken Task -
Picture of Particularly helpful Moodlers

What does 'no theme' look like?  Screen snap would be good.  If blank screen (ie, white screen of death) then say that.

What is ownership/permissions on theme folder/files ... for all files/folders in the code directory for that matter.

Did the site fully qualified domain name change?  or is it the same?  *If it changed*, did you run search and replace tool to correct now errant full url's.

Is site running opcache or apc?   Have you cleared those?

And, don't forget browser cache as well. ;)

'spirit of sharing', Ken

 

In reply to Ken Task

Re: No theme at all !

by Zied ALAYA -

thanks Ken for your answer.

As Visvanath mentionned, it looks like this. I can browse courses and download files.

I refresh my browser with ctrl+F5 every time.

On the server, I changed the permession to read/write for all .

But still have the issue :/

in the old server, I used xcache. in the new one: no php cache was configured.

 

for domain name: our Moodle have to be accessible from different URL (even the IP adress).

I have attached my virtualhost (Apache 2.4, /etc/apache2/sites-available/000-default.conf) and here the config.php file (the same on the old server):

config.php

 

 

 

In reply to Zied ALAYA

Re: No theme at all !

by Zied ALAYA -

I don't know if this can help, but looking for  apache error:

root@Ubuntu201:~# tail /var/log/apache2/error.log

and it's the salme warning every time:

PHP Warning:  Creating default object from empty value in /var/moodle/config.php on line 5, referer: http://172.16.0.15/

172.16.0.15 is the local adress of the server .

 

In reply to Zied ALAYA

Re: No theme at all !

by Ken Task -
Picture of Particularly helpful Moodlers

What does this mean?

"for domain name: our Moodle have to be accessible from different URL (even the IP adress)."

In the config.php file it's best (actually Moodle default config requires) to have a fully qualified domain name for the wwwroot value.  I see you are attempting to use apache variable.

The ip address indicates private network.

So when you are on the private network, what does that IP address revolve to:

dig -x 172.16.0.15

To be accessible from the outside DNS is involved (as well as firewall to the private network).

Does your blackened out fully qualfied domain name for the server point to the private IP inside through whatever firewall?

Does DNS resolve on the outside ... ie, dig [yourserverhostname] shows the public IP address?

Don't forget to purge server cache: http://yourserver/admin/purgecaches.php

If that doesn't clear it ... then one might have to manually remove files in

/yourmoodledata/cache/cachestore_file/default_application

BTW, think you'll find the need to use either APC or OpCache.

'spirit of sharing', Ken

In reply to Ken Task

Re: No theme at all !

by Zied ALAYA -

the same config works fine under different Ubuntu server (10.04 and 12.04).

I have enabled Opache and accessed to http://yourserver/admin/purgecaches.php

I completely deleted /yourmoodledata/cache/ (and moodle regenerated the folder) but I have this output (in english: cache is cleared) :

no redirect

 

Trying a fresh install of Moodle: I have the same issue and this message:

Warning: session_regenerate_id(): Cannot regenerate session id - headers already sent in /var/www/moodle/lib/classes/session/manager.php on line 450

Back to the restored Moodle and I have this

session problem

 

it's may be a problem with session not the theme mixed 

In reply to Zied ALAYA

Re: No theme at all !

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Does "no theme" look like this: https://moodle.org/mod/forum/discuss.php?d=254959 ?

Usual reasons are wrong $CFG->dataroot in config.php or the directory being not writable by the webserver.
In reply to Visvanath Ratnaweera

Re: No theme at all !

by Zied ALAYA -

thanks Visvanath.

yes it looks like that.

I verified $CFG->dataroot in config.php and the directory permissions (I have even changed to read write for all users).

I can also login to website and download files from courses.

 

Still have the issue :/

In reply to Zied ALAYA

Re: No theme at all !

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
As an experiment: set "Site administration -> Server -> Session handling -> Use database for session information" to Yes.
In reply to Visvanath Ratnaweera

Re: No theme at all !

by Zied ALAYA -

it's our default config to prevent login with the same account from different places.

In reply to Zied ALAYA

Re: No theme at all !

by Nikhil Patil -

Yes Zied ALAYA,

Even i was facing the same problem , I have check the "Theme designer mode" in theme setting then everything was working fine.

I think there some apache configuration which is required to be setup.

 

 

 

In reply to Visvanath Ratnaweera

Re: No theme at all !

by Luis de Vasconcelos -

Thanks Visvanath. On my Moodle 2.5.3 Windows 7 and Windows Server test boxes, if I hit the F5 (Refresh) key anywhere inside Moodle this "no theme" problem is triggered - the Moodle theme doesn't display correctly (as per the screenshot in https://moodle.org/mod/forum/discuss.php?d=254959#p1105874). Only after clearning the Moodle theme caches (under Site administration / Appearance / Themes / Theme selector) does Moodle return back to normal. So it's certainly not an invalid $CFG->dataroot and it's not a write permissions problem on that dataroot directory. If it was a bad $CFG->dataroot or incorrect permissions on the $CFG->dataroot folder I would ALWAYS get the "no theme" problem and Moodle would never be able to connect to that bad $CFG->dataroot. But, for me, it only happens randomly (eg when I refresh the page using F5).

And it doesn't matter what browser I use - I can trigger the problem in IE, Firefox and Chrome.

In reply to Luis de Vasconcelos

Re: No theme at all !

by Luis de Vasconcelos -

Moodle debug level is set to "Developer" but nothing useful is written to my PHP error log file.

I can navigate through different parts of Moodle in this broken state (theme not rendering correctly) and the theme never displays. As soon as I clear the theme cache the problem is "resolved" and the theme renders correctly!

And whether dbsessions (Use database for session information) is set to yes or no makes no difference.

So, if I use the normal Moodle navigation to get around there's no problem. But as soon as I hit F5 to refresh a page the problem is triggered.

In reply to Luis de Vasconcelos

Re: No theme at all !

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

This is be a different problem. The OP always get "no theme".

I vaguely remember seeing somewhere in a forum (the lost "Windows forum"!) that permissions on Windows-server being not that self-explanatory. But then why intermittent? I have no clue, except for the same experiment https://moodle.org/mod/forum/discuss.php?d=255427&parent=1108411.

Edit: Or is there a bug: https://moodle.org/mod/forum/discuss.php?d=255556 ?
In reply to Visvanath Ratnaweera

Re: No theme at all !

by Luis de Vasconcelos -

I think it's the same problem - maybe I explained my situation wrong... I also get "no theme". In other words, none of the .css that handles the theme formatting, colours and display loads correctly.

I have played with the Windows permissions extensively, but that doesn't seem related. When permissions are completely open (everybody has access) I still experience the problem.

Additionally, javascript and css seems to be broken. I get a completely white background, no images are displayed and all the navigation links in the blocks, like the Site Admin block, are expanded on the left (as opposed to collapsed when the theme is rendered correctly).

session.save_handler is set to "files" in my php.ini file, so Wincache is disabled. No other PHP accelerator (e.g. eAccelerator) is enabled.

Maybe it's a YUI problem? I haven't worked it out yet...

In reply to Luis de Vasconcelos

Re: No theme at all !

by Luis de Vasconcelos -

One of my production boxes is running Moodle 2.0.4. Another is running 2.2.1. This "no theme" problem never occurs on those servers. You can press F5 whenever and wherever you want and the theme and CSS is always rendered correctly.

My QA box is running several instances of Moodle, including 2.2.1 and 2.5.3 (also all under IIS and MSSQL and all with the same folder permissions and folder structure). If you press the F5 key anywhere in the 2.2.1 site nothing breaks - everything displays correctly. But hit F5 on the 2.5.3 site and it completely "breaks" the theme and display as described in this thread. So, something certainly has changed in recent versions of Moodle (2.3 or higher) that affects theme rendering and causes this problem. The tricky part is finding out what is causing the problem - something in the 2.4 or 2.5 theme engine changes?

It's not a huge problem - users shouldn't use the F5 key in Moodle. But there's still a regression somewhere...