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

"Received malformed payload" on match_data_send when upgrading to V3 #59

Open
mlvhub opened this issue Oct 26, 2022 · 11 comments
Open

"Received malformed payload" on match_data_send when upgrading to V3 #59

mlvhub opened this issue Oct 26, 2022 · 11 comments
Labels
question Further information is requested

Comments

@mlvhub
Copy link

mlvhub commented Oct 26, 2022

Hello, I followed the Defold+Nakama tutorial and created a similar game, then tried to upgrade the libraries to V3 and started getting errors on the server with "Received malformed payload".

I had some differences in code and setup so I continued my testing on the xoxo sample project branch and got the same results. Tried with multiple versions of the Nakama server and same thing.

Here's the decoded payload the server was complaining about:

{"match_data_send":{"op_code":1,"data":"{\"row\":1,\"col\":1}","match_id":"1325d106-4ea1-495f-be90-f0d33d73777c.nakama1"},"cid":"3"}

When going back to main and enabling debug level on the server but I could only find this message:

{"level":"debug","ts":"2022-10-26T19:35:35.207Z","caller":"server/pipeline.go:66","msg":"Received *rtapi.Envelope_MatchDataSend message","uid":"3a59222c-9749-4100-869f-0fe975a72be0","sid":"4cb4ce7b-5565-11ed-9018-7106fdcb5b46","cid":"3","message":{"MatchDataSend":{"match_id":"da0d6d5e-9665-4943-90af-785050561cdd.nakama1","op_code":1,"data":"eyJyb3ciOjEsImNvbCI6M30="}}}

There are some visible differences:

  • the key of the message: match_data_send vsMatchDataSend
  • data: it's a json string on V3 and it's base64 in the older version

Not sure if they should match one to one though, could be a red herring.

@britzl
Copy link
Collaborator

britzl commented Oct 27, 2022

Are you testing with the code on main or are you using the latest release?

The 3.0.3 version does not contain the fix for this issue

@mlvhub
Copy link
Author

mlvhub commented Oct 27, 2022

I'm testing the latest release, that explains it then, thanks.

@britzl
Copy link
Collaborator

britzl commented Oct 27, 2022

I'm testing the latest release, that explains it then, thanks.

I've requested a new release which includes the fix.

#61

@mlvhub
Copy link
Author

mlvhub commented Oct 27, 2022

That's great, thank you! I can confirm both my project and the example project work by using the master branch.

@ufgo
Copy link

ufgo commented Oct 30, 2022

I also had such a problem on the release, now I have a message sent on the master, but it does not go further

function M.sendMessage()
	nakama.sync(function()
		local data = json.encode({
			row = 11,
			col = 22,
		})
		--data=base64.encode(data)
		local op_code = 1
		local result = nakama_socket.match_data_send(socket, matchID, op_code, data)
		print("sended")
		if result.error then
			print(result.error.message)
			pprint(result)
		else
			print("ok!!!")
		end
	end)
end

print("sended") - is not running

@britzl
Copy link
Collaborator

britzl commented Oct 30, 2022

@ufgo which version of the Nakama client are you using? The fact that you don't see the print() indicates that something crashes in the coroutine, but for some reason the error is not shown (I'll look into this)-

@britzl
Copy link
Collaborator

britzl commented Oct 30, 2022

but for some reason the error is not shown (I'll look into this)

Ah, logging is silent by default. Enable logging by doing this:

local log = require "nakama.util.log"
log.print()

@ufgo
Copy link

ufgo commented Oct 30, 2022

i use log. Nothing print about my problem
only log in docker:
nakama-nakama-1 | {"level":"debug","ts":"2022-10-30T08:44:37.293Z","caller":"server/pipeline.go:65","msg":"Received *rtapi.Envelope_MatchDataSend message","uid":"f590a664-17b8-436c-8b57-037106dd7f93","sid":"e65afced-582e-11ed-9223-7106fdcb5b46","cid":"3","message":{"MatchDataSend":{"match_id":"3cc2b731-0cc6-496d-b957-6468de15b112.","op_code":1,"data":"eyJjb2wiOjIyLCJyb3ciOjExfQ=="}}}

@britzl
Copy link
Collaborator

britzl commented Nov 1, 2022

Can you share a minimal repro case so that I can take a look?

@britzl britzl added the question Further information is requested label Nov 1, 2022
@britzl
Copy link
Collaborator

britzl commented Nov 27, 2023

Closing due to inactivity. I was also not able to repro any problem myself.

@goodiesohhi
Copy link

I seem to have this problem as well. tho. I raised my own issue #80

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

No branches or pull requests

4 participants