#EH4 Test Error “Found extra data:”

I’m not sure why I’m getting this error.

[replication-6] master: Received bytes: "*3\r\n$8\r\nREPLCONF\r\n$14\r\nlistening-port\r\n$4\r\n6380\r\n"
[replication-6] master: Received RESP value: ["REPLCONF", "listening-port", "6380"]
[replication-6] Received ["REPLCONF", "listening-port", "6380"]
[replication-6] master: Sent "OK"
[replication-6] master: Sent bytes: "+OK\r\n"
[your_program] Connected to master node at:
[your_program] localhost:6379
[replication-6] master: Received bytes: "*5\r\n$8\r\nREPLCONF\r\n$4\r\ncapa\r\n$3\r\neof\r\n$4\r\ncapa\r\n$6\r\npsync2\r\n"    
[replication-6] master: Received RESP value: ["REPLCONF", "capa", "eof", "capa", "psync2"]
[replication-6] Received ["REPLCONF", "capa", "eof", "capa", "psync2"]
[replication-6] Found extra data: "*5\r\n$8\r\nREPLCONF\r\n$4\r\ncapa\r\n$3\r\neof\r\n$4\r\ncapa\r\n$6\r\npsync2\r\n*3\r\n$5\r\nPSYNC\r\n$1\r\n?\r\n$2\r\n-1\r\n"
[replication-6] Test failed

here is the code

	_, err = conn.Write(respArray([]string{
		"REPLCONF",
		"capa",
		"eof",
		"capa",
		"psync2",
	}))

	if err != nil {
		fmt.Println("failed to send REPLCONF")
		os.Exit(1)
	}

	conn.Write(respArray([]string{
		"PSYNC",
		"?",
		"-1",
	}))

It was problem in my code. sorry nvm

Leaving a note for a benefit of others: If you’re seeing this, the error is that after sending REPLCONF you need to wait for a response before sending PSYNC.

We’ve amended the “found extra data” log to print only the extra data instead of all the bytes received, that seems more friendlier.

@lambrohan thanks for posting this here btw, even though you did fix the issue yourself it’s good to know where people get stuck!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.

Note: I’ve updated the title of this post to include the stage ID (#EH4). You can learn about the stages rename here: Upcoming change: Stages overhaul