Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15951

Node fails on startup if service is configured through IgniteConfiguration and Authentication is enabled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • None
    • 2.12
    • None
    • Docs Required, Release Notes Required

    Description

      Node fails on startup if service is configured through IgniteConfiguration and Authentication is enabled.

      Reproducer:

      /** */
      public class ServiceAuthenticationTest extends GridCommonAbstractTest {
          /** {@inheritDoc} */
          @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
              IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
      
              cfg.setAuthenticationEnabled(true);
      
              ServiceConfiguration srvcCfg = new ServiceConfiguration();
              srvcCfg.setMaxPerNodeCount(1);
              srvcCfg.setTotalCount(1);
              srvcCfg.setName("TestService");
              srvcCfg.setService(new TestService());
      
              cfg.setServiceConfiguration(srvcCfg);
      
              cfg.setDataStorageConfiguration(new DataStorageConfiguration()
                  .setDefaultDataRegionConfiguration(new DataRegionConfiguration()
                      .setPersistenceEnabled(true)));
      
              return cfg;
          }
      
          /** */
          @Test
          public void test() throws Exception {
              startGrid();
          }
      
          /** */
          public static class TestService implements Service {
              // No-op.
          }
      } 

      Exception:

      java.lang.AssertionError
          at org.apache.ignite.internal.processors.security.IgniteSecurityProcessor.authorize(IgniteSecurityProcessor.java:232)
          at org.apache.ignite.internal.processors.service.IgniteServiceProcessor.checkPermissions(IgniteServiceProcessor.java:633)
          at org.apache.ignite.internal.processors.service.IgniteServiceProcessor.prepareServiceConfigurations(IgniteServiceProcessor.java:593)
          at org.apache.ignite.internal.processors.service.IgniteServiceProcessor.staticallyConfiguredServices(IgniteServiceProcessor.java:1556)
          at org.apache.ignite.internal.processors.service.IgniteServiceProcessor.collectJoiningNodeData(IgniteServiceProcessor.java:361)
          at org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$5.collect(GridDiscoveryManager.java:1009)
          at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.collectExchangeData(TcpDiscoverySpi.java:2143)
          at org.apache.ignite.spi.discovery.tcp.ServerImpl.joinTopology(ServerImpl.java:1107)
          at org.apache.ignite.spi.discovery.tcp.ServerImpl.spiStart(ServerImpl.java:474)
          at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.spiStart(TcpDiscoverySpi.java:2210)
          at org.apache.ignite.internal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:278)
          at org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.start(GridDiscoveryManager.java:1091)
          at org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1953)
          at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1300)
          at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1798)
          at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1720)
          at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1159)
          at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:629)
          at org.apache.ignite.testframework.junits.GridAbstractTest.startGrid(GridAbstractTest.java:1252)
          at org.apache.ignite.testframework.junits.GridAbstractTest.startGrid(GridAbstractTest.java:1169)
          at org.apache.ignite.testframework.junits.GridAbstractTest.startGrid(GridAbstractTest.java:1145)
          at org.apache.ignite.testframework.junits.GridAbstractTest.startGrid(GridAbstractTest.java:823)
          at org.apache.ignite.test.TestClass.test(TestClass.java:54)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
          at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
          at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
          at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
          at org.apache.ignite.testframework.junits.GridAbstractTest$7.run(GridAbstractTest.java:2432)
          at java.lang.Thread.run(Thread.java:748) 

      The main problem here is that org.apache.ignite.internal.processors.service.IgniteServiceProcessor#prepareServiceConfigurations tries to authorize service deployment operation before node joined topology in case some services were preconfigured via IgniteConfiguration.

      Attachments

        Issue Links

          Activity

            People

              PetrovMikhail Mikhail Petrov
              PetrovMikhail Mikhail Petrov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m