Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-8907

Users other than the user who starts the AMQ Broker cannot execute . /bin/artemis commands in the broker instance dir without error message

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • AMQ 7.11.1.GA
    • None
    • None

      • [Problem]
        • Users other than the user who starts the AMQ Broker cannot execute . /bin/artemis commands in the broker instance dir without error messages
        • However, the original command itself seems to be executed normally, just with error messages.
        • For your information, It seems like only . /bin/artemis commands in the broker instance dir, which is created by "./bin/artemis create" command, access the log files, but . /bin/artemis commands in the AMQ Broker install dir.
      • [As far as I've investigated]
        • When executing ./bin/artemis commands in the broker instance, it seems to use log4j from the commands. And the commands try to access log/artemis.log. However, generally, log/artemis.log has "rw-r-r-" permission, so the file owner, i.e., who starts the AMQ broker, can only write log files, but other users.
        • I cannot understand why ./bin/artemis commands in the broker instance try to use log4j and access to the log/artemis.log, shouldn't access to log files using such log4j be removed?

      Users other than the user who starts the AMQ Broker cannot

      (1) . /bin/artemis queue stat

      2024-02-29 21:02:30,082 main ERROR RollingFileManager (/home/tyamashi/support/case/amq7/202402/03742578/apache-artemis-2.28.0.redhat-00003/broker0/log/artemis.log) java.io.FileNotFoundException: /home/tyamashi/support/case/amq7/202402/03742578/apache-artemis-2.28.0.redhat-00003/broker0/log/artemis.log (Permission denied) java.io.FileNotFoundException: /home/tyam
      ashi/support/case/amq7/202402/03742578/apache-artemis-2.28.0.redhat-00003/broker0/log/artemis.log (Permission denied)
              at java.base/java.io.FileOutputStream.open0(Native Method)
              at java.base/java.io.FileOutputStream.open(FileOutputStream.java:295)
              at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:236)
              at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:156)
              at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:748)
              at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:718)
              at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:144)
              at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:100)
              at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:217)
              at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:135)
              at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:62)
              at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:124)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1138)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1063)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1055)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:664)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:258)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:304)
              at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:621)
              at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:694)
              at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:711)
              at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:253)
              at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
              at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
              at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
              at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
              at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:61)
              at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
              at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
              at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
              at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
              at org.apache.activemq.artemis.core.config.impl.ConfigurationImpl.<clinit>(ConfigurationImpl.java:134)
              at org.apache.activemq.artemis.cli.commands.ActionAbstract.getBrokerConfiguration(ActionAbstract.java:128)
              at org.apache.activemq.artemis.cli.commands.ActionAbstract.getBrokerURLInstance(ActionAbstract.java:96)
              at org.apache.activemq.artemis.cli.commands.messages.ConnectionAbstract.execute(ConnectionAbstract.java:115)
              at org.apache.activemq.artemis.cli.commands.queue.StatQueue.execute(StatQueue.java:138)
              at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:212)
              at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:162)
              at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
              at java.base/java.lang.reflect.Method.invoke(Method.java:578)
              at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:144)
              at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:61)
      
      2024-02-29 21:02:30,085 main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@3c9bfddc] unable to create manager for [/home/tyamashi/support/cas
      e/amq7/202402/03742578/apache-artemis-2.28.0.redhat-00003/broker0/log/artemis.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@1a9c38eb[pattern=/home/tyamashi/support/case/amq7/202402/03742578/apache-artemis-2.28.0.redhat-00003/broker0/log/artemis.log.%d{yyyy-MM-dd_HHmm}, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[CronTriggeringPolicy(schedule=0 * * * * ?)]), strategy=DefaultRolloverStrategy(min=1, max=7, useMax=true), advertiseURI=null, layout=%d %-5level [%logger] %msg%n, filePermissions=null, fileOwner=null]] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@3c9bfddc] unable to create manager for [/home/tyamashi/support/case/amq7/202402/03742578/apache-artemis-2.28.0.redhat-00003/broker0/log/artemis.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@1a9c38eb[pattern=/home/tyamashi/support/case/amq7/202402/03742578/apache-artemis-2.28.0.redhat-00003/broker0/log/artemis.log.%d{yyyy-MM-dd_HHmm}, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[CronTriggeringPolicy(schedule=0 * * * * ?)]), strategy=DefaultRolloverStrategy(min=1, max=7, useMax=true), advertiseURI=null, layout=%d %-5level [%logger] %msg%n, filePermissions=null, fileOwner=null]]
              at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:146)
              at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:100)
              at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:217)
              at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:135)
              at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:62)
              at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:124)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1138)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1063)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1055)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:664)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:258)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:304)
              at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:621)
              at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:694)
              at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:711)
              at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:253)
              at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
              at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
              at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
              at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
              at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:61)
              at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
              at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
              at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
              at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
      
              at org.apache.activemq.artemis.core.config.impl.ConfigurationImpl.<clinit>(ConfigurationImpl.java:134)
              at org.apache.activemq.artemis.cli.commands.ActionAbstract.getBrokerConfiguration(ActionAbstract.java:128)
              at org.apache.activemq.artemis.cli.commands.ActionAbstract.getBrokerURLInstance(ActionAbstract.java:96)
              at org.apache.activemq.artemis.cli.commands.messages.ConnectionAbstract.execute(ConnectionAbstract.java:115)
              at org.apache.activemq.artemis.cli.commands.queue.StatQueue.execute(StatQueue.java:138)
              at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:212)
              at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:162)
              at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
              at java.base/java.lang.reflect.Method.invoke(Method.java:578)
              at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:144)
              at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:61)
      
      2024-02-29 21:02:30,086 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender
              at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:260)
              at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:136)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1138)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1063)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1055)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:664)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:258)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:304)
              at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:621)
              at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:694)
              at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:711)
              at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:253)
              at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
              at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
              at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
              at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
              at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:61)
              at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
              at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
              at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
              at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
              at org.apache.activemq.artemis.core.config.impl.ConfigurationImpl.<clinit>(ConfigurationImpl.java:134)
              at org.apache.activemq.artemis.cli.commands.ActionAbstract.getBrokerConfiguration(ActionAbstract.java:128)
              at org.apache.activemq.artemis.cli.commands.ActionAbstract.getBrokerURLInstance(ActionAbstract.java:96)
              at org.apache.activemq.artemis.cli.commands.messages.ConnectionAbstract.execute(ConnectionAbstract.java:115)
              at org.apache.activemq.artemis.cli.commands.queue.StatQueue.execute(StatQueue.java:138)
              at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:212)
              at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:162)
              at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
              at java.base/java.lang.reflect.Method.invoke(Method.java:578)
              at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:144)
              at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:61)
      
      2024-02-29 21:02:30,087 main ERROR Null object returned for RollingFile in Appenders.
      2024-02-29 21:02:30,087 main ERROR Unable to locate appender "log_file" for logger config "root"
      Connection brokerURL = tcp://localhost:61616
      |NAME                     |ADDRESS                  |CONSUMER_COUNT|MESSAGE_COUNT|MESSAGES_ADDED|DELIVERING_COUNT|MESSAGES_ACKED|SCHEDULED_COUNT|ROUTING_TYPE|
      |DLQ                      |DLQ                      |0             |1000         |1000          |0               |0             |0              |ANYCAST     |
      |ExpiryQueue              |ExpiryQueue              |0             |0            |0             |0               |0             |0              |ANYCAST     |
      |TEST                     |TEST                     |0             |3000         |3000          |0               |0             |0              |ANYCAST     |
      |activemq.management.53...|activemq.management.53...|1             |0            |0             |0               |0             |0              |MULTICAST   |
      |exampleQueue             |exampleQueue             |0             |1000         |1000          |0               |0             |0              |ANYCAST     |
      |examplequeue             |examplequeue             |0             |0            |0             |0               |0             |0              |ANYCAST     |
      

              dbruscin Domenico Francesco Bruscino
              rhn-support-tyamashi Tomonari Yamashita
              Mikhail Krutov Mikhail Krutov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: