Network folders are showing up empty in MusicBox 0.5.1rc

The error doesn’t necessarily occur during local scan, it may also occur when browsing a folder with files/directories containing non-ASCII characters, due to this: https://github.com/tkem/mopidy-local-sqlite/issues/41
Could you try browsing “Folders” and then look at the last lines of /var/log/mopidy/mopidy.log?

Okay, after rereading this thread, my above suggestions are probably more relevant to @markus_gregory who can reproduce problems with umlauts even on the Pi’s local file system, if I understand correctly. Sorry for my confusion.

As a general suggestion for all problems related to local/network file browsing, in the settings.ini file’s [local] section, you may try replacing

library = sqlite

with

library = json

and do a rescan. If that fixes anything, please post bug reports on https://github.com/tkem/mopidy-local-sqlite/issues/

yes, it is working if I change the library, there are no empty or missing folders any more.
thx to tkem and all others who helped to solve my problem.

@markus_gregory: did you also check the locale settings with the sqlite library? This would give more hints for the root cause of this issue.

@tkem: I tried to find the sql setting, but I have absolutely no experience with databases.
If you can write me which setting I should check and where they are stored, I will report everything you need.

@markus_gregory: Sorry if I didn’t make myself clear, what I meant was following the locale-specific suggestions earlier in this thread:

  1. log into MusicBox via SSH as root
  2. run locale
  3. if (and only if) it reports your locale set to POSIX, try changing the system locale to en_US.UTF-8 using raspi-config
  4. in settings.ini, in the [local] section, set library = sqlite, as it originally was
  5. after reboot, check if the problem regarding non-ASCII character still persists (you can set it back to library = json afterwards)

If in step 2, locale already reports en_US.UTF-8, as it apparently did for @jaccobezemer, no need to follow the other steps; then something must have gone terribly wrong with my MusicBox installation…

No need for messing around with SQL, and thanks for your cooperation!

Changing the library from sqllite to json did the trick.
All files are visible now.

Thanks Thomas and others.

@jaccobezemer: I just reinstalled Pi MusicBox from http://www.woutervanwijk.nl/pimusicbox/musicbox0.5.1.zip, and after looging into MusicBox as root, I get this:

root@MusicBox:~# locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

What did you do differently to get an en_US.UTF-8 locale?

I started with a complete fresh 0.5.1 installation now

root@MusicBox:~# locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS=“POSIX” …

changing locale with raspi-config is not possible
/usr/sbin/dpkg-reconfigure: locales is broken or not fully installed
Press to continue…

OK, same here. Please run

apt-get install locales

and then try again with raspi-config

Thanks!

@tkem:
Well I followed the procedure you posted yesterday.
I did apt-get install locales and then raspi-config.
Then Set System Locale and noticed that en_US.UTF-8 was already selected.

But I just did locale and got the same output as you did.
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

Locale -a gives:
C
C.UTF-8
POSIX
en_US.utf8

Btw I use the RC2 image.

After apt-get install locales I was able to run raspi-config/local
but POSIX was still active, so I tried to set locales manually
Edit /etc/environment:
LANG=en_US.utf8
export LANG
LANGUAGE=en_US
export LANGUAGE
LC_ALL=en_US
export LC_ALL

add in /etc/profile:
source /etc/environment

now locale is reporting:
LANG=en_US.utf8
LANGUAGE=en_US
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=en_US

with sqlite the folders are empty again.

1 Like

Well, thanks for your efforts. I’m a little puzzled with this: on Raspbian, setting the system locale also affects the root user and any system services like mopidy, AFAICS. That’s why browsing UTF-8 paths works there without problems if the system locale is UTF-8 aware.
On MusicBox, setting the system locale does not seem to have any effect on mopidy, which still reports sys.getfilesystemencoding() as ‘ANSI_X3.4-1968’.
Any ideas from the MusicBox developers?

For what it’s worth, an update of the sqlite library is available for anybody willing to try it; please follow the instructions in

Note that for me, this doesn’t really solve this issue, since non-ASCII characters will still not be displayed properly when browsing Folders; however, folders will no longer show up empty, at least…

I think I’ve gotten to the bottom of this, the crucial fact being that this works in raspbian but not musicbox. Presumably everyone here is doing this all over ssh and musicbox uses dropbear rather than the normal openssh server. The problem being that dropbear does not set the locale of a remotely logged-in user. After adding : ${LANG:=en_GB.utf8}; export LANG to my /etc/profile as per the bug report workaround (and logging in and out again) I now see the correct locale.

root@MusicBox:~# locale
LANG=en_GB.utf8
LANGUAGE=
LC_CTYPE="en_GB.utf8"
LC_NUMERIC="en_GB.utf8"
LC_TIME="en_GB.utf8"
LC_COLLATE="en_GB.utf8"
LC_MONETARY="en_GB.utf8"
LC_MESSAGES="en_GB.utf8"
LC_PAPER="en_GB.utf8"
LC_NAME="en_GB.utf8"
LC_ADDRESS="en_GB.utf8"
LC_TELEPHONE="en_GB.utf8"
LC_MEASUREMENT="en_GB.utf8"
LC_IDENTIFICATION="en_GB.utf8"
LC_ALL=
root@MusicBox:~# python -c "import locale; print(locale.getpreferredencoding())"
UTF-8

I don’t have any local media set up to test this out but hopefully someone can give it a go.

Ah, that explains some things. However, mopidy runs as a system service from init script, so it should use the system locale, AFAIK.

Turns out there’s already a bug report for this: https://github.com/woutervanwijk/Pi-MusicBox/issues/187
Reporter doesn’t say which local library is used, though.

True, good point. What is the default if not picked with raspi-config and
Seeing as locales is not installed?

I removed as many locales as I could to save on disk size (so MB can fit on a 1GB SD-card). Maybe one too many. I also use locale-purge. Maybe that’s the culprit?