I use json.marshal api encoding a struct and then send the marshalled data to geth. It's oK to unmarshal the data locally, but geth returns a error when unmarshalling it. I don't why, please give me some advice, thanks.

When i specify this error, it returns a message "err="json: cannot unmarshal non-string into Go struct field Filterinput.ContractAddress of type common.Address". it's log15 error in geth, but i can't figure out what the log15 is used for

  • I figured it out. It's because i embed the struct marshalled with a self-defined type, while in geth client, the json.marshal can't identify this self-defined type. So just changing this type to a common type is OK – Jocelyn Mar 21 '19 at 11:23

For anyone who is developing on Go version of Ethereum, and followed the error: “Normalized odd number of arguments by adding nil” to here.

It is actually an error message from log15. Which means you must feed even number items to the log function. For example:

log.Info("some_str", item1, item2)


log.Info("some_str", item1, item2, item3, item4)

Check out the source code explanation of log15: here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.