[HOW TO] run LMS 7.9 in a docker container

Post Reply
User avatar
oyvindo
Experience counts
Posts: 1019
Joined: Tue May 19, 2009 2:08 am
Location: Norway, Oslo

[HOW TO] run LMS 7.9 in a docker container

Post by oyvindo » Thu Jun 23, 2016 4:01 am

Here is my cookbook on how to install and run Logitech Media Server 7.9 in a docker container under Container Station.
This works well for me, and I hope it will for you too...

Code: Select all

First you need to find a container image for LMS. There are several ways to do this, and here is one:
Start Container Station from App Center and click +Create Container.
In the search bar, type Logitech and hit return

You should see 4 repositories along the top of the list:
Recommended, Local, IoT and Docker Hub

The search function will stop at the first hit going from left to right.
So if you already have a container package downloaded locally whose name contains the word "logitech", it will find it and stop the search.

To search in the other repositories, you have to click on the "Docker Hub". That should give you a long list of packages to choose from - all with names that contain the word "Logitech". Which package to choose, is up to you. You may have to try and fail a few times before you find one that works. A good tip is to check the version box to see what is actually available. You will probably want to have a reasonably recent version. And don't be fooled by the word "latest" which is always default. It is no guarantee that it actually is the latest. But anyway, I will explain to you later how to upgrade as long as you can find an image that will install and run in Container Station.

Trial and error here is relatively harmless - which is the whole point of Container station. If something goes wrong - just remove the container and try again.

Once you have chosen which package you want to install, click on install. In the create container window, you can change the name of the package you are about to install along with a few other parameters, but that is not so important now.

However, in order for Logitech Media Server (LMS) to be able to retrieve data from, and pass data to, the outside of the container, you must mount Shared folders for it to use. Most likely your music collection is stored outside the container (it's not a good idea to store media files inside containers as they will vanish when (if) you remove the container.

Also, you need to consider how you want port mapping to be handled. By default, Container station will configure the container network in bridge mode (NAT) with an internal network in the 10.x.x.x range while your NAS probably is connected to a 192.168.x.x network. The default LMS ports (9000, 9090 and 3483) are mapped into random port numbers which change every time you start and stop the container (which means also every time you reboot your NAS). This is not very practical - for obvious reasons. So instead you'll be more happy to configure the containers in host mode. That way, the container becomes part of the NAS network and no port mapping takes place. Of course there are disadvantages with this also. The container suddenly becomes less isolated and vulnerable to external problems. This is a security issue you have to consider.

Click on the "Advanced Setting" and then in the menu on the left side click on Network. Then change the NAT field to host.
Then move down to the Shared Folder section. In this section, you may see that some volumes are already set, i.e. /data or /media. If that is fine with you, you could use it as is, but my recommendation is that you create your own folder link - one for Music and one for Playlists. If you intend to have other folders in the future, now is a good time to establish them all. One folder which is important to create is folder where LMS can store dynamic data. This folder is named /state and you should point it to a share easily accessible to yourself. (I have not been able to figure out how to do that later, but I'm sure it can be done). If you do not point /state to a shared folder with read/write access, it will be stored under /share/CACHEDEV1_DATA/Container/container-station-data/lib/docker/volumes and this may cause access right conflicts.

In the "New Volume" field, type i.e. /media/Music
Then in the Mount Point under "Volume From Host" type the same (mind you that names are case sensitive).
Then in the host path, select the share that you wish to make available to the container. You will only be able to select shares already established in the NAS (QTS), so unless you have already done so - you must terminate and share you music folder first (using File Station) along with any other folders you wish to use (Playlists, state etc.)
If your Music library has a lot of subfolders (several thousands), then it may take a while before the setup page becomes responsive - and you can finally click on "create".

Now the package is downloaded from the repository and the container is created. This can take a while depending on your internet connection speed. These packages are often several hundred megabytes in size. Just be patient. You can follow the progress in the console window and by clicking on the background task icon (the inbox icon in the upper right corner of the window).

Once installation is completed, Logitech Media Server is started and it takes some time before it gets setup properly and the URL becomes visible in the container window. You cannot access LMS until the URL comes alive. Ones the URL shows up, it should be clickable as an active link that will take you to a new tab in your browser and open the default LMS Web GUI.

Some houskeeping info:
When you installed Container Station itself the first time, you were asked which folder to store images and containers in. This folder should typically be somewhere on you NAS. You find the location for this folder if you open the Contain Settings for your LMS container and look under Advanced Setting in the Shared Folder section. It will typically look someting like this:
<default folder>/container-station-data/lib/docker/volumes/3a80116c86bb38625ee8bcb1af67be65152c7b04fd926f01b825927508dbf13c/_data
where <default folder> is the folder you specified during installtion of Container Station.
In fact, if you navigate to <default folder>/container-station-data/lib/docker/volumes/ you will find all your containers there (several weird hexadecimal loooong foldernames, one for each container - including also old containers you may have removed (but those folders should be empty). So, as you can conclude from this - application data (not all) stored inside the container, is copied to this outside folder. This means you can get access to log files even after the a major container crash. But be sure not to run around in these folder and do stuff while the container is running.
Also, you should check the time and date setting of your container. For some obscure reason, container station does not pick up the timezone from you NAS. So you may have to change this to get corret timestamps on all log items. In order to check (and correct the time), you need to SSH into the container:
1. Open the container status page for LMS in Container Station and copy the Container ID.
2. SSH into your NAS
3. type 'docker exec -i -t <contianer-ID> bash' (without the quotes) on the command line.
4. That should take you into the container and you should see a prompt like this: root@<your-NAS-name>:/#
5. If you live in Singapore, type:
   echo "Asia/Singapore" > /etc/timezone
   dpkg-reconfigure tzdata
   date
You will find the syntax for every other place on earth here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
6. Now restart you container to see if everything is ok.

From here on, the rest is up to you.

Oh, I promised to tell you how to upgrade.
Most likely, the package you downloaded is not the most recent version of LMS. If not, LMS will tell you so in the status bar on the main Web GUI page. If there's nothing there - don't worry. Then you have the most recent version.
But if not, and you wish to upgrade, then here's how:
(This assumes that you know how to get around in LMS)

A. Cancel any ongoing media scans (LMS initiates a scan automatically when launched)
B. Click on the upgrade link which will take you to the LMS updates page. Here you should click on the "Click here for further information" which moves you onward to the information page which will give you a step by step guide on what to do. The important part there is the command including the correct path in order to do the upgrade. Make a copy of that command line for later use (store it in Notepad or somewhere else).
This command typically looks something like this:
sudo dpkg -i /srv/squeezebox/cache/updates/logitechmediaserver_7.9.0~1466175427_amd64.deb
Now, what you do not see, is that LMS downloads the deb package in the background, and because these packages can be rather large, you must not interrupt, close or stop LMS while it is still downloading. There is, regretfully, no easy way to tell when it is finished downloading except peeking into the container and looking at the content in the above given path. But if you know your internet connection speed fairly well, you have a rough idea how much time it takes to download approximately 50-100Mb (?). To be on the safe side, take a half hour nap before moving on. Your upgrade will fail if the download is not complete.

Then you need to SSH inside the container to get terminal access. Here is how:

1. Open the container status page for LMS in Container Station and copy the Container ID.
2. Use Putty (or whatever terminal emulator you like) and log into your NAS
3. Type: "docker exec -i -t <your CONTAINER ID> bash" replacing <your CONTAINER ID> with the ID you found.
4. Once inside the container, you should see something like: root@<name_of_your_NAS>:/#
5. Then type the command that you found in step B above: sudo dpkg -i /srv/squeezebox/cache/updates/logitechmediaserver_7.9.0~1466175427_amd64.deb
(replace the path and the package name with what you found)
6. Be patient. It takes a while to unpack, install and setup LMS. You will get the prompt back in the end.
7. log out of the container by typing exit

Now the updated version has been installed on top of the old one. All you need to do now is to stop and restart the container. You do that from container station itself. If everything goes well and you can finally open up the LMS web GUI again, check that you now have the updated version.
Congratulations. You're good to go!

Edit Dec. 8 2016: I have found it to be a good housekeeping practice to update/upgrade the linux version inside the container. In fact, sometimes I had to in order to be able to install a new version of the app. An example was when Madsonic upgraded to Java8. The new version could not be installed unless Java first had been upgraded.
The easiest way I have found to do this, is as follows:

1. SSH into the container (see above)
2. Type the following commands:
   apt-get upgdate
   apt-get upgrade
   apt-get autoremove
   
The above should be done before you upgrade LMS, and my advice is to add this as a good habit whether needed or not.
If you run into dependencies problems, just type:
apt-get -f install

Then reinstall (upgrade) everything again.
   

I am successfully running not only LMS in a container, but also Plex and Madsonic, all using the same Music library. For obvious reasons, it doesn't make much sense to run Kodi (XBMC) in a container as Kodi is not a server, and the main purpose of Kodi is to shine on you living room TV. I haven't found a way to make the HDMI i/f available to a container. I guess that's why QNAP released Linux Station and HD Station (?)  :lol:

[Edit] Since I wrote this guide, I have decided to replace the container image I first used, with another - in my opinion - better image, that - among other things - support automatic update to new versions of LMS by simply restarting the container. This image is called: justifiably/logitechmediaserver. You will find it if you search for the word "justifiably" under Create Container
[Edit1] I just updated to QTS 4.3.3 and CS was automatically updated to 1.7.2320 and everything works just fine on first reboot.
[Edit2] Added recommendation to assign a share folder location in CS Advanced Setting to /state, in order to prevent access privilege errors which I've had some reports of.
Last edited by oyvindo on Mon Aug 28, 2017 5:26 pm, edited 6 times in total.
NAS:
QNAP TS-453Be 16Gb
4x3TB RAID5
QTS 4.4.1
Dockerized installations of:
Madsonic, Logitech Media Server, Pi-Hole, Home-Assistant, MQTT

QNAP HS-251 2G
2x2TB RAID0
QTS 4.4.1
Kodi, Rainloop, Guacamole, L2TP

QNAP TS-119
Single Disk 1Tb
QTS 4.3.3
Used mainly as Reverse Proxy

obsession
Starting out
Posts: 17
Joined: Wed Aug 31, 2016 2:15 pm

Re: [HOW TO] run LMS 7.9 in a docker container

Post by obsession » Thu Oct 13, 2016 8:09 am

Hi,

I followed your instructions but I hit some problems setting the "Volume from Host" during the container creation.
I can only select "Public" path, the rest of my paths are not selectable in the drop down.
From my File Station, I can see all my paths are available.

I wanted to select QNAPnas\Multimedia\Music, as my "Volume from Host"
Pls advise.
Screen Shot 2016-10-13 at 8.03.47 AM.png

Screen Shot 2016-10-13 at 8.05.33 AM.png


Appreciate your advise. :)
You do not have the required permissions to view the files attached to this post.
Last edited by obsession on Thu Oct 13, 2016 11:56 pm, edited 1 time in total.

User avatar
oyvindo
Experience counts
Posts: 1019
Joined: Tue May 19, 2009 2:08 am
Location: Norway, Oslo

Re: [HOW TO] run LMS 7.9 in a docker container

Post by oyvindo » Thu Oct 13, 2016 10:20 pm

In order to add folders to the container, they must first have been created as shared folders in QTS using File Station.
In my case, I've created a shared folder named Plex_Music:

Image

You should then be able to locate these folders when you create the container. As my container is already created, I can only show you the result:

Image

I have seen though, that some posts in this forum is discussing problems with creating folders for use by Container Station on certain NAS, but I have never had any problems on mine.
Is your Public folder the only folder you can see? Do you have other shared folders?
NAS:
QNAP TS-453Be 16Gb
4x3TB RAID5
QTS 4.4.1
Dockerized installations of:
Madsonic, Logitech Media Server, Pi-Hole, Home-Assistant, MQTT

QNAP HS-251 2G
2x2TB RAID0
QTS 4.4.1
Kodi, Rainloop, Guacamole, L2TP

QNAP TS-119
Single Disk 1Tb
QTS 4.3.3
Used mainly as Reverse Proxy

obsession
Starting out
Posts: 17
Joined: Wed Aug 31, 2016 2:15 pm

Re: [HOW TO] run LMS 7.9 in a docker container

Post by obsession » Thu Oct 13, 2016 11:54 pm

Hi,

I'm using QNAP TS251+.
my Music folder is shared in File station, think i got it right:
File%20Station.png


When I create containers, I copied the docker command.
Create%20Container-DockerMain.png


and my Share Folder settings. I can only see "public" folder under "Volume from Host"->"Host Path"
Create%20Container-ShareFolder.png
You do not have the required permissions to view the files attached to this post.

obsession
Starting out
Posts: 17
Joined: Wed Aug 31, 2016 2:15 pm

Re: [HOW TO] run LMS 7.9 in a docker container

Post by obsession » Fri Oct 14, 2016 12:55 am

Hi,

I've created another Folder "Music" in File Station.
Now I can see and select it in "Volume from Host". :)
Hopefully my created container runs and generate the LMS URL.
Model: QNAP TS251+ 2GB
HDD: HGST DeskStar NAS 4GB

User avatar
oyvindo
Experience counts
Posts: 1019
Joined: Tue May 19, 2009 2:08 am
Location: Norway, Oslo

Re: [HOW TO] run LMS 7.9 in a docker container

Post by oyvindo » Fri Oct 14, 2016 2:52 am

Let us know how it works out for you....
NAS:
QNAP TS-453Be 16Gb
4x3TB RAID5
QTS 4.4.1
Dockerized installations of:
Madsonic, Logitech Media Server, Pi-Hole, Home-Assistant, MQTT

QNAP HS-251 2G
2x2TB RAID0
QTS 4.4.1
Kodi, Rainloop, Guacamole, L2TP

QNAP TS-119
Single Disk 1Tb
QTS 4.3.3
Used mainly as Reverse Proxy

obsession
Starting out
Posts: 17
Joined: Wed Aug 31, 2016 2:15 pm

Re: [HOW TO] run LMS 7.9 in a docker container

Post by obsession » Fri Oct 14, 2016 10:40 am

Hi,

I doesn't seem to work out.
LMS dun look right.PNG

M1.PNG

M-Network.PNG

M-sharedFolder.PNG


Logs captured on console:

Code: Select all

frame 1: Slim::Schema::Storage::throw_exception (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 1006)                                              

                                                                                       

   frame 2: DBIx::Class::Storage::DBI::__ANON__ (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 2058)                                             

                                                                                         

   frame 3: DBIx::Class::Storage::DBI::_dbh_sth (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 573)                                               

                                                                                         

   frame 4: DBIx::Class::Storage::DBI::dbh_do (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 2071)                                               

                                                                                         

   frame 5: DBIx::Class::Storage::DBI::sth (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 1264)                                                   

                                                                                         

   frame 6: DBIx::Class::Storage::DBI::_dbh_execute (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 573)                                           

                                                                                         

   frame 7: DBIx::Class::Storage::DBI::dbh_do (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 1297)                                               

                                                                                         

   frame 8: DBIx::Class::Storage::DBI::_execute (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 1532)                                             

                                                                                         

   frame 9: DBIx::Class::Storage::DBI::_select (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI/Cursor.pm line 129)                                         

                                                                                         

   frame 10: DBIx::Class::Storage::DBI::Cursor::_dbh_all (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 583)                                     

                                                                                         

   frame 11: (eval) (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 581)                                                                           

                                                                                         

   frame 12: DBIx::Class::Storage::DBI::dbh_do (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI/Cursor.pm line 140)                                         

                                                                                         

   frame 13: DBIx::Class::Storage::DBI::Cursor::all (/usr/share/squeezeboxserver/lib/DBIx/Class/ResultSet.pm line 1435)                                             

                                                                                         

   frame 14: DBIx::Class::ResultSet::all (/usr/share/perl5/Slim/Plugin/FullTextSearch/Plugin.pm line 446)                                                           

                                                                                         

   frame 15: Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (/usr/share/perl5/Slim/Plugin/FullTextSearch/Plugin.pm line 134)                                   

                                                                                         

   frame 16: Slim::Plugin::FullTextSearch::Plugin::startScan (/usr/share/perl5/Slim/Music/Import.pm line 513)                                                       

                                                                                         

   frame 17: Slim::Music::Import::runImporter (/usr/share/perl5/Slim/Music/Import.pm line 411)                                                                     

                                                                                         

   frame 18: Slim::Music::Import::runScanPostProcessing (/usr/sbin/squeezeboxserver-scanner line 340)                                                               

                                                                                         

   frame 19: (eval) (/usr/sbin/squeezeboxserver-scanner line 340)                                                                                                   

                                                                                         

   frame 20: main::main (/usr/sbin/squeezeboxserver-scanner line 498)                                                                                               

                                                                                         

                                                                                                                                                                   

                                                                                         

[16-10-13 16:50:09.7537] Slim::Schema::Storage::throw_exception (122) Error: Carp::Clan::__ANON__(): DBI Exception: DBD::SQLite::db prepare_cached failed: near " 

": syntax error [for Statement "SELECT me.id, me.urlmd5, me.url, me.content_type, me.title,

 me.titlesort, me.titlesearch, me.album, me.primary_artist, me.tracknum, me.timestamp, me.added_time, me.updated_time, me.filesize, me.disc, me.remote, me.audio,

me.audio_size, me.audio_offset, me.year, me.secs, me.cover, me.cover_cached, me.vbr_scale, m

e.bitrate, me.samplerate, me.samplesize, me.channels, me.block_alignment, me.endian, me.bpm, me.tagversion, me.drm, me.musicmagic_mixable, me.dlna_profile,

me.musicbrainz_id, me.lossless, me.lyrics, me.replay_gain, me.replay_peak, me.extid, me.virtual, m

e.coverid FROM tracks me WHERE ( id IN (SELECT tracks.id FROM tracks WHERE tracks.content_type IN ('ssp')  ) ) ORDER BY titlesort COLLATE  "] at

/usr/share/perl5/Slim/Schema/Storage.pm line 126                                                             

[16-10-13 16:50:09.7543] Slim::Schema::Storage::throw_exception (122) Backtrace:                                                                                   

                                                                                         

                                                                                                                                                                   

                                                                                         

   frame 0: Slim::Utils::Log::logBacktrace (/usr/share/perl5/Slim/Schema/Storage.pm line 122)                                                                       

                                                                                         

   frame 1: Slim::Schema::Storage::throw_exception (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 598)                                           

                                                                                         

   frame 2: DBIx::Class::Storage::DBI::dbh_do (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI/Cursor.pm line 140)                                         

                                                                                         

   frame 3: DBIx::Class::Storage::DBI::Cursor::all (/usr/share/squeezeboxserver/lib/DBIx/Class/ResultSet.pm line 1435)                                             

                                                                                         

   frame 4: DBIx::Class::ResultSet::all (/usr/share/perl5/Slim/Plugin/FullTextSearch/Plugin.pm line 446)                                                           

                                                                                         

   frame 5: Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (/usr/share/perl5/Slim/Plugin/FullTextSearch/Plugin.pm line 134)                                   

                                                                                         

   frame 6: Slim::Plugin::FullTextSearch::Plugin::startScan (/usr/share/perl5/Slim/Music/Import.pm line 513)                                                       

                                                                                         

   frame 7: Slim::Music::Import::runImporter (/usr/share/perl5/Slim/Music/Import.pm line 411)                                                                       

                                                                                         

   frame 8: Slim::Music::Import::runScanPostProcessing (/usr/sbin/squeezeboxserver-scanner line 340)                                                               

                                                                                         

   frame 9: (eval) (/usr/sbin/squeezeboxserver-scanner line 340)                                                                                                   

                                                                                         

   frame 10: main::main (/usr/sbin/squeezeboxserver-scanner line 498)                                                                                               

                                                                                         

                                                                                                                                                                   

                                                                                         

[16-10-13 16:50:09.7551] main::main (344) Error: Failed when running scan post-process: [Carp::Clan::__ANON__(): Carp::Clan::__ANON__(): DBI Exception:

DBD::SQLite::db prepare_cached failed: near "  ": syntax error [for Statement "SELECT me.id, me.urlmd5

, me.url, me.content_type, me.title, me.titlesort, me.titlesearch, me.album, me.primary_artist, me.tracknum, me.timestamp, me.added_time, me.updated_time,

me.filesize, me.disc, me.remote, me.audio, me.audio_size, me.audio_offset, me.year, me.secs, me.cov

er, me.cover_cached, me.vbr_scale, me.bitrate, me.samplerate, me.samplesize, me.channels, me.block_alignment, me.endian, me.bpm, me.tagversion, me.drm,

me.musicmagic_mixable, me.dlna_profile, me.musicbrainz_id, me.lossless, me.lyrics, me.replay_gain, me.

replay_peak, me.extid, me.virtual, me.coverid FROM tracks me WHERE ( id IN (SELECT tracks.id FROM tracks WHERE tracks.content_type IN ('ssp')  ) ) ORDER BY

titlesort COLLATE  "] at /usr/share/perl5/Slim/Schema/Storage.pm line 126                         

]                                                                                                                                                                   

                                                                                         

[16-10-13 16:50:09.7555] main::main (345) Error: Not updating lastRescanTime!                                                                                       

                                                                                         

[16-10-13 16:50:11.2769] Slim::Utils::SQLiteHelper::postConnect (374) Optimizing DB because of missing or empty sqlite_stat1 table                                 

                                                                                         

[16-10-13 16:50:11.5057] Slim::Schema::forceCommit (2149) Warning: Trying to commit transactions before DB is initialized!                                         

You do not have the required permissions to view the files attached to this post.
Model: QNAP TS251+ 2GB
HDD: HGST DeskStar NAS 4GB

User avatar
oyvindo
Experience counts
Posts: 1019
Joined: Tue May 19, 2009 2:08 am
Location: Norway, Oslo

Re: [HOW TO] run LMS 7.9 in a docker container

Post by oyvindo » Sat Oct 15, 2016 3:55 pm

I can see two things from the info you've provided:
1. Docker seems to try to download a new image of LMS from the repository during startup. It's unclear why. Check out this post :https://github.com/docker/docker/issues/4238
You could try the following:
a) Disable conatiner autostart with NAS reboot (it's better that you start the container yourself)
b) Delete the LMS image you've already downloaded before downloading another one. Then download the Image again and start over clean.
c) Make sure you are accessing your NAS on port 8080 from your LAN (Docker is know to have had problems when access goes through port 80)

2. Also, I notice that you've used capital M in your path (Media/Music). I believe it should have a lower case m.
Linux path are case sensitive.
NAS:
QNAP TS-453Be 16Gb
4x3TB RAID5
QTS 4.4.1
Dockerized installations of:
Madsonic, Logitech Media Server, Pi-Hole, Home-Assistant, MQTT

QNAP HS-251 2G
2x2TB RAID0
QTS 4.4.1
Kodi, Rainloop, Guacamole, L2TP

QNAP TS-119
Single Disk 1Tb
QTS 4.3.3
Used mainly as Reverse Proxy

obsession
Starting out
Posts: 17
Joined: Wed Aug 31, 2016 2:15 pm

Re: [HOW TO] run LMS 7.9 in a docker container

Post by obsession » Sat Oct 15, 2016 9:26 pm

HI,
I've removed all the docker images. Reboot. Create a new container with disabled autostart, click create, and it starts.
I'm using port 8080 to access my NAS.

Which LMS container are using that works with docker method? I can use yours as ref instead of hunting around. :)

Code: Select all

[16-10-15 09:55:45.0652] Slim::Schema::Storage::throw_exception (122) Backtrace:                                                                                         
                                                                                                                                                                         
   frame 0: Slim::Utils::Log::logBacktrace (/usr/share/perl5/Slim/Schema/Storage.pm line 122)                                                                           
   frame 1: Slim::Schema::Storage::throw_exception (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 598)                                                 
   frame 2: DBIx::Class::Storage::DBI::dbh_do (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI/Cursor.pm line 140)                                               
   frame 3: DBIx::Class::Storage::DBI::Cursor::all (/usr/share/squeezeboxserver/lib/DBIx/Class/ResultSet.pm line 1435)                                                   
   frame 4: DBIx::Class::ResultSet::all (/usr/share/perl5/Slim/Plugin/FullTextSearch/Plugin.pm line 446)                                                                 
   frame 5: Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (/usr/share/perl5/Slim/Plugin/FullTextSearch/Plugin.pm line 134)                                         
   frame 6: Slim::Plugin::FullTextSearch::Plugin::startScan (/usr/share/perl5/Slim/Music/Import.pm line 513)                                                             
   frame 7: Slim::Music::Import::runImporter (/usr/share/perl5/Slim/Music/Import.pm line 411)                                                                           
   frame 8: Slim::Music::Import::runScanPostProcessing (/usr/sbin/squeezeboxserver-scanner line 340)                                                                     
   frame 9: (eval) (/usr/sbin/squeezeboxserver-scanner line 340)                                                                                                         
   frame 10: main::main (/usr/sbin/squeezeboxserver-scanner line 498)                                                                                                   
                                                                                                                                                                         
[16-10-15 09:55:45.0659] main::main (344) Error: Failed when running scan post-process: [Carp::Clan::__ANON__(): Carp::Clan::__ANON__(): DBI Exception: DBD::SQLite::db p
repare_cached failed: near "  ": syntax error [for Statement "SELECT me.id, me.urlmd5, me.url, me.content_type, me.title, me.titlesort, me.titlesearch, me.album, me.prim
ary_artist, me.tracknum, me.timestamp, me.added_time, me.updated_time, me.filesize, me.disc, me.remote, me.audio, me.audio_size, me.audio_offset, me.year, me.secs, me.co
ver, me.cover_cached, me.vbr_scale, me.bitrate, me.samplerate, me.samplesize, me.channels, me.block_alignment, me.endian, me.bpm, me.tagversion, me.drm, me.musicmagic_mi
xable, me.dlna_profile, me.musicbrainz_id, me.lossless, me.lyrics, me.replay_gain, me.replay_peak, me.extid, me.virtual, me.coverid FROM tracks me WHERE ( id IN (SELECT
tracks.id FROM tracks WHERE tracks.content_type IN ('ssp')  ) ) ORDER BY titlesort COLLATE  "] at /usr/share/perl5/Slim/Schema/Storage.pm line 126                       
]                                                                                                                                                                       
[16-10-15 09:55:45.0663] main::main (345) Error: Not updating lastRescanTime!                                                                                           
[16-10-15 09:55:45.1737] Slim::Utils::SQLiteHelper::postConnect (374) Optimizing DB because of missing or empty sqlite_stat1 table                                       
[16-10-15 09:55:45.2528] Slim::Schema::forceCommit (2149) Warning: Trying to commit transactions before DB is initialized!                                               
[16-10-15 11:52:14.9652] Slim::Schema::Storage::throw_exception (122) Error: DBI Exception: DBD::SQLite::db prepare_cached failed: near ")": syntax error [for Statement
"                                                                                                                                                                       
                        SELECT COUNT(1) FROM ( SELECT videos.titlesearch AS 'videos.titlesearch', videos.secs AS 'videos.secs', videos.bitrate AS 'videos.bitrate', video
s.titlesort AS 'videos.titlesort', videos.width AS 'videos.width', videos.added_time AS 'videos.added_time', videos.filesize AS 'videos.filesize', videos.title AS 'video
s.title', videos.mtime AS 'videos.mtime', videos.mime_type AS 'videos.mime_type', videos.height AS 'videos.height', videos.updated_time AS 'videos.updated_time', videos.
album AS 'videos.album', videos.hash AS 'videos.hash', videos.dlna_profile AS 'videos.dlna_profile' FROM videos WHERE (1=1 and 1=1) GROUP BY videos.hash ORDER BY videos.
titlesort COLLATE    ) AS t1                                                                                                                                             
                "]                                                                                                                                                       
[16-10-15 11:52:14.9659] Slim::Schema::Storage::throw_exception (122) Backtrace:
Model: QNAP TS251+ 2GB
HDD: HGST DeskStar NAS 4GB

User avatar
oyvindo
Experience counts
Posts: 1019
Joined: Tue May 19, 2009 2:08 am
Location: Norway, Oslo

Re: [HOW TO] run LMS 7.9 in a docker container

Post by oyvindo » Sun Oct 16, 2016 1:38 am

This is the image I'm using:
Docker
larsks/logitech-media-server
latest
32c988438f86
334.61 MB
2016/04/06 20:27:29
NAS:
QNAP TS-453Be 16Gb
4x3TB RAID5
QTS 4.4.1
Dockerized installations of:
Madsonic, Logitech Media Server, Pi-Hole, Home-Assistant, MQTT

QNAP HS-251 2G
2x2TB RAID0
QTS 4.4.1
Kodi, Rainloop, Guacamole, L2TP

QNAP TS-119
Single Disk 1Tb
QTS 4.3.3
Used mainly as Reverse Proxy

obsession
Starting out
Posts: 17
Joined: Wed Aug 31, 2016 2:15 pm

Re: [HOW TO] run LMS 7.9 in a docker container

Post by obsession » Sun Oct 16, 2016 9:58 am

Finally..... I managed to get my LMS working wth some trial and error. :)
I changed the network settings to NAT instead of HOST when creating the container.

But, unfortunately my SqueezeBox Duet can't be found, it showed steady blue light.
Blue: Waiting to connect to Squeezebox Server or MySqueezebox.com
NAT.png
You do not have the required permissions to view the files attached to this post.
Model: QNAP TS251+ 2GB
HDD: HGST DeskStar NAS 4GB

User avatar
oyvindo
Experience counts
Posts: 1019
Joined: Tue May 19, 2009 2:08 am
Location: Norway, Oslo

Re: [HOW TO] run LMS 7.9 in a docker container

Post by oyvindo » Sun Oct 16, 2016 2:17 pm

What is the IP and port number you use to run the LMS Web Interface?
NAS:
QNAP TS-453Be 16Gb
4x3TB RAID5
QTS 4.4.1
Dockerized installations of:
Madsonic, Logitech Media Server, Pi-Hole, Home-Assistant, MQTT

QNAP HS-251 2G
2x2TB RAID0
QTS 4.4.1
Kodi, Rainloop, Guacamole, L2TP

QNAP TS-119
Single Disk 1Tb
QTS 4.3.3
Used mainly as Reverse Proxy

obsession
Starting out
Posts: 17
Joined: Wed Aug 31, 2016 2:15 pm

Re: [HOW TO] run LMS 7.9 in a docker container

Post by obsession » Sun Oct 16, 2016 2:21 pm

http://192.168.1.13:32778/
Screen Shot 2016-10-16 at 2.22.40 PM.png
You do not have the required permissions to view the files attached to this post.
Model: QNAP TS251+ 2GB
HDD: HGST DeskStar NAS 4GB

User avatar
oyvindo
Experience counts
Posts: 1019
Joined: Tue May 19, 2009 2:08 am
Location: Norway, Oslo

Re: [HOW TO] run LMS 7.9 in a docker container

Post by oyvindo » Sun Oct 16, 2016 2:55 pm

Well you see, that's part of the problem. Your Duet does not know how to connect on port 32778. And even if you did manage to make it connect on that port by manipulating its settings, you would have to do that every time the LMS container is run since the port number would change randomly. If you wish to run it in NAT mode than you must manually map the container to port 9000 - permanently. You can do that during container setup.
Try to connect using any one of the available smartphone apps. My favorite is Orange Squeeze (on Android).

The other thing I do not understand is why your startup command reads: docker pull larsks/logitech-media-server/entrypoint.sh
Mine only reads: /entrypoint.sh

Docker should not pull the image from the repo every time you start the container. Doing so means that all settings are lost every time the container starts (as it pulls a fresh copy)
NAS:
QNAP TS-453Be 16Gb
4x3TB RAID5
QTS 4.4.1
Dockerized installations of:
Madsonic, Logitech Media Server, Pi-Hole, Home-Assistant, MQTT

QNAP HS-251 2G
2x2TB RAID0
QTS 4.4.1
Kodi, Rainloop, Guacamole, L2TP

QNAP TS-119
Single Disk 1Tb
QTS 4.3.3
Used mainly as Reverse Proxy

obsession
Starting out
Posts: 17
Joined: Wed Aug 31, 2016 2:15 pm

Re: [HOW TO] run LMS 7.9 in a docker container

Post by obsession » Sun Oct 16, 2016 8:52 pm

Yes, u are right.
My run command should be left blank. I read the notes in the docker and someone mentioned the correct run command should be that string, so I added, sorry my bad. My networking setting should be Host instead of NAT.
Why I choose NAT is because this is the only setting where the URL link appears in my container, upon many different combinations of trial and error.

I now make sure my run command is blank. Networking set to HOST.
The URL link doesn't appear in my container. I'm confused why the URL never appear as expected.
But I'm able to see the path in my logs. 192.168.1.13:9000
I open up mynbrowser to this address. Wahla... my LMS appears. I try to connect to my squeezebox duet, also gd.
Now it is running and streaming now.
Appreciate your help u have rendered.
Thanks again. :)
Model: QNAP TS251+ 2GB
HDD: HGST DeskStar NAS 4GB

Post Reply

Return to “Container Station”