PlusMinus0 / headless-jd2-docker

Headless JDownloader 2 Docker Container
31 stars 38 forks source link

GID and UID not set #10

Closed Skaronator closed 6 years ago

Skaronator commented 6 years ago

Hi,

I'm using a volume for the JDownloader config and tried to set UID and GID for it but it still creates the config files for root:root as you can see here:

image

Also the JDownloader is unable to start when I set the UID and GID due to missing permissions for the JDownloader files. Here the log:

Update Message: Check for updates
Update Progress: 3%
Update Progress: -1%
Update Message: Contact Server...
Update Message: Check for updates
Update Message: New JDownloader Version found...
Update Progress: 5%
Update Message: Prepare Update package...
Update Progress: -1%
Update Progress: 5%
Update Message: Prepare Update package...
Update Message: Download Updates...
Update Progress: 10.225%
Update Message: Download Updates...
Try to replace: client
Try to replace: selfUpdateClient

Error Log:

42|GlobalIOErrors.log 11/14/17 2:28:03 PM - SEVERE [ org.jdownloader.update.launcher.SecondLevelLauncher$1(onWriteException) ] -> An error occured while writing 19 bytes to /opt/JDownloader/update/versioninfo/JD/org.appwork.updatesys.client.tracker.TrackConfig.json.tmp
org.appwork.storage.StorageException: Can not write to /opt/JDownloader/update/versioninfo/JD/org.appwork.updatesys.client.tracker.TrackConfig.json.tmp
    at org.appwork.storage.JSonStorage.saveTo(JSonStorage.java:515)
    at org.appwork.storage.JsonKeyValueStorage$1.run(JsonKeyValueStorage.java:537)
    at org.appwork.storage.config.handler.StorageHandler.enqueueWrite(StorageHandler.java:227)
    at org.appwork.storage.JsonKeyValueStorage.save(JsonKeyValueStorage.java:540)
    at org.appwork.storage.config.handler.StorageHandler.saveAll(StorageHandler.java:256)
    at org.appwork.storage.config.handler.StorageHandler$3.onShutdown(StorageHandler.java:137)
    at org.appwork.shutdown.ShutdownController$4.run(ShutdownController.java:462)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.io.File.createNewFile(File.java:1012)
    at org.appwork.utils.IO.writeToFile(IO.java:724)
    at org.appwork.utils.IO.writeToFile(IO.java:712)
    at org.appwork.storage.JSonStorage.saveTo(JSonStorage.java:501)
    ... 7 more

Permission denied

sno0k commented 6 years ago

Got the same issue, when I set the UID and GID enviroment variables. If I didn't set these two variables, the container is working fine under root:root and shows up in myjdownloader account.

Error Log:


 1/12/18 11:24:28 AM - SEVERE [ GlobalIOErrors.log ] -> java.io.IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.io.File.createNewFile(File.java:1012)
    at org.appwork.utils.IO.writeStringToFile(IO.java:649)
    at org.appwork.utils.IO.writeStringToFile(IO.java:634)
    at org.jdownloader.update.SelfUpdateClient.internalWriteRevision(SelfUpdateClient.java:356)
    at org.appwork.updatesys.client.UpdateClient.runUpdateCheck(UpdateClient.java:2857)
    at org.jdownloader.update.SelfUpdateClient.runUpdateCheck(SelfUpdateClient.java:158)
    at org.jdownloader.update.UpdateManager.runUpdateLoop(UpdateManager.java:1046)
    at org.jdownloader.update.PendingUpdate.run(PendingUpdate.java:19)
    at org.jdownloader.update.UpdateManager$17.run(UpdateManager.java:1680)
    at java.lang.Thread.run(Thread.java:748)

16|GlobalIOErrors.log 1/12/18 11:24:28 AM - SEVERE [ org.jdownloader.update.launcher.SecondLevelLauncher$1(onWriteException) ] -> An error occured while writing 5 bytes to /opt/JDownloader/tmp/update/self/JDU/self_11151_to_11157.log
java.nio.file.NoSuchFileException: /opt/JDownloader/logs/1515756267928_Fri, Jan 12, 2018 11.24 +0000/GlobalIOErrors.log.0.lck
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:177)
    at java.nio.channels.FileChannel.open(FileChannel.java:287)
    at java.nio.channels.FileChannel.open(FileChannel.java:335)
    at java.util.logging.FileHandler.openFiles(FileHandler.java:459)
    at java.util.logging.FileHandler.<init>(FileHandler.java:402)
    at org.appwork.utils.logging2.LogSinkFileHandler$1.<init>(LogSinkFileHandler.java:89)
    at org.appwork.utils.logging2.LogSinkFileHandler.publish(LogSinkFileHandler.java:89)
    at org.appwork.utils.logging2.LogSource.flush(LogSource.java:192)
    at org.appwork.utils.logging2.LogSource.close(LogSource.java:153)
    at org.jdownloader.update.launcher.SecondLevelLauncher$1.onWriteException(SecondLevelLauncher.java:123)
    at org.appwork.utils.IO.writeStringToFile(IO.java:695)
    at org.appwork.utils.IO.writeStringToFile(IO.java:634)
    at org.jdownloader.update.SelfUpdateClient.internalWriteRevision(SelfUpdateClient.java:356)
    at org.appwork.updatesys.client.UpdateClient.runUpdateCheck(UpdateClient.java:2857)
    at org.jdownloader.update.SelfUpdateClient.runUpdateCheck(SelfUpdateClient.java:158)
    at org.jdownloader.update.UpdateManager.runUpdateLoop(UpdateManager.java:1046)
    at org.jdownloader.update.PendingUpdate.run(PendingUpdate.java:19)
    at org.jdownloader.update.UpdateManager$17.run(UpdateManager.java:1680)
    at java.lang.Thread.run(Thread.java:748)
16|Log.L.log 1/12/18 11:24:28 AM - FINER [ org.appwork.storage.config.handler.ListHandler(readObject) ] -> Read Config(File): /opt/JDownloader/update/versioninfo/JDU/org.appwork.updatesys.client.tracker.TrackConfig.tracklog.json
16|org.jdownloader.update.UpdateManager.log 1/12/18 11:24:28 AM - SEVERE [ org.jdownloader.update.UpdateManager.log ] -> org.appwork.utils.ExtIOException: java.io.IOException: Permission denied
    at org.appwork.utils.ExtIOException.getInstance(ExtIOException.java:30)
    at org.jdownloader.update.SelfUpdateClient.internalWriteRevision(SelfUpdateClient.java:358)
    at org.appwork.updatesys.client.UpdateClient.runUpdateCheck(UpdateClient.java:2857)
    at org.jdownloader.update.SelfUpdateClient.runUpdateCheck(SelfUpdateClient.java:158)
    at org.jdownloader.update.UpdateManager.runUpdateLoop(UpdateManager.java:1046)
    at org.jdownloader.update.PendingUpdate.run(PendingUpdate.java:19)
    at org.jdownloader.update.UpdateManager$17.run(UpdateManager.java:1680)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.io.File.createNewFile(File.java:1012)
    at org.appwork.utils.IO.writeStringToFile(IO.java:649)
    at org.appwork.utils.IO.writeStringToFile(IO.java:634)
    at org.jdownloader.update.SelfUpdateClient.internalWriteRevision(SelfUpdateClient.java:356)
    ... 6 more
Skaronator commented 6 years ago

I'm now using this Docker Image: https://hub.docker.com/r/dbarton/jdownloader/ Works fine with GID and UID.

mr-bolle commented 6 years ago

Hi,

i create a fork from the Dockerfile and startJD2.sh, there i add a new User 'jdownloader' into the container.

With the GID and UID docker run -d --name jd2-test --user $UID plusminus/jdownloader2-headless i don't have any success.

useradd: cannot lock /etc/passwd; try again later. chown: invalid user: ‘jdownloader:root’

Skaronator commented 6 years ago

The user must be a user of the host system AFAIK.

mr-bolle commented 6 years ago

@Skaronator into the Dockerfile you can see, that he created also a new user and group into the container.

PlusMinus0 commented 6 years ago

I'm sorry, I don't know if and how this works with a windows host. UID and GID are pretty unix specific afaik.