AccessControlException

All your suggestions, requests and ideas for future development
Post Reply
thielj
Posts: 55
Joined: 05 Nov 2017, 22:15

AccessControlException

Post by thielj »

I started getting these exceptions from the AMC script, probably triggered by something in my own movie_format.groovy script:

Code: Select all

Failed to read xattr: AccessControlException: access denied ("java.lang.RuntimePermission" "accessUserDefinedAttributes")
I had been using {original} in my script, but I also get the same exception without using it. Does the formatter script run in some kind of sandboxed environment?

filebot -script fn:sysinfo has no issues reading and updating extended attributes.

Code: Select all

# filebot -script fn:sysinfo
FileBot 4.7.14 (r5234)
JNA Native: 5.2.0
MediaInfo: 0.7.99
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-10-30 (r508)
Groovy: 2.4.12
JRE: OpenJDK Runtime Environment 1.8.0_121
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 2 Core / 1 GB Max Memory / 30 MB Used Memory
OS: Linux (amd64)
Package: DOCKER
uname: Linux 5e3b63b071ba 4.9.30-unRAID #1 SMP PREEMPT Fri May 26 13:56:36 PDT 2017 x86_64 GNU/Linux
Done ▒(@▒▒▒@)▒
User avatar
rednoah
The Source
Posts: 22985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AccessControlException

Post by rednoah »

Yes, the format engine does run in a sandboxed environment. I've seen that warning a few days ago when testing with {model}. Are you using {model} when you see this warning?
:idea: Please read the FAQ and How to Request Help.
thielj
Posts: 55
Joined: 05 Nov 2017, 22:15

Re: AccessControlException

Post by thielj »

Yep, it probably began when I started using {model}.
I also use both {source} and {tags}, both might be trying to get the original filename from xattr I suppose?

My Java days are long over, but permissions may depend on the execution path, with some sandboxed stack frames denying the required permissions?
thielj
Posts: 55
Joined: 05 Nov 2017, 22:15

Re: AccessControlException

Post by thielj »

It seems to be {model}.

I see you're caching xattr access. Maybe accessing the other files through model is creating an access pattern that is out of the normal order where some of your privileged calls have already created a cache entry?
User avatar
rednoah
The Source
Posts: 22985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AccessControlException

Post by rednoah »

Yep. When you call a binding such as original, the code that retrieves this value is not sandboxed. But anything you do in your Groovy code is sandboxed, so when you do model.original, you get the model object back from the unrestricted code, but access original from restricted code, and thus warnings.

TL;DR nothing you can do about it, i already gave the sandboxed code xattr permissions in the latest revision
:idea: Please read the FAQ and How to Request Help.
thielj
Posts: 55
Joined: 05 Nov 2017, 22:15

Re: AccessControlException

Post by thielj »

Updated to latest r5237 - and getting the same exceptions.
User avatar
rednoah
The Source
Posts: 22985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AccessControlException

Post by rednoah »

Ups. Merge fail. r5240 should work now.
:idea: Please read the FAQ and How to Request Help.
thielj
Posts: 55
Joined: 05 Nov 2017, 22:15

Re: AccessControlException

Post by thielj »

It does :)
Thanks!
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: AccessControlException

Post by ZeroByDivide »

Is there anyway to force revision updates from the windows store? I seem to be having this problem as well

Code: Select all

Failed to read xattr: AccessControlException: access denied ("java.lang.RuntimePermission" "accessUserDefinedAttributes")
though I don't have any

Code: Select all

{model}
in my groovy scripts.

TV Shows -

Code: Select all

{ norm = { it.replaceAll(/[`´‘’ʻ""“”]/, "'")
             .replaceAll(/[:|]/, " - ")
             .replaceAll(/[?]/, "!")
             .replaceAll(/[*\s]+/, " ")
             .replaceAll(/\b[IiVvXx]+\b/, { it.upper() })
             .replaceAll(/\b[0-9](?i:th|nd|rd)\b/, { it.lower() })}}
{ allOf
  {"TV Shows"}
  // TV Shows directory
  { norm(n).replaceAll(/(S.H.I.E.L.D.)/, " S.H.I.E.L.D ") }
  { episode.special ? 'Specials' : 'Season ' + s.pad(2) }
  { allOf
    { norm(n).replaceTrailingBrackets() }
    { episode.special ? 'S00E' + special.pad(2) : S00E00 }
    { allOf
      { norm(t).replacePart(' - Part $1') }
      { allOf
        { allOf
          {"["}
          { allOf
            {[vf,vc].join(" ")}
            { allOf
            {[channels,ac].join(" ")}
            { def a = audioLanguages
              a.size() > 1 ? a.ISO3.join(", ").upperInitial() : a.name.first() }
            .join(" ") }
            {"${self.source ?: 'WEB-DL'}"}
            .join(" - ") }
          {"]"}
          .join("") }
          {subt}
        .join("") }
      .join(" ") }
    .join(" - ") }
  .join("/") }
Movies -

Code: Select all

{ norm = { it.upperInitial()
             .lowerTrail()
             .replaceTrailingBrackets()
             .replaceAll(/[`´‘’ʻ""“”]/, "'")
             .replaceAll(/[:|]/, " - ")
             .replaceAll(/[?]/, "!")
             .replaceAll(/[*\s]+/, " ")
             .replaceAll(/\b[IiVvXx]+\b/, { it.upper() })
             .replaceAll(/\b[0-9](?i:th|nd|rd)\b/, { it.lower() })}}
{ allOf
  {"Movies"}
  // Movies directory
  {n.colon(" - ") + " [$y]"}
  // File name
  { allOf
    { primaryTitle ? primaryTitle.colon(" - ") : primaryTitle.colon(" - ") }
    {" [$y]"}
    // tags + a few more variants
    { specials = { allOf
                     {tags}
                     { def last = n.tokenize(" ").last()
                       fn.after(/(?i:$last)/).findAll(/(?i:alternate[ ._-]cut|limited)/)*.upperInitial()*.lowerTrail()*.replaceAll(/[._-]/, " ") }
                     .flatten().sort() }
      specials().size() > 0 ? specials().join(", ").replaceAll(/^/, " - ") : "" }
    {" PT $pi"}
    {" ["}
    { allOf
      // Video stream
      {[vf,vc].join(" ")}
      { allOf
        // Audio stream and language
        {[channels,ac].join(" ")}
        { def a = audioLanguages
          a.size() > 1 ? a.ISO3.join(", ").upperInitial() : a.name.first() }
        .join(" ") }
      {"${self.source ?: 'WEB-DL'}"}
      .join(" - ") }
    {"]"}
    {subt}
    .join("") }
  .join("/") }
and going by my sysinfo it looks like I'm still on an older revesion

Code: Select all

FileBot 4.7.14 (r5234)
JNA Native: 5.2.0
MediaInfo: 0.7.99
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-11-21 (r512)
Groovy: 2.4.12
JRE: Java(TM) SE Runtime Environment 1.8.0_151
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 6 Core / 1 GB Max Memory / 19 MB Used Memory
OS: Windows 10 (amd64)
Package: APPX
uname: MSYS_NT-10.0 DESKTOP-V6FPU1E 2.9.0(0.318/5/3) 2017-10-05 15:05 x86_64 Msys
Done ?(?????)?
User avatar
rednoah
The Source
Posts: 22985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AccessControlException

Post by rednoah »

Unfortunately, you'll have to wait for the next release. The Windows Store doesn't seem to support beta/stable release channels.
:idea: Please read the FAQ and How to Request Help.
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: AccessControlException

Post by ZeroByDivide »

Ah well damn :/ any ETA on when the next release is possibly?
User avatar
rednoah
The Source
Posts: 22985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AccessControlException

Post by rednoah »

Sorry, no ETA for the next one right now. If there's an important need for updates, I might have to push a release. Unfortunately, this is a fringe issue of a fringe use case, so I won't push an update for review just for that.
:idea: Please read the FAQ and How to Request Help.
Post Reply