Icons not showing after migrationg moodle 3.8.3 to a Linux server

Icons not showing after migrationg moodle 3.8.3 to a Linux server

by Francky NGUEMA -
Number of replies: 10

Hello!

After having various issues with moodle on windows, i decided to migrate to ubuntu.

The migration went fine but images and icons are not showing.

The folder where moodle files script are  and moodledata folder are executable, readable and writable.

Can anyone have an idea ?

Ubuntu 20.04

Mysql 8.0.28

Php 7.4.3

Thanksicons not are not showing

Average of ratings: -
In reply to Francky NGUEMA

Re: Icons not showing after migrationg moodle 3.8.3 to a Linux server

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

Use your browser's developer tools (for example Network Monitor in Firefox) to see if any of the page's resources are not loading successfully (with status 200 OK). This problem can occur if $CFG->wwwroot is HTTP (insecure) but the web server automatically redirects requests to HTTPS (see this reply).

Also use your browser's developer tools (for example Web Console in Firefox) to see if there are any JavaScript errors reported.

Also purge caches just in case.

Moodle 3.8.3 is 12 months behind on updates. You should update to Moodle 3.8.9 to have all the available fixes and security updates.

In reply to Leon Stringer

Re: Icons not showing after migrationg moodle 3.8.3 to a Linux server

by Francky NGUEMA -
i used the Network Monitor in Firefox and some js are not loading (no status 200).
And i have this in the console
Errors in console
In reply to Francky NGUEMA

Re: Icons not showing after migrationg moodle 3.8.3 to a Linux server

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

Have you purged caches? Those timestamps (1650964153 = 2022-04-26 09:09:13 UTC) are from before your first post.

Does the problem occur if you switch to the default Boost theme? You can set this by adding $CFG->theme = 'boost'; to config.php if you cannot change it in Moodle.

What HTTP status (if any) is shown for the JavaScript files which aren't loading? If you click on the file in Network Monitor and view the response is there any error message, or anything that might suggest what's causing the file to fail to load?

In reply to Leon Stringer

Re: Icons not showing after migrationg moodle 3.8.3 to a Linux server

by Francky NGUEMA -
i purged caches before the first post.
The problem also occur with the boost theme.
And there is status 304 for images that are not showed and none status for the js files that are not loading
In reply to Francky NGUEMA

Re: Icons not showing after migrationg moodle 3.8.3 to a Linux server

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

Try adding $CFG->slasharguments = 0 to config.php and see if the files then load as expected. Disabling slash arguments is not recommended – it would indicate that your web server is not set up correctly – but it would quickly show if this is causing the issue on your site.

In reply to Leon Stringer

Re: Icons not showing after migrationg moodle 3.8.3 to a Linux server

by Francky NGUEMA -
I added $CFG->slasharguments = 0 to config.php and the errors i get are the same that those on the picture i send you earlier
In reply to Francky NGUEMA

Re: Icons not showing after migrationg moodle 3.8.3 to a Linux server

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

Are you still having this problem?

The downloadable font: rejected by sanitizer error suggest that the Font Awesome font file is corrupt which would explain why the icons aren't displayed.

The corrupt file could just be the one in your cache which is why I suggested purging it. But when one purges the cache the rebuilt cache is identified by the current timestamp (it's using the Unix epoch format, for example 1651313464). On the server the cached files would be in folder moodledata/localcache/theme/<timestamp>. So if you purge caches 1) the timestamp name should change for that folder, and 2) the timestamp should change in the links to files such as the Font Awesome .woff2 file. But after you purged caches your timestamps showed a value from before that purge. I'm not sure what might cause this.

Some things you can try:

1. Delete the cache, localcache and muc folders from Moodledata. To be safe you could move these somewhere else like /tmp but Moodle should automatically rebuild everything in these folders.

2. Purge all caches again, and then run the SQL query:

SELECT name, value, FROM_UNIXTIME(value) FROM mdl_config WHERE name = 'themerev';

This should show you the Unix timestamp for the current theme cache. The last column shows the timestamp as date/time and this should be the time when you purged the cache. The same timestamp should be in moodledata/localcache/theme/<timestamp>.

3. Check the hash of the Font Awesome file lib/fonts/fontawesome-webfont.woff2 with sha1sum. For example if your Moodle source code folder is /var/www/html/moodle run:

cd /var/www/html/moodle
sha1sum lib/fonts/fontawesome-webfont.woff2
This hash should be d6f48cba7d076fb6f2fd6ba993a75b9dc1ecbf0c. If it's different then there's something wrong with this file and possibly other binary files. A problem that used to occur in the days of FTP was that files were transferred using ASCII (text) mode so PHP files transferred okay but binary files were corrupted.
Average of ratings: Useful (1)
In reply to Francky NGUEMA

Re: Icons not showing after migrationg moodle 3.8.3 to a Linux server

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
What were the issues you had with Windows? Did you solve them all before moving? Changing the apartment will not necessarily heal you from the ailments you've collected. I'm asking because your previous issue is still open: Upgrade from 3.8.3 to 3.11.6 https://moodle.org/mod/forum/discuss.php?d=433445#p1743965.

Coming to Linux, "The folder where moodle files script are  and moodledata folder are executable, readable and writable." Sounds scary! What was the tutorial you followed?

In reply to Francky NGUEMA

Ri: Icons not showing after migrationg moodle 3.8.3 to a Linux server

by Sergio Rabellino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Apart from the other responses, you are missing to say what webserver you are using: apache or nginx ?
If you can't view/download the images, it's the webserver that sends them or not: another thing to verify is the $CFG->xsendile option in moodle config.php (and the webserver support for xsendfile too) ?
In reply to Sergio Rabellino

Re: Ri: Icons not showing after migrationg moodle 3.8.3 to a Linux server

by Francky NGUEMA -
Sorry, i use apache.
i don't have $CFG->xsendile on moodle config.php