Ubuntu, missing images and encrypted home folders

Do you use an encrypted home partition on Ubuntu or related Linux distributions? That might cause a problem with bliss. Here's how to work around it...

I've had a couple of emails from Ubuntu users recently. Just a few days ago:

I have installed the trial version on my laptop (Linux Mint, essentially latest Ubuntu/Debian base). Curiously: the images on the web pages are all toast. Both in Chrome & FF. http://localhost:3220/images/icojoy/onebit/24x24/tick.png is the image that should be a tick (obviously) and I get the crapulous image placeholder showing not-found.

It's not only images, but also stylesheets and Javascript which are sometimes not made available within the bliss UI, and so the UI is pretty-much unusable.

It took me a while to figure this out, but eventually I found this error message in one of the affected users' log files:

java.io.FileNotFoundException: /home/system/.bliss/jetty-ui/webapp/com/elsten/bliss/ui/comet/UntaggedSuggestionActor$$anonfun$com$elsten$bliss$ui$comet$UntaggedSuggestionActor$$bindCandidateReleaseTags$1$$anonfun$inlineTagValueCell$1$1.class (File name too long)

I emboldened File name too long as it's the cause of the problem. That filename (starting 'Untagged...') is too long. However, on first glance, the filename in question is 149 characters long. Given even ext3 supports filenames of 255 characters, why the problem?

It turns out that encrypted folders in Ubuntu can only store filenames of up to 143 characters. bliss is attempting to copy the filename of 149 characters into the "working area" of your home directory and failing because the filename is too long. When the failure occurs, bliss gives up copying any other files.

Strictly speaking it looks like it's eCryptfs with the limitation. Obviously, you don't want to disable encryption so you can run bliss, so what's the workaround?

Fortunately it is possible to configure bliss's working directory, where it stores settings, its internal database, its latest version of code and more. We create a folder in an unencrypted location (say, /var/cache which is often used for runtime files) and point bliss there:

sudo mkdir /var/cache/bliss
sudo chown $USER:$USER /var/cache/bliss
export VMARGS="-Dbliss_working_directory=/var/cache/bliss"

When you now run the bliss.sh shell script from within the same login/terminal session, bliss will use /var/cache/bliss as its working folder instead.

If you open a new terminal window and run bliss then this configuration will not transfer. While the first two lines only need to be done once, to create the directory, the last line needs to be repeated each time bliss starts in a different login context (terminal session). You can either edit the bliss.sh script to include the above line or add it to your startup scripts in /etc/rc.local or whichever way you choose.

So there you go! I'll be looking at a way of shortening that filename, which is an artifact of the bliss code compilation process!

Thanks to [AndreasS] for the image above.
tags: linux
blog comments powered by Disqus

The Music Library Management blog

Dan Gravell

I'm Dan, the founder and programmer of bliss. I write bliss to solve my own problems with my digital music collection.