rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

[Bug] CODE: INTERNAL_SERVER_ERROR, MESSAGE: java.lang.NullPointerException, org.apache.rocketmq.common.message.MessageExt.socketAddress2ByteBuffer(MessageExt.java:77)

Open jiangxuhui opened this issue 1 year ago • 4 comments

Before Creating the Bug Report

  • [X] I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • [X] I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • [X] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

system: ubuntu 22.04 version: rocketmq 5.2 env: k8s v.1.27

RocketMQ version

rocketmq 5.2

JDK Version

openjdk 1.8.0

Describe the Bug

1、when i use dashboard send msg to topic testtopic1。 I had serach the documentary。no use image image 2、when i use go sdk v5.1 send msg to topic testtopic1.

2024-09-18T16:30:57.524+0800	INFO	[email protected]/client.go:494	begin to start the rocketmq client	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024-09-18T16:30:57.524+0800	INFO	[email protected]/client_manager.go:105	begin to start the client manager
2024-09-18T16:30:57.524+0800	INFO	[email protected]/client_manager.go:131	the client manager starts successfully
2024-09-18T16:30:57.536+0800	INFO	[email protected]/rpc_client.go:84	create rpc client success, target=10.203.90.24:30006
2024-09-18T16:30:57.547+0800	INFO	[email protected]/client.go:102	defaultClientSession is startUp! endpoints=scheme:IPv4 addresses:{host:"10.203.90.24" port:30006}	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024-09-18T16:30:57.548+0800	INFO	[email protected]/client.go:489	telemeter to 10.203.90.24:30006 success	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024-09-18T16:30:57.554+0800	INFO	[email protected]/metric.go:184	metric is off, clientId=SISDRV2412@17544@0@h01n9bsjvk
2024-09-18T16:30:57.554+0800	INFO	[email protected]/client.go:97	Executed command successfully	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024-09-18T16:30:57.560+0800	WARN	[email protected]/producer.go:253	failed to send message, would attempt to resend right now, topic=testtopic1, messageId(s)=[010050568CEC9A448806FC29C100000000], maxAttempts=3, attempt=1, endpoints=scheme:IPv4 addresses:{host:"10.203.90.24" port:30006}, requestId=[329c98ec-055f-446d-b8cc-22e3c2eca689]	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024-09-18T16:30:57.565+0800	WARN	[email protected]/producer.go:253	failed to send message, would attempt to resend right now, topic=testtopic1, messageId(s)=[010050568CEC9A448806FC29C100000000], maxAttempts=3, attempt=2, endpoints=scheme:IPv4 addresses:{host:"10.203.90.24" port:30006}, requestId=[329c98ec-055f-446d-b8cc-22e3c2eca689 9ee8e802-4313-4ba2-9933-2a566fb2fb06]	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024-09-18T16:30:57.571+0800	ERROR	[email protected]/producer.go:234	failed to send message(s) finally, run out of attempt times, topic=testtopic1, messageId(s)=[010050568CEC9A448806FC29C100000000], maxAttempts=3, attempt=3, endpoints=scheme:IPv4 addresses:{host:"10.203.90.24" port:30006}, requestId=[329c98ec-055f-446d-b8cc-22e3c2eca689 9ee8e802-4313-4ba2-9933-2a566fb2fb06 8ffd7df2-869d-403d-ac61-d4bb7b3deee3]	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024/09/18 16:30:57 CODE: INTERNAL_SERVER_ERROR, MESSAGE: java.lang.NullPointerException, org.apache.rocketmq.common.message.MessageExt.socketAddress2ByteBuffer(MessageExt.java:77)

Steps to Reproduce

code like below:

package main

import (
	"context"
	"fmt"
	"log"
	"os"
	"strconv"
	"time"

	rmq_client "github.com/apache/rocketmq-clients/golang/v5"
	"github.com/apache/rocketmq-clients/golang/v5/credentials"
)

const (
	Topic    = "testtopic"
	Endpoint = "192.168.228.130:8081"
)

func producer_ruyi() {
	os.Setenv("mq.consoleAppender.enabled", "true")
	rmq_client.ResetLogger()
	producer, err := rmq_client.NewProducer(&rmq_client.Config{
		Endpoint:    Endpoint,
		Credentials: &credentials.SessionCredentials{},
	},
		rmq_client.WithTopics(Topic),
	)
	if err != nil {
		log.Fatal(err)
	}
	// start producer
	err = producer.Start()
	if err != nil {
		log.Fatal(err)
	}
	// graceful stop producer
	defer producer.GracefulStop()

	for i := 0; i < 10; i++ {
		// new a message
		msg := &rmq_client.Message{
			Topic: Topic,
			Body:  []byte("this is a message : " + strconv.Itoa(i)),
		}
		// set keys and tag
		msg.SetKeys("a", "b")
		msg.SetTag("ab")
		// send message in sync
		resp, err := producer.Send(context.TODO(), msg)
		if err != nil {
			log.Fatal(err)
		}
		for i := 0; i < len(resp); i++ {
			fmt.Printf("%#v\n", resp[i])
		}
		// wait a moment
		time.Sleep(time.Second * 1)
	}
}

err msg:

2024-09-18T16:30:57.524+0800	INFO	[email protected]/client.go:494	begin to start the rocketmq client	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024-09-18T16:30:57.524+0800	INFO	[email protected]/client_manager.go:105	begin to start the client manager
2024-09-18T16:30:57.524+0800	INFO	[email protected]/client_manager.go:131	the client manager starts successfully
2024-09-18T16:30:57.536+0800	INFO	[email protected]/rpc_client.go:84	create rpc client success, target=10.203.90.24:30006
2024-09-18T16:30:57.547+0800	INFO	[email protected]/client.go:102	defaultClientSession is startUp! endpoints=scheme:IPv4 addresses:{host:"10.203.90.24" port:30006}	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024-09-18T16:30:57.548+0800	INFO	[email protected]/client.go:489	telemeter to 10.203.90.24:30006 success	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024-09-18T16:30:57.554+0800	INFO	[email protected]/metric.go:184	metric is off, clientId=SISDRV2412@17544@0@h01n9bsjvk
2024-09-18T16:30:57.554+0800	INFO	[email protected]/client.go:97	Executed command successfully	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024-09-18T16:30:57.560+0800	WARN	[email protected]/producer.go:253	failed to send message, would attempt to resend right now, topic=testtopic1, messageId(s)=[010050568CEC9A448806FC29C100000000], maxAttempts=3, attempt=1, endpoints=scheme:IPv4 addresses:{host:"10.203.90.24" port:30006}, requestId=[329c98ec-055f-446d-b8cc-22e3c2eca689]	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024-09-18T16:30:57.565+0800	WARN	[email protected]/producer.go:253	failed to send message, would attempt to resend right now, topic=testtopic1, messageId(s)=[010050568CEC9A448806FC29C100000000], maxAttempts=3, attempt=2, endpoints=scheme:IPv4 addresses:{host:"10.203.90.24" port:30006}, requestId=[329c98ec-055f-446d-b8cc-22e3c2eca689 9ee8e802-4313-4ba2-9933-2a566fb2fb06]	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024-09-18T16:30:57.571+0800	ERROR	[email protected]/producer.go:234	failed to send message(s) finally, run out of attempt times, topic=testtopic1, messageId(s)=[010050568CEC9A448806FC29C100000000], maxAttempts=3, attempt=3, endpoints=scheme:IPv4 addresses:{host:"10.203.90.24" port:30006}, requestId=[329c98ec-055f-446d-b8cc-22e3c2eca689 9ee8e802-4313-4ba2-9933-2a566fb2fb06 8ffd7df2-869d-403d-ac61-d4bb7b3deee3]	{"client_id": "SISDRV2412@17544@0@h01n9bsjvk"}
2024/09/18 16:30:57 CODE: INTERNAL_SERVER_ERROR, MESSAGE: java.lang.NullPointerException, org.apache.rocketmq.common.message.MessageExt.socketAddress2ByteBuffer(MessageExt.java:77)

err log: image

What Did You Expect to See?

send success

What Did You See Instead?

no success

Additional Context

none

jiangxuhui avatar Sep 23 '24 02:09 jiangxuhui

请问是否解决掉了 我也遇到此问题 我们是双栈k8s 环境

TickFairy avatar Nov 13 '24 03:11 TickFairy

请问是否解决掉了 我也遇到此问题

放弃了,用kafka吧。阿里系的东西管生不管养,不赚钱,说不准明天就砍掉了

jiangxuhui avatar Nov 13 '24 03:11 jiangxuhui

请问是否解决掉了 我也遇到此问题

放弃了,用kafka吧。阿里系的东西管生不管养,不赚钱,说不准明天就砍掉了

哈哈

TickFairy avatar Nov 13 '24 05:11 TickFairy

Image

zonghaishang avatar Mar 17 '25 03:03 zonghaishang