Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't start container #18

Open
mariojjsimoes opened this issue Mar 17, 2023 · 7 comments
Open

Can't start container #18

mariojjsimoes opened this issue Mar 17, 2023 · 7 comments

Comments

@mariojjsimoes
Copy link

mariojjsimoes commented Mar 17, 2023

Hello, I'm trying to start the container using:

docker run -d \
  --init \
  --net=host \
  --restart=always \
  --name ums \
  -e FOLDER="" \
  -e FORCE_CHOWN="true" \
  -e NETWORK_INTERFACE="" \
  -e LOG_LEVEL="" \
  -e PORT=5001 \
  -e SET_MEDIA_PERMISSIONS="true" \
  -v /media/hdd/ums/UMS.conf:/opt/ums/UMS.conf \
  -v /media/hdd/ums/UMS.cred:/opt/ums/UMS.cred \
  -v /media/hdd/ums/data:/opt/ums/data \
  -v /media/hdd/ums/database:/opt/ums/database \
  -v /media/hdd/600g:/media \
  mbentley/ums

However the container fails to start with the following error:

INFO  01:08:02.518 [entrypoint] FORCE_CHOWN=true; setting ownership on '/opt/ums/UMS.conf' to (500:500)
INFO  01:08:02.535 [entrypoint] FORCE_CHOWN=true; setting ownership on '/opt/ums/UMS.cred' to (500:500)
INFO  01:08:02.547 [entrypoint] FORCE_CHOWN=true; setting ownership on '/opt/ums/data' to (500:500)
INFO  01:08:02.560 [entrypoint] FORCE_CHOWN=true; setting ownership on '/opt/ums/database' to (500:500)
INFO  01:08:02.568 [entrypoint] Removing old FIFOs (if they exist)
INFO  01:08:02.572 [entrypoint] Adding '/opt/ums/linux' to the PATH
INFO  01:08:02.575 [entrypoint] Launching command '/opt/ums/UMS.sh' as user ums
Exception in thread "main" java.lang.ExceptionInInitializerError
	at net.pms.util.FilePermissions.checkPermissions(FilePermissions.java:208)
	at net.pms.util.FilePermissions.getFlags(FilePermissions.java:384)
	at net.pms.util.FileUtil.findInOSPath(FileUtil.java:2358)
	at net.pms.util.FileUtil.findExecutableInOSPath(FileUtil.java:2281)
	at net.pms.platform.linux.LinuxProgramPaths.<init>(LinuxProgramPaths.java:53)
	at net.pms.platform.PlatformProgramPaths.<clinit>(PlatformProgramPaths.java:202)
	at net.pms.configuration.UmsConfiguration.<init>(UmsConfiguration.java:745)
	at net.pms.configuration.UmsConfiguration.<init>(UmsConfiguration.java:696)
	at net.pms.PMS.main(PMS.java:955)
Caused by: com.vdurmont.semver4j.SemverException: The build cannot be empty.
	at com.vdurmont.semver4j.Semver.<init>(Semver.java:100)
	at com.vdurmont.semver4j.Semver.<init>(Semver.java:20)
	at net.pms.platform.PlatformUtils.createOsVersion(PlatformUtils.java:369)
	at net.pms.platform.PlatformUtils.<clinit>(PlatformUtils.java:68)
	... 9 more
INFO  01:08:04.548 [entrypoint] Setting UMS setting 'port' to '5001'
sed: can't move '/opt/ums/UMS.confLhFLNf' to '/opt/ums/UMS.conf': Resource busy

I can see that the UMS.conf and UMS.cred are created (I did not put them there):

drwxrwxrwx 8 root          root           4096 Mar 17 01:05 ..
drwxr-xr-x 2           500           500  4096 Mar 17 00:59 data
drwxr-xr-x 2           500           500  4096 Mar 17 00:59 database
-rw-r--r-- 1           500           500 64741 Mar 17 01:01 UMS.conf
drwxr-xr-x 2           500           500  4096 Mar 17 01:02 UMS.cred

Att a loss at why so any help would be greatly appreciated!

@mbentley
Copy link
Owner

Due to how UMS writes to the config file, you can't directly bind mount the UMS.conf file as it re-writes the file as a part of the startup. I never did remove the examples where it bind mounts the files directly. Use something similar to the first example where it uses the parent directory.

@mariojjsimoes
Copy link
Author

Unfortunately it did not work.
Tried:

docker run -d \
  --init \
  --net=host \
  --restart=always \
  --name ums \
  -e FOLDER="/media" \
  -e FORCE_CHOWN="false" \
  -e NETWORK_INTERFACE="" \
  -e LOG_LEVEL="" \
  -e PORT=5001 \
  -e SET_MEDIA_PERMISSIONS="false" \
  -v ums-data:/opt/ums/data \
  -v ums-database:/opt/ums/database \
  -v /media/600gb:/media \
  mbentley/ums

But unfortunately have the same:

INFO  23:42:10.735 [entrypoint] Setting UMS setting 'port' to '5001'
INFO  23:42:10.760 [entrypoint] FORCE_CHOWN=true; setting ownership on '/opt/ums/UMS.conf' to (500:500)
INFO  23:42:10.787 [entrypoint] FORCE_CHOWN=true; setting ownership on '/opt/ums/data' to (500:500)
INFO  23:42:10.800 [entrypoint] FORCE_CHOWN=true; setting ownership on '/opt/ums/database' to (500:500)
INFO  23:42:10.810 [entrypoint] Removing old FIFOs (if they exist)
INFO  23:42:10.817 [entrypoint] Adding '/opt/ums/linux' to the PATH
INFO  23:42:10.822 [entrypoint] Launching command '/opt/ums/UMS.sh' as user ums
Exception in thread "main" java.lang.ExceptionInInitializerError
	at net.pms.util.FilePermissions.checkPermissions(FilePermissions.java:208)
	at net.pms.util.FilePermissions.getFlags(FilePermissions.java:384)
	at net.pms.util.FileUtil.findInOSPath(FileUtil.java:2358)
	at net.pms.util.FileUtil.findExecutableInOSPath(FileUtil.java:2281)
	at net.pms.platform.linux.LinuxProgramPaths.<init>(LinuxProgramPaths.java:53)
	at net.pms.platform.PlatformProgramPaths.<clinit>(PlatformProgramPaths.java:202)
	at net.pms.configuration.UmsConfiguration.<init>(UmsConfiguration.java:745)
	at net.pms.configuration.UmsConfiguration.<init>(UmsConfiguration.java:696)
	at net.pms.PMS.main(PMS.java:955)
Caused by: com.vdurmont.semver4j.SemverException: The build cannot be empty.
	at com.vdurmont.semver4j.Semver.<init>(Semver.java:100)
	at com.vdurmont.semver4j.Semver.<init>(Semver.java:20)
	at net.pms.platform.PlatformUtils.createOsVersion(PlatformUtils.java:369)
	at net.pms.platform.PlatformUtils.<clinit>(PlatformUtils.java:68)
	... 9 more

:-(

Would be gratefull for any suggestions...

@mariojjsimoes
Copy link
Author

Tried a whole lot of things, including:
docker run -d
--init
--net=host
--restart=always
--name ums
-e FOLDER=""
-e FORCE_CHOWN="false"
-e NETWORK_INTERFACE=""
-e LOG_LEVEL=""
-e PORT=5001
-e SET_MEDIA_PERMISSIONS="false"
-v /media/hdd/600gb:/media
mbentley/ums

Event tried not specifying any volumes... still the same....

Always run into the same error... again, will be gratefull for whatever recommendations..

@mbentley
Copy link
Owner

mbentley commented Mar 18, 2023

Do this:

docker run -d \
  --init \
  --net=host \
  --restart=always \
  --name ums \
  -e FOLDER="" \
  -e FORCE_CHOWN="true" \
  -e NETWORK_INTERFACE="" \
  -e LOG_LEVEL="" \
  -e PORT=5001 \
  -e SET_MEDIA_PERMISSIONS="true" \
  -v /media/hdd/ums/opt/ums \
  -v /media/hdd/600g:/media \
  mbentley/ums

@mariojjsimoes
Copy link
Author

mariojjsimoes commented Mar 18, 2023

Thanks, I tried it, different problem now. So i did as you said (small correction one of the -v lines where I added a colon):

docker run -d \
  --init \
  --net=host \
  --restart=always \
  --name ums \
  -e FOLDER="" \
  -e FORCE_CHOWN="true" \
  -e NETWORK_INTERFACE="" \
  -e LOG_LEVEL="" \
  -e PORT=5001 \
  -e SET_MEDIA_PERMISSIONS="true" \
  -v /media/hdd/ums:/opt/ums \
  -v /media/hdd/600g:/media \
  mbentley/ums

However it now fails differently:

INFO  23:44:19.239 [entrypoint] Setting UMS setting 'port' to '5001'
sed: /opt/ums/UMS.conf: No such file or directory
INFO  23:44:19.249 [entrypoint] FORCE_CHOWN=true; setting ownership on '/opt/ums/data' to (500:500)
INFO  23:44:19.274 [entrypoint] FORCE_CHOWN=true; setting ownership on '/opt/ums/database' to (500:500)
INFO  23:44:19.291 [entrypoint] Removing old FIFOs (if they exist)
INFO  23:44:19.295 [entrypoint] Adding '/opt/ums/linux' to the PATH
INFO  23:44:19.298 [entrypoint] Launching command '/opt/ums/UMS.sh' as user ums
ash: /opt/ums/UMS.sh: not found

If I'm getting it right it can't find the script since /opt/ums has been mounted on /media/hdd/ums which is empty...

Any other idea on what I could try?

Thanks!
Mario

@mbentley
Copy link
Owner

Ah shoot. I'll have to see if there is some other way it get it working. Sorry, I haven't ran UMS in about a year so I am having to re-learn exactly how the container operators with the software. Let me try a few things and get back to you.

@mbentley
Copy link
Owner

mbentley commented Mar 19, 2023

Since you're bind mounting a config, let's go back to your original run command and just try to remove the following lines from your run command as they're just for manipulating the config file which you shouldn't need to do since you're passing in a UMS.conf file:

  -e FOLDER="" \
  -e NETWORK_INTERFACE="" \
  -e LOG_LEVEL="" \
  -e PORT=5001 \

So it would be this:

docker run -d \
  --init \
  --net=host \
  --restart=always \
  --name ums \
  -e FORCE_CHOWN="true" \
  -e SET_MEDIA_PERMISSIONS="true" \
  -v /media/hdd/ums/UMS.conf:/opt/ums/UMS.conf \
  -v /media/hdd/ums/UMS.cred:/opt/ums/UMS.cred \
  -v /media/hdd/ums/data:/opt/ums/data \
  -v /media/hdd/ums/database:/opt/ums/database \
  -v /media/hdd/600g:/media \
  mbentley/ums

That will at least stop the sed error.

Now I may need to see your UMS.conf as I am wondering if there is something in your config that is causing the startup error as I am not really sure why that specific error you're seeing would happen - it's nothing I am familiar with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants