java.nio.file.NoSuchFileException

Support for Ubuntu and other Desktop Linux distributions
Post Reply
TempleClause
Posts: 4
Joined: 30 Sep 2017, 19:14

java.nio.file.NoSuchFileException

Post by TempleClause » 30 Sep 2017, 19:18

I updated to the newest filebot (4.7.9) and now filebot is not working for me anymore.
I installed it via snap. Before it was a standard apt-get package.

I always get this error:

Code: Select all

Illegal Argument: java.nio.file.NoSuchFileException: 
I call filebot like this:

Code: Select all

filebot -rename -r "$extractedPath" --db TheMovieDB --format "$pattern" --action move --conflict override -non-strict
Before this was working just fine and now I always get the file not found exception.

What am I missing?

Thanks

User avatar
rednoah
The Source
Posts: 14647
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: java.nio.file.NoSuchFileException

Post by rednoah » 30 Sep 2017, 21:05

What is the value of $extractedPath when you call filebot?

Use set -xu if you're not sure what you're doing:

Code: Select all

set -xu
:idea: Please read the FAQ and How to Request Help.

TempleClause
Posts: 4
Joined: 30 Sep 2017, 19:14

Re: java.nio.file.NoSuchFileException

Post by TempleClause » 30 Sep 2017, 23:36

rednoah wrote:
30 Sep 2017, 21:05
What is the value of $extractedPath when you call filebot?

Use set -xu if you're not sure what you're doing:

Code: Select all

set -xu
$extractedPath is the path to the directory ->/data/Downloads/Movies/Extracted/

What does

Code: Select all

set -xu 
do?

Odly enough I also tried to do this:

Code: Select all

filebot -mediainfo /path/I/am/100%/sure/it/exists.mkv --format {json}
And it also gives me a file not found exception :-/

User avatar
rednoah
The Source
Posts: 14647
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: java.nio.file.NoSuchFileException

Post by rednoah » 01 Oct 2017, 05:37

If you're 100% sure that the path exists, then it's possible that it's just not accessible / visible to FileBot due to permissions.
:idea: Please read the FAQ and How to Request Help.

TempleClause
Posts: 4
Joined: 30 Sep 2017, 19:14

Re: java.nio.file.NoSuchFileException

Post by TempleClause » 01 Oct 2017, 18:16

You are right, it is indeed some kind of permission issue but I don't know how to resolve it.
The files are on my secondary hard drive which are mounted to /data/.
If I copy my test file to the Desktop it works fine.

I tried this:

Code: Select all

sudo snap connect filebot:removable-media
As well as installing filebot with the devmode like this:

Code: Select all

sudo snap install filebot --devmode
What else can I do?

TempleClause
Posts: 4
Joined: 30 Sep 2017, 19:14

Re: java.nio.file.NoSuchFileException

Post by TempleClause » 03 Oct 2017, 20:43

Is there a way to install a standard debian package instead of this snap stuff?

kodiuser
Posts: 13
Joined: 08 Jan 2018, 01:38

Re: java.nio.file.NoSuchFileException

Post by kodiuser » 08 Jan 2018, 18:09

I had the same error using a snap, but I was using the /tmp folder. After I started using another folder (for example ~/Desktop) the error was gone.

maeldc
Posts: 2
Joined: 20 Feb 2018, 19:56

Re: java.nio.file.NoSuchFileException

Post by maeldc » 20 Feb 2018, 21:02

Hi, I've got the same issue and after some poking I believe it's due to the way snap handles permissions. snap puts filebot in a jail, this causes problems when you want to access network shares, or in my case files that are owned by another user but have read-write permissions for world.

It won't even let you access files that you own in /tmp, which is really odd. The only place I have found that works is under my home directory. None of my media is here :)

I suspect this is also why the filebot GUI does not work over X.

Someone asked above if there is a way to install just a debian package instead of using snap. Is this an option? I couldn't find one. I believe this would solve the issue.

I also tried installing filebot in snap "classic" mode which supposedly removes the jail. This doesn't make any difference.

EDIT: I looked a little farther, and also read the post on granting access to /media. My media is not under /media, it's under /share (I tried symbolic links from /media/share to /share - no joy).

If the developers want to continue using snap, please consider building a snap package that can be installed in "classic" mode. Apparently "classic" mode removes the sandbox/jail and allows the snap-deployed application to access the filesystem. Without classic, we're limited to using filebot only on files under our home directory, or under /media after running the "connect removable media" commands.

There is some discussion here explaining that tools that need access to the filesystem, like text editors, should be packaged in "classic" mode. filebot definitely falls into this category IMHO. [feel free to ignore the political discussions around the bad or good of snap]
https://www.reddit.com/r/Ubuntu/comment ... ally_hurt/

User avatar
rednoah
The Source
Posts: 14647
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: java.nio.file.NoSuchFileException

Post by rednoah » 21 Feb 2018, 02:08

rednoah wrote:
21 Jun 2017, 16:36
By default, SNAP packages are not allowed to access /media. The SNAP sandbox will deny access unless you have explicitly granted access to removable-media.


Grant access to removable-media if you want to process files in the /media folder with FileBot:

Code: Select all

sudo snap connect filebot:removable-media
@see https://github.com/snapcore/snapd/wiki/Interfaces


:idea: If you want to give a snap application full access to your system (e.g. /mnt) then you can use --devmode when installing the application to disable confinement entirely.
Have you tried this? Have you tried --devmode to run the snap without confinement?
:idea: Please read the FAQ and How to Request Help.

maeldc
Posts: 2
Joined: 20 Feb 2018, 19:56

Re: java.nio.file.NoSuchFileException

Post by maeldc » 21 Feb 2018, 13:22

Have you tried this? Have you tried --devmode to run the snap without confinement?
Yes. It doesn't allow access to the whole filesystem. I have tried installation several times with the following flags:

(none)
--classic
--devmode

They all have the same behavior, only allowing operations on files under my home directory or /media. I ran this command yesterday:

Code: Select all

sudo snap connect filebot:removable-media
snap seems to remember this setting across remove/install operations, so this is why /media is allowed.
I also see that "home" is allowed by default after installation (from "snap interfaces" command)

With --devmode I saw the following in syslog:

Code: Select all

Feb 21 05:39:36 yoda kernel: [52308.970604] audit: type=1400 audit(1519209576.16
9:89): apparmor="ALLOWED" operation="open" profile="snap.filebot.filebot" name="
/mnt/" pid=22304 comm="java" requested_mask="r" denied_mask="r" fsuid=1000 ouid=
0
Feb 21 05:39:36 yoda kernel: [52308.971020] audit: type=1400 audit(1519209576.16
9:90): apparmor="ALLOWED" operation="open" profile="snap.filebot.filebot" name="
/media/" pid=22304 comm="java" requested_mask="r" denied_mask="r" fsuid=1000 oui
d=0
I didn't see any denials logged, and as noted files under /mnt are not able to be processed by filebot.

I found some documentation here:
https://docs.snapcraft.io/reference/confinement

It's a little unclear, but it seems to indicate that "--classic" install won't do anything unless the package was built with classic confinement capability.

kheaactua
Posts: 2
Joined: 05 Dec 2018, 01:33

Re: java.nio.file.NoSuchFileException

Post by kheaactua » 05 Dec 2018, 01:36

Will this ever be fixed? I'm reluctant to buy a license when I have to run a script to store my files on /tmp, run filebot, and then rsync the results to my media drive. Is there any better way?

User avatar
rednoah
The Source
Posts: 14647
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: java.nio.file.NoSuchFileException

Post by rednoah » 05 Dec 2018, 07:09

:arrow: Just use the classic deb package to avoid snap confinement altogether.


Illegal Argument: java.nio.file.NoSuchFileException has been fixed, and should give you a better error message now. If the system doesn't allow file access, then the correct behaviour is a failure. That being said, if snap confinement is an issue, then you can just use the deb instead, which then runs with your permissions as usual.
:idea: Please read the FAQ and How to Request Help.

kheaactua
Posts: 2
Joined: 05 Dec 2018, 01:33

Re: java.nio.file.NoSuchFileException

Post by kheaactua » 07 Dec 2018, 14:11

nice, thanks, I'll give it a try.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests