"Permission denied" Problem

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
Post Reply
ziemowit
Posts: 32
Joined: 13 Feb 2015, 06:59

"Permission denied" Problem

Post by ziemowit »

Hi

I'm getting this

Code: Select all

...
Auto-detected query: [***]
CacheException: java.io.IOException: Permission denied
Finished without processing any files
Failure (°_°)

Code: Select all

Synology> filebot -script fn:sysinfo
FileBot 4.5.6 (r2818)
JNA Native: 4.0.0
MediaInfo: java.lang.UnsatisfiedLinkError: Unable to load library 'mediainfo': Native library (linux-x86/libmediainfo.so) not found in resource path ([file:/volume1/@appstore/filebot/FileBot.jar])
7-Zip-JBinding: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Failed to load 7z-JBinding: no 7-Zip-JBinding in java.library.path
chromaprint-tools: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Extended Attributes: OK
Groovy Engine: 2.3.9
JRE: Java(TM) SE Embedded Runtime Environment 1.8.0_33 (headless)
JVM: 32-bit Java HotSpot(TM) Embedded Client VM
CPU/MEM: 4 Core / 239 MB Max Memory / 12 MB Used Memory
OS: Linux (i386)
uname: Linux Synology 3.2.40 #5022 SMP Wed Jan 7 14:18:56 CST 2015 x86_64 GNU/Linux synology_x86_1010+
Done ヾ(@⌒ー⌒@)ノ
What could be wrong?
skullzy
Power User
Posts: 50
Joined: 07 Jan 2015, 22:19

Re: "Permission denied" Problem

Post by skullzy »

Based on

Code: Select all

MediaInfo: java.lang.UnsatisfiedLinkError: Unable to load library 'mediainfo': Native library (linux-x86/libmediainfo.so) not found in resource path ([file:/volume1/@appstore/filebot/FileBot.jar])
7-Zip-JBinding: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Failed to load 7z-JBinding: no 7-Zip-JBinding in java.library.path
chromaprint-tools: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
This is just an assumption.. but it looks (to me), that you've not installed filebot properly.. Installing FileBot on Synology NAS

As for the

Code: Select all

CacheException: java.io.IOException: Permission denied
This could mean the path you are giving is absolute, because it's starting from /. For your path to be relative you would need to remove / from the beginning of the path.

If neither is the issue, it would then be a great help to myself and others if you submitted your script..
ziemowit
Posts: 32
Joined: 13 Feb 2015, 06:59

Re: "Permission denied" Problem

Post by ziemowit »

Code: Select all

#!/opt/bin/bash
filebot -script fn:amc --output "/volume1/video" --log-file /volume1/software/Synology/transmission/amc.log --action duplicate --conflict override -non-strict --def music=y artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME" --lang de --def excludeList=/volume1/software/Synology/transmission/amc.txt --def "seriesFormat=/Serien/{n}/{sxe} {t}" "movieFormat=/Filme/{n} ({y})" 
If i run filebot manually using a very simple rename-script from CLI eveything works fine.

Filebot installed from original source using synology's package manager

You are refering to a path, path of what exactly?

EDIT: I'm using this as run-on-complete script in transmission.
skullzy
Power User
Posts: 50
Joined: 07 Jan 2015, 22:19

Re: "Permission denied" Problem

Post by skullzy »

Code: Select all

#!/opt/bin/bash
filebot -script fn:amc --output "/volume1/video" --log-file /volume1/software/Synology/transmission/amc.log --action duplicate --conflict override -non-strict --def music=y artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME" --lang de --def excludeList=/volume1/software/Synology/transmission/amc.txt --def "seriesFormat=/Serien/{n}/{sxe} {t}" "movieFormat=/Filme/{n} ({y})"
This is just a guess.. but more than likely the issue is with /volume1/software/Synology/transmission/amc.txt, try "excludeList=volume1/software/Synology/transmission/amc.txt".

At this point it's process of elimination. From what I understand, (/) at the beginning of a path can cause the permission denied error. So since the script is trying to read the amc.txt, I would assume that would be the issue.

If that doesn't resolve it then simply remove (/) from the beginning of all paths so that /volume1/path, /Filme/path becomes volume1/path, Filme/path and so one.
ziemowit
Posts: 32
Joined: 13 Feb 2015, 06:59

Re: "Permission denied" Problem

Post by ziemowit »

Ok, I will try this now, but the scriptis putting lines into this amc.txt file. I will empty it and give it a try anyway.

EDIT: Result after changing the path for the amc.txt:

Code: Select all

FileNotFoundException:/volume1/video/volume1/software/Synology/transmission/amc.txt (No such file or directory)
java.io.FileNotFoundException: /volume1/video/volume1/software/Synology/transmission/amc.txt (No such file or directory)
	at Script1.run(Script1.groovy:208)
	at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:61)
	at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:82)
	at net.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:112)
	at net.filebot.Main.main(Main.java:169)
Failure (°_°)
EDIT: Result after changing all the paths:

Code: Select all

FileNotFoundException: /volume1/@appstore/transmission/var/volume1/video/volume1/software/Synology/transmission/amc.txt (No such file or directory)
java.io.FileNotFoundException: /volume1/@appstore/transmission/var/volume1/video/volume1/software/Synology/transmission/amc.txt (No such file or directory)
	at Script1.run(Script1.groovy:208)
	at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:61)
	at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:82)
	at net.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:112)
	at net.filebot.Main.main(Main.java:169)
Failure (°_°)
skullzy
Power User
Posts: 50
Joined: 07 Jan 2015, 22:19

Re: "Permission denied" Problem

Post by skullzy »

Edit
EDIT: Result after changing all the paths:
Fix Amc.txt path, redo results, fix output path, redo results...
ziemowit wrote:Ok, I will try this now, but the scriptis putting lines into this amc.txt file. I will empty it and give it a try anyway.
If it's able to write to that file, then that wouldn't be the problem.. as we already know it can't access something.. so it would automatically rule that out..

In the rename script, which you know works.. are the following pieces of code the same in both scripts?
--output "/volume1/video"
--log-file /volume1/software/Synology/transmission/amc.log
"seriesFormat=/Serien/{n}/{sxe} {t}"
"movieFormat=/Filme/{n} ({y})"


Also, as a thought.. find the value of $TR_TORRENT_DIR/$TR_TORRENT_NAME.. just so we know how it would be appearing in the script..

The only other way, would be that you need to set permissions, but you said you were able to use a simple rename script via CLI.. so to me the issue has to be within the this current script, and the only thing I know to cause that error, especially with java is (/) at the beginning of a path.. hence why we need to rule it out.

But then again, looking at your error

Code: Select all

/volume1/video/volume1/software/Synology/transmission/amc.txt
the (/) appears to be a requirement in order to reach the correct path.. as simply adding (/) would instead return

Code: Select all

/volume1/software/Synology/transmission/amc.txt
So maybe removing (/) from the beginning of seriesFormat and movieFormat path might resolve the issue.

Essentially what you need to do is rule out all possibilities. If the issue isn't (/) at the beginning of one of your paths then other than not having the right permissions set, I'm not entirely sure what it could be.

But one thing is clear from your original log

Code: Select all

MediaInfo: java.lang.UnsatisfiedLinkError: Unable to load library 'mediainfo': Native library (linux-x86/libmediainfo.so) not found in resource path ([file:/volume1/@appstore/filebot/FileBot.jar])
7-Zip-JBinding: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Failed to load 7z-JBinding: no 7-Zip-JBinding in java.library.path
chromaprint-tools: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Media info and 7-zip appear to be missing.. so you might want to consider resolving that as well.
ziemowit
Posts: 32
Joined: 13 Feb 2015, 06:59

Re: "Permission denied" Problem

Post by ziemowit »

skullzy wrote:
In the rename script, which you know works.. are the following pieces of code the same in both scripts?
--output "/volume1/video"
--log-file /volume1/software/Synology/transmission/amc.log
"seriesFormat=/Serien/{n}/{sxe} {t}"
"movieFormat=/Filme/{n} ({y})"


Also, as a thought.. find the value of $TR_TORRENT_DIR/$TR_TORRENT_NAME.. just so we know how it would be appearing in the script.
those only appear due to the amc-scripts being used, manually i put it in a different way and it works fine.

Code: Select all

filebot -rename *.* --log-file /volume1/software/Synology/transmission/amc.log --conflict override -non-strict --def --lang de --def --format "/volume1/video/Serien/{n}/{s.pad(2)}x{e.pad(2)} {t}"
The torrent-commands you are referring to, must be some kind of links to transmission to run the script on the correct file as i understand it. No idea how to find it right now. Any advice?


The only other way, would be that you need to set permissions, but you said you were able to use a simple rename script via CLI.. so to me the issue has to be within the this current script, and the only thing I know to cause that error, especially with java is (/) at the beginning of a path.. hence why we need to rule it out.

But then again, looking at your error

Code: Select all

/volume1/video/volume1/software/Synology/transmission/amc.txt
the (/) appears to be a requirement in order to reach the correct path.. as simply adding (/) would instead return

Code: Select all

/volume1/software/Synology/transmission/amc.txt
So maybe removing (/) from the beginning of seriesFormat and movieFormat path might resolve the issue.

Essentially what you need to do is rule out all possibilities. If the issue isn't (/) at the beginning of one of your paths then other than not having the right permissions set, I'm not entirely sure what it could be.
Well, I favorise the persmission theory, because when i run the script manually i am logged in as root. I came across some permission issues before with some temp-files and was able to solve them by chmod 777 for that files so then the next permission issue would pop up. So with this, hopefully last issue, my thought was that the user transmission will not have the correct rights for the path used in the script. I didnt want to chmod those whole paths though. I am qite new to linux, read some stuff here'n'there and tried to give admin rights to transmission this way in /etc/groups

Code: Select all

admin:x:65537:admin
administrators:x:101:admin,transmission
dovecot:x:143:dovecot
ftp:x:21:ftp
group:x:65538:admin
http:x:1023:admin
lp:x:7:lp
maildrop:x:126:
mysql:x:66:
nobody:x:99:
postfix:x:125:postfix
postgres:x:55:
root:x:0:
smmsp:x:25:admin,smmsp
users:x:100:transmission
Added transmission to administrators.
But one thing is clear from your original log

Code: Select all

MediaInfo: java.lang.UnsatisfiedLinkError: Unable to load library 'mediainfo': Native library (linux-x86/libmediainfo.so) not found in resource path ([file:/volume1/@appstore/filebot/FileBot.jar])
7-Zip-JBinding: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Failed to load 7z-JBinding: no 7-Zip-JBinding in java.library.path
chromaprint-tools: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Media info and 7-zip appear to be missing.. so you might want to consider resolving that as well.
I will try to solve htis in the mean time.

EDIT:
I've tried this manually, successfully. Just renamed the file and did not move it to a different path.

Code: Select all

filebot -rename *** --log-file /volume1/software/Synology/transmission/amc.log --conflict override -non-strict --def --lang de --def --format "/volume1/downloads/{s.pad(2)}x{e.pad(2)} {t}"
Put it into the script and used $TR_TORRENT_NAME instead of the filename, gave me:

Code: Select all

Filename pattern: [1.00] SxE, [0.00] CWS
Rename episodes using [TheTVDB]
Auto-detected query: [***]
IOException: Permission denied
java.io.IOException: Permission denied
	at net.sf.ehcache.DiskStorePathManager$DiskStorePath.<init>(DiskStorePathManager.java:322)
	at net.sf.ehcache.DiskStorePathManager.resolveAndLockIfNeeded(DiskStorePathManager.java:145)
	at net.sf.ehcache.DiskStorePathManager.getFile(DiskStorePathManager.java:262)
	at net.sf.ehcache.DiskStorePathManager.getFile(DiskStorePathManager.java:251)
	at net.sf.ehcache.store.disk.DiskStorageFactory.<init>(DiskStorageFactory.java:123)
	at net.sf.ehcache.store.disk.DiskStore.create(DiskStore.java:154)
	at net.sf.ehcache.store.disk.DiskStore.createCacheStore(DiskStore.java:182)
	at net.sf.ehcache.Cache.initialise(Cache.java:1153)
	at net.sf.ehcache.CacheManager.initializeEhcache(CacheManager.java:1332)
	at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1398)
	at net.sf.ehcache.CacheManager.addConfiguredCaches(CacheManager.java:794)
	at net.sf.ehcache.CacheManager.doInit(CacheManager.java:492)
	at net.sf.ehcache.CacheManager.init(CacheManager.java:387)
	at net.sf.ehcache.CacheManager.<init>(CacheManager.java:263)
	at net.sf.ehcache.CacheManager.newInstance(CacheManager.java:1078)
	at net.sf.ehcache.CacheManager.newInstance(CacheManager.java:854)
	at net.sf.ehcache.CacheManager.create(CacheManager.java:835)
	at net.sf.ehcache.CacheManager.getInstance(CacheManager.java:869)
	at net.filebot.Cache.getCache(Cache.java:14)
	at net.filebot.web.TheTVDBClient.getCache(TheTVDBClient.java:79)
	at net.filebot.web.AbstractEpisodeListProvider.search(AbstractEpisodeListProvider.java:30)
	at net.filebot.cli.CmdlineOperations.fetchEpisodeSet(CmdlineOperations.java:284)
	at net.filebot.cli.CmdlineOperations.renameSeries(CmdlineOperations.java:203)
	at net.filebot.cli.CmdlineOperations.rename(CmdlineOperations.java:142)
	at net.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:75)
	at net.filebot.Main.main(Main.java:169)
Failure (°_°)
skullzy
Power User
Posts: 50
Joined: 07 Jan 2015, 22:19

Re: "Permission denied" Problem

Post by skullzy »

Okay, so the issue is.. that you can manually enter the filename and make it work, but when you attempt to use the script with transmission it fails to get permission.

Create a simple bash script with something like

Code: Select all

echo "Torrent Name $TR_TORRENT_NAME"
echo "Torrent Dir $TR_TORRENT_DIR"
So that when you run it via transmission, it should produce the value of those variables.. paste the results here.. if it doesn't work, as in shows it as empty.. then you'll need to check the permissions for transmission..
ziemowit
Posts: 32
Joined: 13 Feb 2015, 06:59

Re: "Permission denied" Problem

Post by ziemowit »

OK, it gives the proper filename and path.

Code: Select all

Torrent Name ***.mp4
Torrent Dir /volume1/downloads
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: "Permission denied" Problem

Post by rednoah »

This means that FileBot cannot access it's own folder to store settings, cache and temporary files:

Code: Select all

IOException: Permission denied
java.io.IOException: Permission denied
   at net.sf.ehcache.DiskStorePathManager$DiskStorePath.<init>(DiskStorePathManager.java:322)
The application data directory is defined in the filebot.sh launcher script. Have you tried installing/uninstalling via DSM? Maybe a Synology update messed with the permissions for /appstore/filebot/data folder when migrating apps or something. See filebot.sh for details how things are configured.
:idea: Please read the FAQ and How to Request Help.
ziemowit
Posts: 32
Joined: 13 Feb 2015, 06:59

Re: "Permission denied" Problem

Post by ziemowit »

Thanks for the additional input. It has been a clean install so far.

Code: Select all

...
# make it fully qualified
WORKING_DIR=`pwd`
PRG_DIR=`dirname "$PRG"`
APP_ROOT=`cd "$PRG_DIR" && pwd`
APP_DATA="$APP_ROOT/data"
...
thats the standard i guess. The folder is owned by admin, do i need to change this, and if yes, who should be the new owner? for now i set the whole folder to being chmod 777. Gave me
...
Auto-detected query: [***]
Fetching episode data for [***]
[DUPLICATE] Rename [/volume1/downloads/***.mp4] to [/Serien/***/8x04 ***.mp4]
[DUPLICATE] Failed to rename [/volume1/downloads/***.mp4]
IOException: Failed to create folder: /Serien/***
Finished without processing any files
Failure (°_°)
The path looks wrong, or is it only the way its put in the log?

With this script

Code: Select all

#!/opt/bin/bash
filebot -script fn:amc --output "/volume1/video" --log-file /volume1/software/Synology/transmission/amc.log --action duplicate --conflict override -non-strict --def "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME" --def --lang de --def excludeList=/volume1/software/Synology/transmission/amc.txt --def pushover=*** --def "seriesFormat=/Serien/{n}/{sxe} {t}" "movieFormat=/Filme/{n} ({y})" 
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: "Permission denied" Problem

Post by rednoah »

Of course you can't create a folder /Series in the filesystem root...

Why are you specifying an absolute path in the format? Absolute path in the format will overrule your --output location. Drop the leading / in the format.
:idea: Please read the FAQ and How to Request Help.
ziemowit
Posts: 32
Joined: 13 Feb 2015, 06:59

Re: "Permission denied" Problem

Post by ziemowit »

Code: Select all

Done ヾ(@⌒ー⌒@)ノ
Omg... Awesome!

Does the leading / always imply it's an absolute path in unix/Linux files systems?

Few more questions:
Using --def unsorted=y, where will those files be moved?
Using the amc script will it unpack rar files prior to moving them or do I need to add anything to the script?
ziemowit
Posts: 32
Joined: 13 Feb 2015, 06:59

Re: "Permission denied" Problem

Post by ziemowit »

Ok. Seems like I'm getting

Code: Select all

SevenZipNativeInitializationException: Failed to load 7z-JBinding: no 7-Zip-JBinding in java.library.path
I thought I had this resolved already. Where do I put the files or how do I set the paths?
ziemowit
Posts: 32
Joined: 13 Feb 2015, 06:59

Re: "Permission denied" Problem

Post by ziemowit »

Seems like i somehow set the path before. i tried this

Code: Select all

Synology> $LD_LIBRARY_PATH
-ash: /volume1/@appstore/filebot/libraries/: Permission denied
put the files in that path, and sysinfo gave me

Code: Select all

Synology> filebot -script fn:sysinfo
FileBot 4.5.6 (r2818)
JNA Native: 4.0.0
MediaInfo: MediaInfoLib - v0.7.69
7-Zip-JBinding: OK
chromaprint-tools: fpcalc version 1.1.0 (fpcalc)
Extended Attributes: OK
Groovy Engine: 2.3.9
JRE: Java(TM) SE Embedded Runtime Environment 1.8.0_33 (headless)
JVM: 32-bit Java HotSpot(TM) Embedded Client VM
CPU/MEM: 4 Core / 239 MB Max Memory / 13 MB Used Memory
OS: Linux (i386)
uname: Linux Synology 3.2.40 #5022 SMP Wed Jan 7 14:18:56 CST 2015 x86_64 GNU/Linux synology_x86_1010+
Done ヾ(@⌒ー⌒@)ノ

which looks like everythings alright since 7zip is OK.

BUT: amc.log is giving me this shit again

Code: Select all

SevenZipNativeInitializationException: Failed to load 7z-JBinding: no 7-Zip-JBinding in java.library.path
What does that mean?!

also telling from the amc.txt exclude-file, it didnt process the .rar file, only all the .rXX
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: "Permission denied" Problem

Post by rednoah »

Just because you set an environment variable for the current ssh session doesn't mean it's gonna magically be around in different sessions.

I don't know how you call filebot and who calls filebot but I'd make sure to set LD_LIBRARY_PATH is set right before the filebot call is made or figure out a way to set LD_LIBRARY_PATH globally.

Use filebot -script fn:sysenv to see the actual environment that the process is executed with. ;)
:idea: Please read the FAQ and How to Request Help.
ziemowit
Posts: 32
Joined: 13 Feb 2015, 06:59

Re: "Permission denied" Problem

Post by ziemowit »

did what u said, put the files there, now filebot unzips files :ugeek: thanks mate!

filebot is being called by transmission on a synology NAS.

Can you still answer this one:

Using --def unsorted=y, where will those files be moved?
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: "Permission denied" Problem

Post by rednoah »

The "unsorted format" is currently hardcoded to Unsorted/{fn}.{ext}
:idea: Please read the FAQ and How to Request Help.
Post Reply