Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom MinimServer Installation Not Starting
03-09-2017, 23:47
Post: #1
Custom MinimServer Installation Not Starting
Hi Everyone,

I have been a long time MinimServer user (since version .50 I believe), and would like to first give Simon a tremendous Thank You for such a wonderful application. I began using MinimServer when I developed an interest in streaming audio, and have been "hooked" ever since. To say it has changed the way I listen to music is an understatement. It is a fundamental component of my music system, and I cannot speak highly enough about Simon's efforts.

What differentiates my system from most others in the forum is that I run MinimServer from a USB flash drive along with an operating system called unRAID. unRAID is a NAS operating system that is flashed on a memory stick and is loaded into memory on boot. As a result, software cannot be "installed" in the traditional sense as it would not be retained upon reboot.

To run applications with the current version of unRAID (v6.X) it is necessary to either (1) utilize Docker containers, or (2) run packages that are installed when the system boots (along with the OS). There is a post in this forum that references using unRAID with a MinimServeer Docker image Found Here. However, in the discussion Simon mentioned that due how a Docker image would have to download and install MinimServer (which isn't supported), this functionality is likely to stop working in the future.

Since I have been using MinimServer for several years, I have been running it differently than most. I place the minimserver folder in the appropriate location of my flash drive (to survive reboots) and make some file location adjustments based on previous versions of MinimServer. I have configured packages for glib2 and jdk to be installed when my server starts. I also have a basic start script taken from earlier versions of MinimServer which is a Java shell command. This has worked seamlessly since I began using MinimServer v.50 several years ago.

However, recently I had to upgrade my server to the current version of unRAID which is now 64bit. As a result I have had to install 64bit versions of glib2 and jdk8, but have run into an issue using the current version of MinimServer. I am a tinkerer by nature, but have not been able to find a resolution to my problem. Out of curiosity I tried using older versions of MinimServer - and have been successful up to v0.8.1 which is what I am now running. However, this version is no longer supported.

When I start my server using MinimServer v0.8.4 (Linux x64) I receive an error message in my MinimServer log file that references "ohNet port 9791 already being in use" (my log file is attached). A crash dump is also created that displays further information (also attached). My server is not configured to bind any services to port 9791, so I am not certain what is causing this error. However, the current version of MinimServer will not start or run. I know that it is not a firewall issue (e.g. MinimServer v0.8.1 runs fine as did 32bit v0.8.4), and I don't believe the configuration of my router would have any influence.

By chance, is there anything in my log files that stands out that anyone in the forum might recognize as a possible cause for my issue?

I know there were a large number of changes since the version I am currently able to use - I'm just not certain what this new problem may be.

I greatly appreciate any assistance and/or suggestions that anyone can provide that may point me in the right direction. Thank you!


Attached File(s)
.log  minimserver.log (Size: 2.33 KB / Downloads: 5)
.log  minimserver-crash-20170827-185154.log (Size: 5.67 KB / Downloads: 3)
Find all posts by this user
Quote this message in a reply
04-09-2017, 11:14
Post: #2
RE: Custom MinimServer Installation Not Starting
This error is normally caused by another running instance of MinimServer listening on port 9791. You can run the command minimserver/bin/stopall to ensure that no other processes are running. Please try doing this before you start MinimServer.

I have tried this myself just now and I am unable to provoke the failure because the second MinimServer instance chooses a different port number for listening. By looking at the code that handles the failure, I can see that there are issues with error handling that would cause the stack trace that you posted, but it is difficult to test a fix if I can't provoke the problem.

Perhaps your version of Linux is raising an error whe the second process tries to use the same port but my version (Ubuntu 17.04) doesn't raise an error in this case. In any case, this is a secondary problem as the error handing code won't run if the port conflict is removed.
Find all posts by this user
Quote this message in a reply
04-09-2017, 16:46
Post: #3
RE: Custom MinimServer Installation Not Starting
Hi Simon,

Thank you very much for your reply and assistance - I greatly appreciate it. After seeing the error message I too thought that another MinimServer instance was running. However, I later confirmed that this was not the case.

For a bit of background information: unRAID is based on Slackware Linux (currently v14.2) with a similar file/folder structure as standard Linux. However, since the OS and any custom applications are installed/loaded at boot time, I have had to change the default locations of the MinimServer directories to mirror the layout used in previous versions. I began doing this when the MinimServer folder structure changed (for ease of updating) where newer versions of MinimServer were placed within the top level "minimserver" directory. The change that I have made was to move the bin, icons, and lib directories out from the "minimserver-8.X" folder and place them in the top level "minimserver" directory (and delete the corresponding file/symbolic links using the same names). For instance my top-level minimserver directory contains the following directories and scripts:

Code:
minimserver
-bin
-data
-etc
-icons
-lib
-libext
-libsys
-opt
-tmp
License.txt
autostart.sh (start script)
stopall.sh (stop script)

Using this format takes a bit more work when newer versions of MinimServer are available, however it survives a reboot and has been working great with MinimWatch on my Windows workstation. To start MinimServer I use the following autostart.sh script within the minimserver directory, which works fine up to MinimServer v0.8.1 (Linux x64) as well as up to MinimServer v0.8.4 (Linux x86). My issue only appears with newer versions of MinimServer x64 beyond v0.8.1.

Code:
#!/bin/sh

cd /boot/custom/minimserver/data

/usr/lib64/java/jre/bin/java -jar /boot/custom/minimserver/lib/mserver.jar --noconsole --nohup </dev/null >minimserver.out 2>&1 &

exit 0

Is there a chance that my autostart.sh script may be out of date as required by to the newest versions of MinimServer? The problem I originally ran into is that the default "/bin/startd" script doesn't appear to work with the file structure that I have listed above. I have customized an older version of the startd script by hard coding the directory structure which does appear to work. However, I receive the same error message as mentioned in my initial forum post.

Does this shed any light on the error message that I am seeing? I'm not certain at what point multiple instances of MinimServer may be starting based on how I have it installed.

Thank you very much for any suggestions you can provide - your time is greatly appreciated.
Find all posts by this user
Quote this message in a reply
04-09-2017, 20:01 (This post was last modified: 04-09-2017 21:31 by simoncn.)
Post: #4
RE: Custom MinimServer Installation Not Starting
You could try the following command:

/usr/lib64/java/jre/bin/java -jar /boot/custom/minimserver/lib/mserver.jar --set watch.view=log --nohup </dev/null >minimserver-out.log 2>&1 &

This is working for me with your modified folder structure, at least to get MinimServer running.
Find all posts by this user
Quote this message in a reply
04-09-2017, 20:43 (This post was last modified: 04-09-2017 20:44 by simoncn.)
Post: #5
RE: Custom MinimServer Installation Not Starting
You mentioned Docker as another option. Here are some instructions for creating and running a MinimServer Docker image.

1) Create a folder to be used for building the Docker image

2) Download the file MinimServer-0.8.4.7-linux-intel.tar.gz from this page and save it in this folder

3) Download the file Dockerfile.bin from this link, save it in this folder and rename it to Dockerfile

4) In a terminal window, change directory to this folder and run the following commands:
docker build -t minimserver:0.8.4.7 .
docker run -p:1900:1900/udp -p:9790:9790 -p:9791:9791 --net=host minimserver:0.8.4.7

This should start MinimServer in a Docker container.
Find all posts by this user
Quote this message in a reply
04-09-2017, 22:48
Post: #6
RE: Custom MinimServer Installation Not Starting
Thank you Simon for the instructions - I will definitely try this. I have been wanting to work with Dockers and this will give me the opportunity to do so.

I did try the new command you provided and still no luck. My log file continues to reference "MinimServer: ohNet port 9791 is already in use" even though no instances are running.

I will let you know the results of trying the docker version - thank you again for all of your help.
Find all posts by this user
Quote this message in a reply
05-09-2017, 09:34 (This post was last modified: 05-09-2017 09:36 by simoncn.)
Post: #7
RE: Custom MinimServer Installation Not Starting
Can you modify your autostart script to write the output of ps -ef to a file just before running the java command? This would provide conclusive evidence of whether there is another MinimServer instance running at the time.

The other possibility is that this could be related to the automatic restart of MinimServer after installing the current update. Perhaps MinimServer already has port 9791 bound to its own process before initiating the automatic restart and is trying to do this a second time after the restart. The port is bound with SO_REUSEADDR so a second bind would normally succeed, but perhaps this doesn't work with your version of Linux.

Do you keep the contents of libext around persistently when next restarting MinimServer? If not, the automatic update and restart would be happening every time.
Find all posts by this user
Quote this message in a reply
05-09-2017, 20:50 (This post was last modified: 05-09-2017 21:13 by Jeeves.)
Post: #8
RE: Custom MinimServer Installation Not Starting
Hi Simon,

Thank you for the suggestion regarding updating my autostart script - great idea. I have done this and have attached the output to this post (ps-output.log). Unless I am mistaken, I am not seeing MinimServer running. However, the "MinimServer: ohNet port 9791 is already in use" message is still showing in the MinimServer log (both the crash dump and MinimServer log are attached).

Yes - the contents of libext are persistent on reboot. In fact, everything within the top level "minimserver" folder is persistent. I tested this with a clean install (e.g. empty libext folder) and after the startup failure I am seeing the following files populate libext:

libext
-jminim-0.7.108.jar
-minimlaunch$-0.7.101.jar
-minimreader-0.8.100.jar
-minimserver-0.8.252.jar
-minimserver-0.8-update-104.jmpkg
-minimui-0.8.222.jar
-ohnet(linux-x64)-1.10.2315.zip
-oldreader-0.8.100.jar

I did some quick research at stackoverflow.com regarding SO_REUSEADDR to learn what this was, and believe I have a general understanding. Please correct me if I am wrong, I believe this pertains to whether a restarted program's new instance will fail if there were connections open to the previous instance when it was terminated. From what I can gather, this would be a configuration that the version of Linux would have set. I can learn more about this with regard to unRAID if it would be helpful in finding a resolution.

Thank you again for taking time to look into my issue!


Attached File(s)
.log  minimserver.log (Size: 2.31 KB / Downloads: 1)
.log  minimserver-crash-20170905-153923.log (Size: 5.67 KB / Downloads: 2)
.log  ps-output.log (Size: 14.57 KB / Downloads: 1)
Find all posts by this user
Quote this message in a reply
05-09-2017, 22:00
Post: #9
RE: Custom MinimServer Installation Not Starting
What happens if you leave the contents of libext populated before booting the system? It appears that all the log files that you have posted were produced by starting from an empty libext folder because they include an auto-update to MinimServer update 104. If you are getting the auto-update when libext is populated, we should investigate why this is happening.
Find all posts by this user
Quote this message in a reply
06-09-2017, 00:44
Post: #10
RE: Custom MinimServer Installation Not Starting
Hi Simon,

You are correct - the previous log files were produced when the libext folder was empty. I just tried a full reboot of the server (libext populated) and the same error message appears in both the minimserver.log file as well as the "minimserver.out" file within the data folder (attached to my post). The same error message also appears when I attempt to run the start script from the command line with a populated libext folder.

You previously mentioned a possible issue with SO_REUSEADDR - would you suggest that I look into this further with regard to the version of Linux that unRAID uses? I can post the question in the unRAID community for further details if it would be helpful.

While I am extremely grateful for your assistance, I certainly do not want to take advantage of your generosity. Please do not hesitate letting me know if my issue is beyond the scope of how you intended on MinimServer being utilized.

Thank you again for your time.


Attached File(s)
.log  minimserver.log (Size: 2.01 KB / Downloads: 1)
.out  minimserver.out (Size: 198 bytes / Downloads: 2)
.log  minimserver-crash-20170905-191329.log (Size: 5.67 KB / Downloads: 1)
.log  ps-output.log (Size: 8.48 KB / Downloads: 0)
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)