OpenWrt Forum Archive

Topic: ownCloud UTF-8 issue

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi, There

I've used the following guide to set up ownCloud:
http://wiki.openwrt.org/doc/howto/owncloud

Worked great, there were some minor issues like the guide did not said, but I've installed: php5-mod-fileinfo
(opkg install php5-mod-fileinfo)
Also configured a little differently lighthttpd.

But there is one error which I can not fix and that is the following:
On the ownCloud admin page:
http(s)://yourip/index.php/settings/admin
or <your account button on the upper right> ==> admin
The following error message appears:

"This ownCloud server can't set system locale to en_US.UTF-8/en_US.UTF8. This means that there might be problems with certain characters in file names. We strongly suggest to install the required packages on your system to support en_US.UTF-8/en_US.UTF8. "

How can I fix this?

I'm trying this too. I get the same kind of error in logread:

authpriv.emerg ownCloud[2441]: {core} setting locale to en_US.UTF-8/en_US.UTF8 failed. Support is probably not installed on your system

Locales are essential though, as said here: https://github.com/owncloud/core/issues/2932

But Owncloud still works well though. You only get these errors all the time.

(Last edited by Flint on 18 Aug 2013, 17:24)

Anyone wants to clarify why OpenWrt is not built with locale support by default? Probably a performance issue?

...

Could it be an issue with lighttpd instead?
mimetype.assign = ( ".html" => "text/html; charset=utf-8" )

alphasparc wrote:

Could it be an issue with lighttpd instead?
mimetype.assign = ( ".html" => "text/html; charset=utf-8" )

No, it needs locale support compiled into base firmware.
It can be configured when building your own firmware with buildroot.

Flint wrote:

Anyone wants to clarify why OpenWrt is not built with locale support by default? Probably a performance issue?

Thats because of openwrt devs are trying to save as much free space as possible. Fairly speaking, full locale support on embedded router in 99% cases will be never needed, but it would occupy some space in firmware image, while flash size is very limited on most devices. I saw a lot of not-that-important-by-devs-opinion features stripped from many packages (i.e.: dropbear) only to save another 1-2kb in firmware image.

I saw the bug report.
It isn't anything serious if all the filenames are in english...

eximido wrote:

Thats because of openwrt devs are trying to save as much free space as possible. Fairly speaking, full locale support on embedded router in 99% cases will be never needed, but it would occupy some space in firmware image, while flash size is very limited on most devices. I saw a lot of not-that-important-by-devs-opinion features stripped from many packages (i.e.: dropbear) only to save another 1-2kb in firmware image.

I hope they don't also strip things that cannot easily be added after flashing firmwares, like locale support. Maybe they should only strip things that can be added afterwards using opkg. A good example is tar. OpenWrt has basic tar support, but if you install opkg's tar then you have full tar functionality.

Something to note from uClibc.

uClibcFAQ wrote:

Some of the space savings in uClibc is obtained at the cost of performance, and some is due to sacrificing features. Much of it comes from aggressive refactoring of code to eliminate redundancy. In regards to locale data, elimination of redundant data storage resulted in substantial space savings. The result is a libc that currently includes the features needed by nearly all applications and yet is considerably smaller than glibc. To compare "apples to apples", if you take uClibc and compile in locale data for about 170 UTF-8 locales, then uClibc will take up about 570k. If you take glibc and add in locale data for the same 170 UTF-8 locales, you will need over 30MB!!!

So 570k is considered a lot... smile but I can still understand that when you look at regular OpenWrt build sizes.

What I don't understand is why we cannot devise a way to get locale support through a package. Or has that just never been done by somebody?

(Last edited by Flint on 23 Aug 2013, 16:54)

I think this deserves some serious thought. Routers are improving all the time and getting faster. Before long they can run full Linux distributions. At present flash size is already irrelevant now that we have extroot. Is throwing out functionality to save a few kilobytes a smart thing to do? At least users should have the option to easily put back omitted features, don't you think?

And what about the performance? if I guess you  have tested it on WDR4900?

Flint wrote:

At least users should have the option to easily put back omitted features, don't you think?

You still can get full (more or less) locale support if you rebuild firmware yourself.
All relevant options are available in buildroot menuconfig, so it's not a huge deal.

Locale support just can't be added to working system which was compiled without them. It can't be done in form of packages, cause it requires changes in uclibc and other (kernel-related?) things as well. So... it is more or less reasonable and we need to live with it. What I personally don't understand is when some functionality is thrown off and there's no option to get it back other then break into openwrt-specific patches and manually alter and revert them. Thats a lot more annoying.

Alright, it makes sense. But I guess it should be possible to add locale support via a package. We have all kinds of kernel modifying packages, don't we? Just making an e.g. kmod-localesupport or something doesn't look that insurmountable compared to other things you can add to the kernel.

eximido wrote:

You still can get full (more or less) locale support if you rebuild firmware yourself.
All relevant options are available in buildroot menuconfig, so it's not a huge deal.

Please, tell me which options i must set in menuconfig for enable locale support, which is necessary for OwnCloud 6.0?
Enabling kmod-nls-utf8  is enough for that? Must i edit uClibc's settings? Which?

I have the same issues. I just bought a new router for the combination of ownCloud and openWRT.
The wiki page suggests that ownCloud is supported. If this is not the case there should be a large warning sign that this is actually not supported. Otherwise other users might make the same mistake and buy new hardware which is not able to do what they want to do.

I would really appreciate some guide or links how I should proceed to get it to work. Thank's a lot.

I solved this problem. You must enable "Global build settings ---> Compile with full language support" in make menuconfig. kmod-nls-base was also enabled. That's all.
Here are Print Screen of this setting:
picture

Thank you for the fast reply. I am just trying it.
Do you know how I can enable all other options as in the standard flash images.
I am esspecially concerned that LuCI might not be included if I build it myself?
Before I just downloaded a firmware binary and flashed it on my WDR3600. Do you know how I can make sure that I get the same packages as in the official http://downloads.openwrt.org/attitude_a … ctory.bin?
I am esspecially concerned to lock myself out of the router if I choose the wrong options.

Thank's a lot!

For enable all other options as in standard flash image, you must select correct target profile (I have TP-Link TL-WR941ND, and i select TP-LINK TL-WR941N/ND):
img

Instruction how to use openwrt buildrroot are here:
http://wiki.openwrt.org/doc/howto/build

Ok, I compiled and flashed it. Now I have no LuCI anymore. Also when I try to install some kernel modules to get usb support I get the following errors:

Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-usb-storage:
*      kernel (= 3.10.32-1-9ebf361b7f8cdd09e21ab452d7ccc05e) *         kernel (= 3.10.32-1-9ebf361b7f8cdd09e21ab452d7ccc05e) *
* opkg_install_cmd: Cannot install package kmod-usb-storage.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-usb-storage-extras:
*      kernel (= 3.10.32-1-9ebf361b7f8cdd09e21ab452d7ccc05e) *
* opkg_install_cmd: Cannot install package kmod-usb-storage-extras.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-fs-ext4:
*      kernel (= 3.10.32-1-9ebf361b7f8cdd09e21ab452d7ccc05e) *         kernel (= 3.10.32-1-9ebf361b7f8cdd09e21ab452d7ccc05e) *         kernel (= 3.10.32-1-9ebf361b7f8cdd09e21ab452d7ccc05e) *
* opkg_install_cmd: Cannot install package kmod-fs-ext4.
* opkg_install_cmd: Cannot install package kmod-scsi-genericopkg.
* opkg_install_cmd: Cannot install package install.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-scsi-generic:
*      kernel (= 3.10.32-1-9ebf361b7f8cdd09e21ab452d7ccc05e) *
* opkg_install_cmd: Cannot install package kmod-scsi-generic.

nomailing wrote:

* opkg_install_cmd: Cannot install package kmod-scsi-genericopkg.
* opkg_install_cmd: Cannot install package install.

There is a typo.

nomailing wrote:

Now I have no LuCI anymore.

Add to your build as you did with missing packages.

nomailing wrote:

Also when I try to install some kernel modules to get usb support I get the following errors:

opkg --force-depends ...

Also you may wish a trick to fool kernel version check:
http://wiki.openwrt.org/doc/howtobuild/ … ility.hack

assuming you have installed owncloud into /www folder, find this file

/www/owncloud/lib/private/util.php 

in this file find function isSetLocateWorking()

        public static function isSetLocaleWorking() {
                // setlocale test is pointless on Windows
                if (OC_Util::runningOnWindows() ) {       
                        return true;               
                }                                                                                     
                                                       
                \Patchwork\Utf8\Bootup::initLocale();
                if ('' === basename('..')) {
                        return false;                                                                                       
                }                                 
                return true;
        }


Change it to return true under basename('..')

                if ('' === basename('..')) {
                        return true;                                                                                       
                }   


restart lighttpd and have fun.

The discussion might have continued from here.