{"record":{"id":"a71f63c2642d8d07","repo":"apache/rocketmq","slug":"failed-to-ack-message","errorCode":null,"errorMessage":"Failed to ack message","messagePattern":"Failed to ack message","errorType":"exception","errorClass":"RemotingCommandException","httpStatus":null,"severity":"error","filePath":"broker/src/main/java/org/apache/rocketmq/broker/processor/AckMessageProcessor.java","lineNumber":382,"sourceCode":"                        break;\n                    }\n                    long offset = startOffset + i;\n                    if (offset < minOffset || offset > maxOffset) {\n                        continue;\n                    }\n                    if (reviveQueueId == KeyBuilder.POP_ORDER_REVIVE_QUEUE) {\n                        ackOrderlyNew(topicId, groupId, queueId, offset, popTime, invisibleTime, channel, response);\n                    } else {\n                        this.brokerController.getPopConsumerService().ackAsync(\n                            popTime, invisibleTime, groupId, topicId, queueId, offset);\n                    }\n                    ackCount++;\n                }\n\n                this.brokerController.getBrokerStatsManager().incBrokerAckNums(ackCount);\n                this.brokerController.getBrokerStatsManager().incGroupAckNums(groupId, topicId, ackCount);\n            } catch (ConsumeQueueException e) {\n                throw new RemotingCommandException(\"Failed to ack message\", e);\n            }\n        }\n    }\n\n    private void handlePutMessageResult(PutMessageResult putMessageResult, AckMsg ackMsg, String topic,\n        String consumeGroup, long popTime, int qId, int ackCount) {\n        if (putMessageResult.getPutMessageStatus() != PutMessageStatus.PUT_OK\n            && putMessageResult.getPutMessageStatus() != PutMessageStatus.FLUSH_DISK_TIMEOUT\n            && putMessageResult.getPutMessageStatus() != PutMessageStatus.FLUSH_SLAVE_TIMEOUT\n            && putMessageResult.getPutMessageStatus() != PutMessageStatus.SLAVE_NOT_AVAILABLE) {\n            POP_LOGGER.error(\"put ack msg error:\" + putMessageResult);\n        }\n        brokerController.getBrokerMetricsManager().getPopMetricsManager().incPopReviveAckPutCount(ackMsg, putMessageResult.getPutMessageStatus());\n        brokerController.getPopInflightMessageCounter().decrementInFlightMessageNum(topic, consumeGroup, popTime, qId, ackCount);\n    }\n\n    protected void ackOrderly(String topic, String consumeGroup, int qId, long ackOffset, long popTime,\n        long invisibleTime, Channel channel, RemotingCommand response) {","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/apache/rocketmq/blob/293f5885719fc4aa3619446a1900f58ccfcfdd29/broker/src/main/java/org/apache/rocketmq/broker/processor/AckMessageProcessor.java#L364-L400","documentation":"In the pop-consumer KV ack path (appendAckNew), after successfully writing revive/ack entries the processor calls store APIs (e.g. getMaxOffsetInQueue during ack processing) whose checked ConsumeQueueException is wrapped as RemotingCommandException('Failed to ack message'). It signals the ack could not be completed against the message store even though the request reached the ack logic.","triggerScenarios":"Ack processing with brokerConfig.popConsumerKVServiceEnable=true when a consume-queue lookup for the acked topic/queue throws: deleted queue, corrupt consumeq, or store shutdown in progress.","commonSituations":"Enabling the pop KV ack service and hitting store instability; topic deletion racing outstanding acks; disk errors on the store paths.","solutions":["Inspect broker logs for the ConsumeQueueException cause and affected topic/queue","Stabilize the store (fix disk issues, let recovery complete, restart if needed) before clients continue acking","Skip acks for queues that no longer exist; pop revive will expire the un-acked messages","Retry the ack once the broker reports the queue healthy"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    brokerController.getPopConsumerService().ackAsync(...);\n} catch (RemotingCommandException e) {\n    // log the ConsumeQueueException cause; queue will be redelivered via pop revive\n}","preventionTips":["With popConsumerKVServiceEnable=true, watch store health closely since acks now depend on KV/store lookups","Restart broker to complete store recovery before resuming ack traffic"],"tags":["broker","pop-consumer","ack","kv-store","consume-queue","rocketmq"],"backgroundTag":null,"analyzedSha":"293f5885719fc4aa3619446a1900f58ccfcfdd29","analyzedAt":"2026-08-14T11:50:13.822Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}