Error Unable to load the [...] language file after installing mods

Started by JazzyNL, February 27, 2025, 03:23:24 PM

Previous topic - Next topic

JazzyNL

Posting this here because I believe this is an issue with my server, rather than the mod I'm trying to install.

Installed https://custom.simplemachines.org/index.php?mod=4365 by uploading the zip file through Package Manager. Installing the mod reports no issues. But as soon as I install the error log is flooded with these errors:


Type of error
General

Error message
Unable to load the 'Spoiler/.english' language file.

URL of page causing the error
http://office365lab.com/index.php?action=admin;area=logs;sa=errorlog;desc

After investigation I noticed that the files from the package are not installed:    ./Themes/default/css/spoiler.css
./Themes/default/scripts/spoiler.js
./Themes/default/languages/Spoiler

This is confirmed when I choose to Uninstall the mod, SMF reports a File not found for these lines. The only file that can be found is ./Sources/Class-Spoiler.php.

This leads me to suspect I have an issue with permissions, causing SMF not being able to place the files from the package in the right locations. Have reviewed Package Manager, File Permissions and all directories listed as Writable (chmod: 0777).

The subdirectory 'default' is 755. I suspect that being the issue, but am not sure. Am I looking in the right direction here?


JazzyNL

As often, I'm starting to figure this out while typing it out for this topic. :)

The issue is not with /Themes, this is 777. The problem is with the folders one and two levels deeper, they are 755. Owner of these folders is my regular user account. Apache runs under www-data and is no owner, hence cannot write files in /Themes/default/scripts or /Themes/default/languages/.

Think I need to create a group, add my regular account and www-data to that group and then change ownership of the folder structure. Or simply make everything 777, but I don't think that's the best way to handle this.

Sir Osis of Liver

You should be able to upload the mod files manually via ftp or control panel file manager.
When in Emor, do as the Snamors.
                              - D. Lister

Doug Heffernan

Does this happen with this particular mod only, or it happens with any mod that you try to install?

JazzyNL

Quote from: Sir Osis of Liver on February 27, 2025, 04:12:48 PMYou should be able to upload the mod files manually via ftp or control panel file manager.
That could be a work around, in this case I think I'm close to finding the resolution so would rather fix the problem properly.
Quote from: Doug Heffernan on February 27, 2025, 04:25:54 PMDoes this happen with this particular mod only, or it happens with any mod that you try to install?
Any mod.

So, on my test server I was able to resolve the issue. Permissions for these folders were set to 755:
./Themes/default/scripts/
./Themes/default/languages/

That means that the owner has write access. Problem was that the owner was my ftp user, not the user where Apache is running under. This means that when I upload and install a mod through Package Manager, SMF does not have permission to write files or create directories in these locations.

Fixed by changing ownership to the Apache account:
sudo chown -R www-data:www-data /var/www/mysite.com/*

Next added my ftp user to the www-data group to ensure I still have ftp permission:
sudo usermod -a -G www-data myuser

This resolved the issue on my test server, will now change the production host but am confident that the issue will be resolved there as well.

JazzyNL

Root cause on production forum was different, but in de end the issue was installing a mod without copying the files to the various Themes we have in use. Resolved by manually copying the /language and other files to the right locations for each installed Theme.

Resolved.

zafarkhan987

It does sound like a permissions issue. Try manually uploading the missing files via FTP, ensure the correct ownership (`chown -R www-data:www-data ./Themes/default/`), and check server error logs for more clues. Also, test `chmod 755` instead of `777` as some servers block `777` for security reasons.

JazzyNL

Quote from: zafarkhan987 on March 05, 2025, 05:55:26 AMIt does sound like a permissions issue. Try manually uploading the missing files via FTP, ensure the correct ownership (`chown -R www-data:www-data ./Themes/default/`), and check server error logs for more clues. Also, test `chmod 755` instead of `777` as some servers block `777` for security reasons.
It was a permissions issue on my test server, see https://www.simplemachines.org/community/index.php?topic=591110.msg4186623#msg4186623 for how I resolved it.

On the production server it was simply a matter of copying mod files to the appropriate Themes subfolders.

Advertisement: