Running CrashPlan on a QNAP NAS with Docker

Recently I wanted to run Crashplan Online Backup on my QNAP NAS. First, I installed CrashPlan through the package provided in the QNAP AppStore and it worked well for about half a month. Then an unexpected power outage of the NAS left the CrashPlan service broken.

I could not find a way to get the service running again, and while looking for a solution I stumbled upon the blog post by Pedro Pombeiro showing how to install CrashPlan on a QNAP NAS with Docker. As I wanted to have hands-on experience with Docker anyways, I was sold.

Creating the CrashPlan Container

Before you begin, make sure to have the ContainerStation installed on your QNAP NAS. SSH into the NAS and start a docker container running CrashPlan with the following command, which is quite similar to the one proposed by Pedro Pombeiro (note the added --net host, which is explained later in the article).

$ docker run -d --name crashplan -e TZ --publish 4242:4242 --publish 4243:4243 --net host  \
    --volume /share/CACHEDEV1_DATA/Containers/crashplan/config:/var/crashplan \
    --volume /share/CACHEDEV1_DATA:/storage \
    jrcs/crashplan:latest

After starting the container get the authorization token to connect from your CrashPlan desktop application to the service running on the NAS

$ cat /share/CACHEDEV1_DATA/Containers/crashplan/config/id/.ui_info
4243,4a32868e-b301-42ed-a4a6-5443d261abec,192.168.1.10

Follow the official documentation to use CrashPlan on a headless computer to configure your desktop application and manage your backup settings.

As a last step, go to the QNAP NAS web interface and open the ContainerStation. Select the crashplan container and make sure to enable auto start, so your backups will continue to work after restarting the NAS. You can also set the CPU and memory limit to your liking.

Debugging the Container

The container was now running smoothly (with the original docker run command from Pedro Pombeiro) for some time but then I had a planned restart of the NAS and was curious whether the CrashPlan backup service would pick up work again after the reboot. Disappointedly, the service did not start again and I began to tackle the problem. To begin with, I looked at the CrashPlan service status. In an SSH session you can get the current status of the CrashPlan service with the following command:

$ docker exec crashplan /etc/init.d/crashplan status
CrashPlan Engine is stopped.

BindException

The engine was stopped and starting it did not change much:

docker exec crashplan /etc/init.d/crashplan start

While the command started the CrashPlan service for a couple of seconds, it produced a gazillion log entries and immediately stopped again. After some trial-and-erroring I luckily noticed that a similar issue was described in one of the comments of Pedro Pombeiros article. Grepping the logs for the exception confirmed that I was in the same boat:

$ docker logs crashplan | grep BindException
[05.31.16 08:29:50.130 ERROR main           com.backup42.service.CPService] Cannot bind to 192.168.1.10:4243, java.net.BindException: Cannot assign requested address
    STACKTRACE:: java.net.BindException: Cannot assign requested address

To resolve the issue you can add the --net host option to the docker run command. Apparently the issue is related to QTS 4.2.1 and there is hope that the issue will be resolved by QTS in one of the upcoming releases. You cannot add the option to an existing container, but simply create a new container based on the command from above. As you set the same path for the storage and CrashPlan configuration files the new container will just work. That's how it's supposed to be! :-)

OutOfMemoryError

With the same approach you can check whether you are having issues due to too less available memory. Just grep for:

$ docker logs crashplan | grep OutOfMemoryError

I was expecting the OutOfMemoryError as a lot CrashPlan users report memory issues and I initially had only assigned 512MB RAM. Luckily that wasn't the case, but if you happen to run into the issue, read the CrashPlan docs for more information.

Conclusion

Docker makes it very easy and reliable to setup CrashPlan on a QNAP NAS. Although the installation is not point-and-click, it is fairly simple if you know what SSH is and you get all the benefits of a dockerized environment. For future software installations on the NAS, I will definitely consider the ContainerStation again!

Subscribe to blog updates

Of course, we handle your email address very carefully and will not give it to third parties. You will not receive spam emails from us. Have a look at previous emails, to see what you subscribe for.

Comments