Page 1 of 1

UnsupportedOperationException with the Rename function

Posted: 28 Aug 2017, 11:06
by Automator
Hi there,

First of all big thanks to @rednoah for his amazing filebot! Which I use daily and just is one of the most amazing opensource things I have ever seen!!!

Right now I am trying to repair an old script of mine which seams to have a problem with the newer version of FileBot...

Everything is working except the last part which is moving a Folder lets call it Big.Buck.Bunny.2008.x264.1080p-NoGRP to the destination it has to go /mnt/NAS/Movies/HD/

Code is:

Code: Select all

args.eachMediaFolder{
  rename(file: it,output:"/mnt/NAS/Movies/HD/")
}
Throws that error message:

Code: Select all

[MOVE] from [/mnt/NAS/Downloads/Big.Buck.Bunny.2008.x264.1080p-NoGRP/Big.Buck.Bunny.2008.x264.1080p-NoGRP] to [/mnt/NAS/Movies/HD/Big Buck Bunny (2008)]
Processed 0 files
UnsupportedOperationException
Thanks a lot for your help

Cheers
Automator

Re: UnsupportedOperationException with the Rename function

Posted: 29 Aug 2017, 13:19
by rednoah
Strange indeed. But AFAIK it's just giving you an error message that it can't do what you ask for.

Are you sure that it's not a permission issue? Or some other sort of filesystem access issue? Have you tried this with some local files to see if it works?

Re: UnsupportedOperationException with the Rename function

Posted: 29 Aug 2017, 14:43
by Automator
Hi rednoah,

Thanks a lot for your response.

I tried to create the same directory with the same user... Or even move that directory with the same user to the specific folder... Works flawlessly... Can I debug any further? Or more deeply?

Thanks for your help,

Cheers,
Automator

Re: UnsupportedOperationException with the Rename function

Posted: 18 Jan 2018, 11:50
by rednoah
I'm not really sure why you need a custom script for that. A simple filebot -rename -r call or amc script call would probably do the job.

Re: UnsupportedOperationException with the Rename function

Posted: 18 Jan 2018, 13:24
by Automator
Well I created this script with some of your scripts as a template (incl. AMC) but its has specific features I only use and AMC does not have. As far as I can tell the only part that crashes is the:

Code: Select all

args.eachMediaFolder{
  rename(file: it,output:"/mnt/NAS/Movies/HD/")
}
and I also tried following filebot -rename Big.Buck.Bunny.2008.x264.1080p-NoGRP with following result:

Code: Select all

[root@blabla Big.Buck.Bunny.2008.x264.1080p-NoGRP]$ filebot -rename Big.Buck.Bunny.2008.x264.1080p-NoGRP/
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/mnt/myDatastore/Big.Buck.Bunny.2008.x264.1080p-NoGRP/Big.Buck.Bunny.2008.x264.1080p-NoGRP/movie.mkv]
[MOVE] from [/mnt/myDatastore/Big.Buck.Bunny.2008.x264.1080p-NoGRP/Big.Buck.Bunny.2008.x264.1080p-NoGRP/movie.mkv] to [/mnt/myDatastore/Big.Buck.Bunny.2008.x264.1080p-NoGRP/Big.Buck.Bunny.2008.x264.1080p-NoGRP/Big Buck Bunny (2008).mkv]
Failed to set xattr: FileSystemException: /mnt/myDatastore/Big.Buck.Bunny.2008.x264.1080p-NoGRP/Big.Buck.Bunny.2008.x264.1080p-NoGRP/Big Buck Bunny (2008).mkv: Error writing extended attribute 'net.filebot.metadata': Operation not supported
Processed 1 files
Operation not supported ;-) sounds similar to the error I get in the script?! How can I turn of the meta data stuff?

Re: UnsupportedOperationException with the Rename function

Posted: 18 Jan 2018, 13:34
by Automator
Okay just found out when I do filebot -rename -no-xattr Big.Buck.Bunny.2008.x264.1080p-NoGRP I will not get an error message... How do I do the -no-xattr with the script part:

Code: Select all

args.eachMediaFolder{
  rename(file: it,output:"/mnt/NAS/Movies/HD/")
}

Re: UnsupportedOperationException with the Rename function

Posted: 18 Jan 2018, 16:34
by rednoah
Failed to set xattr is just a warning and has no effect on processing. You may ignore it.

If your filesystem doesn't support xattr, then you can turn xattr support of in FileBot by setting the -no-xattr flag when calling filebot.

TL;DR: Just add -no-xattr to your filebot call. You can't turn on/off the xattr feature in your Groovy script code.

Re: UnsupportedOperationException with the Rename function

Posted: 18 Jan 2018, 23:36
by Automator
I did some more debugging... and found out that also with your script... its not working!

Code: Select all

filebot -script fn:renall Big.Buck.Bunny.2008.x264.1080p-NoGRP/ --def target=folder
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/home/user/localtest/Big.Buck.Bunny.2008.x264.1080p-NoGRP]
[MOVE] from [/home/user/localtest/Big.Buck.Bunny.2008.x264.1080p-NoGRP] to [/home/user/localtest/Big Buck Bunny (2008)]
Processed 0 files
UnsupportedOperationException
Done ヾ(@⌒ー⌒@)ノ
Here is my output of the sysinfo:

Code: Select all

filebot -script fn:sysinfo
FileBot 4.7.14 (r5247)
JNA Native: 5.2.0
MediaInfo: 0.7.96
Apache Commons VFS: [zip, rar]
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-11-21 (r512)
Groovy: 2.4.12
JRE: OpenJDK Runtime Environment 1.8.0_161
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 2 Core / 880 MB Max Memory / 21 MB Used Memory
OS: Linux (amd64)
Package: PORTABLE
uname: Linux bliblablup.local 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Done ヾ(@⌒ー⌒@)ノ

Re: UnsupportedOperationException with the Rename function

Posted: 19 Jan 2018, 00:26
by rednoah
Could it be an issue specifically related to moving folders as opposed to moving files?

Re: UnsupportedOperationException with the Rename function

Posted: 19 Jan 2018, 06:37
by Automator
Well renaming the movie.mkv to Big Buck Bunny (2008).mkv with filebot -rename Big.Buck.Bunny.2008.x264.1080p-NoGRP works. But this is besides the point. I need filebot to rename/move folders not files... why does this not longer work? How can I solve it?

Re: UnsupportedOperationException with the Rename function

Posted: 19 Jan 2018, 09:04
by rednoah
I can reproduce the issue. There seems to have been a change in behaviour in the underlying platform.

As a temporary workaround, you could use --action hardlink to generate a new file structure with hardlinks instead of moving the original hardlink.

EDIT: Fixed with r5254.

Re: UnsupportedOperationException with the Rename function

Posted: 19 Jan 2018, 11:31
by Automator
rednoah!!! you are the best :-) so happy we finally figured it out.

How do I access the (r5254)?

Code: Select all

Update /usr/bin/filebot/FileBot.jar.xz.gpg
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
304 NO UPDATE

Re: UnsupportedOperationException with the Rename function

Posted: 19 Jan 2018, 11:48
by rednoah
I've uploaded the new revision jar. Due to caching, it may not be available immediately. Please try again tomorrow.

Re: UnsupportedOperationException with the Rename function

Posted: 19 Jan 2018, 17:07
by Automator
hmm... I just ran following

Code: Select all

wget https://get.filebot.net/filebot/latest/FileBot.jar.xz.gpg
gpg --batch --yes --trusted-key "4E402EBF7C3C6A71" --output "FileBot.jar.xz" --decrypt FileBot.jar.xz.gpg
xz --decompress FileBot.jar.xz
which only gives me back FileBot 4.7.14 (r5247) but funny enough is newer than what I get when I run update.sh :-)

Re: UnsupportedOperationException with the Rename function

Posted: 19 Jan 2018, 18:55
by rednoah
I'm pretty sure that update.sh uses the exact same URL. So it's probably just a matter of wget being called at the right time, and update.sh having been called to early, or some other kind of caching thing. You will get r5254 eventually if you give it a bit of time. ;)