Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-7515

Token resolution: exception stack trace is printed out on error

    Details

    • Type: Bug
    • Status: Dev backlog
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 7.1.0
    • Fix Version/s: None
    • Component/s: config, regression
    • Labels:
      None

      Description

      Found with rev cccf111801ab82389211dd4214cc48c9861df337

      regression in our token resolution tests.

      When setting on purpose a json property file with some wrong content as the DS_ENVCONFIG_DIRS, we got the stack trace in output when starting the server:

      *** Set dir resolver in env ***
      self.DJ1.set_env_variable('DS_ENVCONFIG_DIRS', os.path.join(self.tmp_dir, 'notokjson'))
      
      E:\jenkins\workspace\OpenDJ-7.1.x\tests_daily\Configs\results\20200928-033346\commons_config_group\DJ1\opendj\bat\dsconfig.bat --offline set-connection-handler-prop --handler-name "HTTP Connection Handler" --set listen-port:"&{listen.port}" -n
      
      ** Now start the server and check the error message ***
      E:\jenkins\workspace\OpenDJ-7.1.x\tests_daily\Configs\results\20200928-033346\commons_config_group\DJ1\opendj\bat\start-ds.bat 
      
      -- rc --
      returned 1, effectively in [1]
      -- stdout --
      An error occurred while attempting to bootstrap the Directory Server: Cannot create the property resolver due to the following error: 'IllegalStateException: Failed to load JSON file E:\jenkins\workspace\OpenDJ-7.1.x\tests_daily\Configs\results\20200928-033346\commons_config_group\tmp\notokjson\notokjson.json at PropertyResolvers.java:342 PropertyResolvers.java:328 PropertyResolvers.java:314 ReduceOps.java:80 Spliterators.java:948 AbstractPipeline.java:484 AbstractPipeline.java:474 ReduceOps.java:913 AbstractPipeline.java:234 ReferencePipeline.java:563 PropertyResolvers.java:305 ReferencePipeline.java:195 ReferencePipeline.java:177 Spliterators.java:948 AbstractPipeline.java:484 AbstractPipeline.java:474 ReduceOps.java:913 AbstractPipeline.java:234 ReferencePipeline.java:578 PropertyResolvers.java:116 DirectoryEnvironmentConfig.java:389 DirectoryServer.java:1376 DirectoryServer.java:3387 StartDs.java:311 DirectoryServer.java:3581 / (1) caused by JsonParseException: Unrecognized token 'listen': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
       at [Source: (File); line: 1, column: 8] at JsonParser.java:1851 ParserMinimalBase.java:717 UTF8StreamJsonParser.java:3588 UTF8StreamJsonParser.java:2683 UTF8StreamJsonParser.java:865 UTF8StreamJsonParser.java:757 ObjectMapper.java:4620 ObjectMapper.java:4469 ObjectMapper.java:3299 PropertyResolvers.java:340 PropertyResolvers.java:328 PropertyResolvers.java:314 ReduceOps.java:80 Spliterators.java:948 AbstractPipeline.java:484 AbstractPipeline.java:474 ReduceOps.java:913 AbstractPipeline.java:234 ReferencePipeline.java:563 PropertyResolvers.java:305 ReferencePipeline.java:195 ReferencePipeline.java:177 Spliterators.java:948 AbstractPipeline.java:484 AbstractPipeline.java:474 ReduceOps.java:913 AbstractPipeline.java:234 ReferencePipeline.java:578 PropertyResolvers.java:116 DirectoryEnvironmentConfig.java:389 DirectoryServer.java:1376 DirectoryServer.java:3387 StartDs.java:311 DirectoryServer.java:3581'
      [28/Sep/2020:03:39:47 +0100] category=CORE severity=NOTICE msgID=139 msg=The Directory Server has sent an alert notification generated by class org.opends.server.core.DirectoryServer (alert type org.opends.server.DirectoryServerShutdown, alert ID org.opends.messages.core-141): The Directory Server has started the shutdown process. The shutdown was initiated by an instance of class org.opends.server.core.DirectoryServerShutdownHook and the reason provided for the shutdown was The Directory Server shutdown hook detected that the JVM is shutting down. This generally indicates that JVM received an external request to stop (e.g., through a kill signal)
      [28/Sep/2020:03:39:47 +0100] category=CORE severity=NOTICE msgID=203 msg=The Directory Server is now stopped
      

      we have this when setting duplicate keys:

      returned 1, effectively in [1]
      -- stdout --
      An error occurred while attempting to bootstrap the Directory Server: Cannot create the property resolver due to the following error: 'IllegalArgumentException: Duplicated keys detected in property resolver file E:\jenkins\workspace\OpenDJ-7.1.x\tests_daily\Configs\results\20200928-033346\commons_config_group\tmp\all_dirs\token.json: [listen.port] at PropertyResolvers.java:319 ReduceOps.java:80 Spliterators.java:948 AbstractPipeline.java:484 AbstractPipeline.java:474 ReduceOps.java:913 AbstractPipeline.java:234 ReferencePipeline.java:563 PropertyResolvers.java:305 ReferencePipeline.java:195 ReferencePipeline.java:177 Spliterators.java:948 AbstractPipeline.java:484 AbstractPipeline.java:474 ReduceOps.java:913 AbstractPipeline.java:234 ReferencePipeline.java:578 PropertyResolvers.java:116 DirectoryEnvironmentConfig.java:389 DirectoryServer.java:1376 DirectoryServer.java:3387 StartDs.java:311 DirectoryServer.java:3581'
      [28/Sep/2020:03:42:20 +0100] category=CORE severity=NOTICE msgID=139 msg=The Directory Server has sent an alert notification generated by class org.opends.server.core.DirectoryServer (alert type org.opends.server.DirectoryServerShutdown, alert ID org.opends.messages.core-141): The Directory Server has started the shutdown process. The shutdown was initiated by an instance of class org.opends.server.core.DirectoryServerShutdownHook and the reason provided for the shutdown was The Directory Server shutdown hook detected that the JVM is shutting down. This generally indicates that JVM received an external request to stop (e.g., through a kill signal)
      [28/Sep/2020:03:42:20 +0100] category=CORE severity=NOTICE msgID=203 msg=The Directory Server is now stopped
      

      to reproduce

      ./run-pybot.py -s commons_config_group -t Json_Property_File_With_Wrong_Content -t Json_Property_File_With_Wrong_Content opendj
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cforel carole forel
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: