Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[native]Consumer error: remove /root/.rocketmq_client_go/****@DEFAULT/offset.json: no such file or directory #221

Closed
wohenbushuang opened this issue Sep 22, 2019 · 2 comments
Labels
discuss Something undering disscussing question Further information is requested

Comments

@wohenbushuang
Copy link

BUG REPORT

  1. Please describe the issue you observed:
    I use native branch in golang, and it's quite normal to continuously produce messages to RocketMQ, which can be seen in rocketmq-console.
    But I meet problems when I want to consume the messages. The consumer will consume several message first, then return an error, which is shown below.

Consumer go code:

C_AIS_0, _ := rocketmq.NewPushConsumer(
    consumer.WithGroupName("AIS_handler"),
    consumer.WithNameServer([]string{rmqnamesrv}),
    consumer.WithRetry(2),
)
err := C_AIS_0.Subscribe("AIS-0", consumer.MessageSelector{}, func(ctx context.Context, msgs ...*primitive.MessageExt) (consumer.ConsumeResult, error) {
    // fmt.Printf("subscribe callback: %v \n", msgs)
    for _, msg := range msgs {
        
        log.Println(msg)
    }
    return consumer.ConsumeSuccess, nil
})
if err != nil {
    fmt.Println(err.Error())
}
err = C_AIS_0.Start()
if err != nil {
    fmt.Println(err.Error())
    // os.Exit(-1)
}
defer C_AIS_0.Shutdown()

consumer docker container log:

INFO[0000] the consumerGroup=AIS_handler start beginning. messageModel=BroadCasting, unitMode=false 
WARN[0000] do balance of group: AIS_handler, but topic: AIS-0 does not exist. 
INFO[0000] the topic [AIS-0] route info changed, old <nil> ,new {"OrderTopicConf":"","queueDatas":[{"brokerName":"617834a79a5b","readQueueNums":16,"writeQueueNums":16,"perm":6,"topicSynFlag":0}],"brokerDatas":[{"cluster":"DefaultCluster","brokerName":"617834a79a5b","brokerAddrs":{"0":"172.17.0.4:10911"}}]} 
INFO[0000] receive broker's notification, the consumer group: AIS_handler 
2019/09/22 12:53:50.737051 [Message=[topic=AIS-0, body=***SOME_CORRECT_MSG_BODY***
, Flag=0, properties=map[CONSUME_START_TIME:1569128030736 MAX_OFFSET:331229 MIN_OFFSET:0 UNIQ_KEY:AC1100060001000000006eea0330167b], TransactionId=], MsgId=AC11000400002A9F0000000067EEEAC6, QueueId=1, StoreSize=207, QueueOffset=331228, SysFlag=0, BornTimestamp=1569128030734, BornHost=127.0.0.1:40864, StoreTimestamp=1569128030734, StoreHost=127.0.0.1:10911, CommitLogOffset=1743710918, BodyCRC=722802141, ReconsumeTimes=0, PreparedTransactionOffset=0]
2019/09/22 12:53:50.739508 [Message=[topic=AIS-0, body=***SOME_CORRECT_MSG_BODY***
, Flag=0, properties=map[CONSUME_START_TIME:1569128030739 MAX_OFFSET:331226 MIN_OFFSET:0 UNIQ_KEY:AC1100060001000000006eea0330167d], TransactionId=], MsgId=AC11000400002A9F0000000067EEEC5F, QueueId=3, StoreSize=202, QueueOffset=331225, SysFlag=0, BornTimestamp=1569128030737, BornHost=127.0.0.1:40864, StoreTimestamp=1569128030737, StoreHost=127.0.0.1:10911, CommitLogOffset=1743711327, BodyCRC=1651877184, ReconsumeTimes=0, PreparedTransactionOffset=0]
2019/09/22 12:53:50.739601 [Message=[topic=AIS-0, body=***SOME_CORRECT_MSG_BODY***
, Flag=0, properties=map[CONSUME_START_TIME:1569128030739 MAX_OFFSET:331226 MIN_OFFSET:0 UNIQ_KEY:AC1100060001000000006eea0330167c], TransactionId=], MsgId=AC11000400002A9F0000000067EEEB95, QueueId=2, StoreSize=202, QueueOffset=331225, SysFlag=0, BornTimestamp=1569128030735, BornHost=127.0.0.1:40864, StoreTimestamp=1569128030735, StoreHost=127.0.0.1:10911, CommitLogOffset=1743711125, BodyCRC=1475096886, ReconsumeTimes=0, PreparedTransactionOffset=0]
2019/09/22 12:53:50.742843 [Message=[topic=AIS-0, body=***SOME_CORRECT_MSG_BODY***
, Flag=0, properties=map[CONSUME_START_TIME:1569128030742 MAX_OFFSET:331224 MIN_OFFSET:0 UNIQ_KEY:AC1100060001000000006eea0330167e], TransactionId=], MsgId=AC11000400002A9F0000000067EEED29, QueueId=4, StoreSize=207, QueueOffset=331223, SysFlag=0, BornTimestamp=1569128030739, BornHost=127.0.0.1:40864, StoreTimestamp=1569128030739, StoreHost=127.0.0.1:10911, CommitLogOffset=1743711529, BodyCRC=2069235323, ReconsumeTimes=0, PreparedTransactionOffset=0]
2019/09/22 12:53:50.744028 [Message=[topic=AIS-0, body=***SOME_CORRECT_MSG_BODY***
, Flag=0, properties=map[CONSUME_START_TIME:1569128030743 MAX_OFFSET:331222 MIN_OFFSET:0 UNIQ_KEY:AC1100060001000000006eea03301680], TransactionId=], MsgId=AC11000400002A9F0000000067EEEEC4, QueueId=6, StoreSize=207, QueueOffset=331221, SysFlag=0, BornTimestamp=1569128030743, BornHost=127.0.0.1:40864, StoreTimestamp=1569128030743, StoreHost=127.0.0.1:10911, CommitLogOffset=1743711940, BodyCRC=556324893, ReconsumeTimes=0, PreparedTransactionOffset=0]
INFO[0000] the MessageQueue changed, also update version: 0 to 1569128030745113953 
INFO[0000] The PullThresholdForTopic is changed from %d to %d102400 6400 
INFO[0000] The PullThresholdSizeForTopic is changed from %d to %d51200 3200 
INFO[0000] the MessageQueue changed, also update version: 1569128030745113953 to 1569128030745191289 
INFO[0000] The PullThresholdForTopic is changed from %d to %d6400 400 
INFO[0000] The PullThresholdSizeForTopic is changed from %d to %d3200 200 
INFO[0000] messageQueueChanged, Group: AIS_handler, Topic: AIS-0, MessageQueues: [MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=0] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=1] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=2] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=3] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=4] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=5] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=6] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=7] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=8] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=9] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=10] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=11] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=12] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=13] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=14] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=15]] 
INFO[0000] messageQueueChanged, Group: AIS_handler, Topic: AIS-0, MessageQueues: [MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=0] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=1] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=2] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=3] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=4] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=5] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=6] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=7] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=8] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=9] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=10] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=11] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=12] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=13] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=14] MessageQueue [topic=AIS-0, brokerName=617834a79a5b, queueId=15]] 
2019/09/22 12:53:50.746843 [Message=[topic=AIS-0, body=***SOME_CORRECT_MSG_BODY***
, Flag=0, properties=map[CONSUME_START_TIME:1569128030746 MAX_OFFSET:331226 MIN_OFFSET:0 UNIQ_KEY:AC1100060001000000006eea03301681], TransactionId=], MsgId=AC11000400002A9F0000000067EEEF93, QueueId=7, StoreSize=208, QueueOffset=331225, SysFlag=0, BornTimestamp=1569128030744, BornHost=127.0.0.1:40864, StoreTimestamp=1569128030744, StoreHost=127.0.0.1:10911, CommitLogOffset=1743712147, BodyCRC=1572319915, ReconsumeTimes=0, PreparedTransactionOffset=0]
ERRO[0000] remove /root/.rocketmq_client_go/AIS_handler/172.17.0.7@DEFAULT/offset.json error: remove /root/.rocketmq_client_go/AIS_handler/172.17.0.7@DEFAULT/offset.json: no such file or directory 
ERRO[0000] net: 172.17.0.4:10911 scanner exit, Err: read tcp 172.17.0.7:40152->172.17.0.4:10911: use of closed network connection. 
  1. Please tell us about your environment:

    • What is your OS?
      Ubuntu 18.04LTS
    • What is your client version?
      native, latest version
    • What is your RocketMQ version?
      4.5.2 alpine
  2. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
    BTW, to continuously consume the messages, do I need to use a for dead-loop?

@ShannonDing ShannonDing added this to the Native-2.0.0-alpha3 milestone Sep 22, 2019
@ShannonDing ShannonDing added the discuss Something undering disscussing label Sep 22, 2019
@ShannonDing ShannonDing changed the title Consumer error: remove /root/.rocketmq_client_go/****@DEFAULT/offset.json: no such file or directory [native]Consumer error: remove /root/.rocketmq_client_go/****@DEFAULT/offset.json: no such file or directory Sep 22, 2019
@ShannonDing
Copy link
Member

Should not shutdown the push consumer unless you will not consume the messages anymore.

@ShannonDing ShannonDing added the question Further information is requested label Oct 8, 2019
xujianhai666 added a commit to xujianhai666/rocketmq-client-go that referenced this issue Oct 13, 2019
- add check before remove offset file

Closes apache#221
ShannonDing pushed a commit that referenced this issue Oct 14, 2019
- add check before remove offset file

Closes #221
@ShannonDing
Copy link
Member

close due to #239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Something undering disscussing question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants