Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-15268

TestEnumFields fails due to AccessControlException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Tests
    • Labels:
      None

      Description

      Repro line:

      gradlew :solr:core:test --tests "org.apache.solr.schema.EnumFieldTest.testFacetEnumSearch" -Ptests.jvms=16 -Ptests.jvmargs=-XX:TieredStopAtLevel=1 -Ptests.seed=7B63318325E97AF7 -Ptests.file.encoding=US-ASCII
      
        2> 2228 WARN  (SUITE-EnumFieldTest-seed#[7B63318325E97AF7]-worker) [     ] o.a.s.f.DistribPackageStore Unable to create [/Users/mdrob/code/solr/solr/core/build/resources/test/solr/filestore] directory in SOLR_HOME [/Users/mdrob/code/solr/solr/core/build/resources/test/solr].  Features requiring this directory may fail.
        2>           => java.security.AccessControlException: access denied ("java.io.FilePermission" "/Users/mdrob/code/solr/solr/core/build/resources/test/solr/filestore" "write")
        2>    at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
        2> java.security.AccessControlException: access denied ("java.io.FilePermission" "/Users/mdrob/code/solr/solr/core/build/resources/test/solr/filestore" "write")
        2>    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:?]
        2>    at java.security.AccessController.checkPermission(AccessController.java:897) ~[?:?]
        2>    at java.lang.SecurityManager.checkPermission(SecurityManager.java:322) ~[?:?]
        2>    at java.lang.SecurityManager.checkWrite(SecurityManager.java:752) ~[?:?]
        2>    at java.io.File.mkdir(File.java:1325) ~[?:?]
        2>    at java.io.File.mkdirs(File.java:1357) ~[?:?]
        2>    at org.apache.solr.filestore.DistribPackageStore.ensurePackageStoreDir(DistribPackageStore.java:561) [main/:?]
        2>    at org.apache.solr.filestore.DistribPackageStore.<init>(DistribPackageStore.java:81) [main/:?]
        2>    at org.apache.solr.filestore.PackageStoreAPI.<init>(PackageStoreAPI.java:78) [main/:?]
        2>    at org.apache.solr.core.CoreContainer.load(CoreContainer.java:696) [main/:?]
        2>    at org.apache.solr.util.TestHarness.<init>(TestHarness.java:184) [solr-test-framework-9.0.0-SNAPSHOT.jar:9.0.0-SNAPSHOT c5494aa5c372f5740f387cb50e5ba48058520afd [snapshot build, details omitted]]
        2>    at org.apache.solr.util.TestHarness.<init>(TestHarness.java:156) [solr-test-framework-9.0.0-SNAPSHOT.jar:9.0.0-SNAPSHOT c5494aa5c372f5740f387cb50e5ba48058520afd [snapshot build, details omitted]]
        2>    at org.apache.solr.util.TestHarness.<init>(TestHarness.java:162) [solr-test-framework-9.0.0-SNAPSHOT.jar:9.0.0-SNAPSHOT c5494aa5c372f5740f387cb50e5ba48058520afd [snapshot build, details omitted]]
        2>    at org.apache.solr.util.TestHarness.<init>(TestHarness.java:112) [solr-test-framework-9.0.0-SNAPSHOT.jar:9.0.0-SNAPSHOT c5494aa5c372f5740f387cb50e5ba48058520afd [snapshot build, details omitted]]
        2>    at org.apache.solr.SolrTestCaseJ4.createCore(SolrTestCaseJ4.java:814) [solr-test-framework-9.0.0-SNAPSHOT.jar:9.0.0-SNAPSHOT c5494aa5c372f5740f387cb50e5ba48058520afd [snapshot build, details omitted]]
        2>    at org.apache.solr.SolrTestCaseJ4.initCore(SolrTestCaseJ4.java:804) [solr-test-framework-9.0.0-SNAPSHOT.jar:9.0.0-SNAPSHOT c5494aa5c372f5740f387cb50e5ba48058520afd [snapshot build, details omitted]]
        2>    at org.apache.solr.SolrTestCaseJ4.initCore(SolrTestCaseJ4.java:665) [solr-test-framework-9.0.0-SNAPSHOT.jar:9.0.0-SNAPSHOT c5494aa5c372f5740f387cb50e5ba48058520afd [snapshot build, details omitted]]
        2>    at org.apache.solr.SolrTestCaseJ4.initCore(SolrTestCaseJ4.java:654) [solr-test-framework-9.0.0-SNAPSHOT.jar:9.0.0-SNAPSHOT c5494aa5c372f5740f387cb50e5ba48058520afd [snapshot build, details omitted]]
        2>    at org.apache.solr.schema.EnumFieldTest.doInitCore(EnumFieldTest.java:48) [test/:?]
        2>    at org.apache.solr.schema.EnumFieldTest.beforeClass(EnumFieldTest.java:40) [test/:?]
      

      I'm not sure how to fix this because solr-tests.policy already has entries for:

        permission java.io.FilePermission "${solr.solr.home}", "read,write,delete,readlink";
        permission java.io.FilePermission "${solr.solr.home}${/}-", "read,write,delete,readlink";
      

      but maybe that's not the same as SOLR_HOME?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mdrob Mike Drob
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: