[
https://issues.apache.org/jira/browse/ARTEMIS-5252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17929272#comment-17929272
]
Justin Bertram edited comment on ARTEMIS-5252 at 2/22/25 12:49 AM:
-------------------------------------------------------------------
The broker can only go so far in protecting itself from bad configuration
changes. If someone changes {{broker.xml}} such that it is invalid (e.g.
removing necessary XML) there's really nothing the broker can do about it. If
this is done at runtime the reload operation will fail but the broker will
continue running. If the broker is stopped it won't be able to restart until
the {{broker.xml}} is fixed.
If you don't want folks to break {{broker.xml}} in production then I recommend
you enforce strict access and validate any changes or disallow changes
completely.
was (Author: jbertram):
The broker can only go so far in protecting itself from bad configuration
changes. If someone changes {{broker.xml}} such that it is invalid (e.g.
removing necessary XML) there's really nothing the broker can do about it. If
this is done at runtime the reload operation will fail but the broker will
continue running. If the broker is stopped it won't be able to restart until
the {{broker.xml}} is fixed.
If you don't folks to break {{broker.xml}} in production then I recommend you
enforce strict access and validate any changes or disallow changes completely.
> Divert with incorrect filter causes startup failure
> ---------------------------------------------------
>
> Key: ARTEMIS-5252
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5252
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: Broker
> Affects Versions: 2.39.0
> Environment: ActiveMQ Artemis 2.38,0 - 2.39.0 Linux / Windows
> Reporter: Aleksandr Milovidov
> Assignee: Justin Bertram
> Priority: Minor
> Attachments: artemis_divert_with_incorrect_filter.log
>
>
> When broker.xml contains a divert with an incorrect filter, ActiveMQ Artemis
> fails to start.
> Expected behavior:
> If the divert was created before, keep previous divert settings and start.
> If the divert was absent, skip creating the divert and start.
> For example, if invalid filter is specified in the queue configuration, it
> does not lead to a non-operating state of the server. A queue with an
> incorrect filter is not deployed or not changed.
> Also when we have a primary-backup cluster with replication, if someone
> accidentally deployed incorrect divert configuration to both servers, it
> leads to unavailability of the entire cluster after restart of the primary
> server. Backup broker tries to become a live server but cannot start because
> of the incorrect configuration.
> Steps to reproduce:
> 1. Create a broker instance. Add to broker.xml:
> {code:java}
> <addresses>
> <address name="test-source">
> <anycast/>
> </address>
> <address name="test-destination">
> <anycast>
> <queue name="test-destination"/>
> </anycast>
> </address>
> </addresses>
> <diverts>
> <divert name="divert-test">
> <address>test-source</address>
> <forwarding-address>test-destination</forwarding-address>
> <exclusive>false</exclusive>
> <filter string="key='value'"/>
> </divert>
> </diverts>
> {code}
> 2. Change filter string to something incorrect which does not break xml
> syntax. For example {{"(key='value'"}}
> When reloading configuration, broker logs an error and continues to work:
> {code:java}
> ERROR [org.apache.activemq.artemis.core.server] AMQ224006: Invalid filter:
> (key='value'
> ERROR [org.apache.activemq.artemis.core.server] AMQ224069: Change detected in
> broker configuration file, but reload failed
> org.apache.activemq.artemis.api.core.ActiveMQInvalidFilterExpressionException:
> AMQ229020: Invalid filter: (key='value'{code}
> When restarting the broker, it logs:
> {code:java}
> ERROR [org.apache.activemq.artemis.core.server] AMQ224006: Invalid filter:
> (key='value'
> ERROR [org.apache.activemq.artemis.core.server] AMQ224000: Failure in
> initialisation
> {code}
> Full logs are attached: [^artemis_divert_with_incorrect_filter.log]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact