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

Bug: Mainnet public-key endpoint returns: invalid character '\u003c' looking for beginning of value #594

Open
tboeckmann opened this issue Mar 21, 2020 · 1 comment
Labels

Comments

@tboeckmann
Copy link
Member

tboeckmann commented Mar 21, 2020

Describe the bug

Intermittently, when I call the public-key endpoint on Mainnet, I get the following error:

{"code":500,"message":"invalid character '\u003c' looking for beginning of value"}

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'http://127.0.0.1:8080/api/public-key?protocol=ethereum&network=mainnet&address=0x4AD2b251246aAFC2F3bDf3B690DE3bf906622c51'
  2. See error

What version of Mailchain are you using ?
$ mailchain version
Version: v0.0.48

Expected behavior

Response should be the same as ropsten:

{"public-key":"0x4724198e88535f9c8755178abd396d2ce4448f904c99896b69bdf89f0b764fd63dd826333b48987fef02822a8136dcb04e3c2d3f9e2dc19f6e9d8fe5ba7987d6","public-key-encoding":"hex/0x-prefix","public-key-kind":"secp256k1","supported-encryption-types":["aes256cbc","noop"]}

More info
From the console:

ERRO[2020-03-21T13:21:51Z] status 500: invalid character '<' looking for beginning of value
github.com/mailchain/mailchain/internal/clients/blockscout.APIClient.getTransactionsByAddress
	/go/src/github.com/mailchain/mailchain/internal/clients/blockscout/api.go:79
github.com/mailchain/mailchain/internal/clients/blockscout.APIClient.PublicKeyFromAddress
	/go/src/github.com/mailchain/mailchain/internal/clients/blockscout/pubkey_finder.go:35
github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers.GetPublicKey.func1
	/go/src/github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers/pubkey.go:60
net/http.HandlerFunc.ServeHTTP
	/usr/local/go/src/net/http/server.go:2007
github.com/gorilla/mux.(*Router).ServeHTTP
	/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:212
github.com/urfave/negroni.Wrap.func1
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:46
github.com/urfave/negroni.HandlerFunc.ServeHTTP
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:29
github.com/urfave/negroni.middleware.ServeHTTP
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:38
github.com/rs/cors.(*Cors).ServeHTTP
	/go/pkg/mod/github.com/rs/[email protected]/cors.go:252
github.com/urfave/negroni.middleware.ServeHTTP
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:38
github.com/urfave/negroni.(*Negroni).ServeHTTP
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:96
net/http.serverHandler.ServeHTTP
	/usr/local/go/src/net/http/server.go:2802
net/http.(*conn).serve
	/usr/local/go/src/net/http/server.go:1890
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1357
github.com/mailchain/mailchain/internal/clients/blockscout.APIClient.PublicKeyFromAddress
	/go/src/github.com/mailchain/mailchain/internal/clients/blockscout/pubkey_finder.go:37
github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers.GetPublicKey.func1
	/go/src/github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers/pubkey.go:60
net/http.HandlerFunc.ServeHTTP
	/usr/local/go/src/net/http/server.go:2007
github.com/gorilla/mux.(*Router).ServeHTTP
	/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:212
github.com/urfave/negroni.Wrap.func1
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:46
github.com/urfave/negroni.HandlerFunc.ServeHTTP
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:29
github.com/urfave/negroni.middleware.ServeHTTP
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:38
github.com/rs/cors.(*Cors).ServeHTTP
	/go/pkg/mod/github.com/rs/[email protected]/cors.go:252
github.com/urfave/negroni.middleware.ServeHTTP
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:38
github.com/urfave/negroni.(*Negroni).ServeHTTP
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:96
net/http.serverHandler.ServeHTTP
	/usr/local/go/src/net/http/server.go:2802
net/http.(*conn).serve
	/usr/local/go/src/net/http/server.go:1890
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1357
github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers.GetPublicKey.func1
	/go/src/github.com/mailchain/mailchain/cmd/mailchain/internal/http/handlers/pubkey.go:66
net/http.HandlerFunc.ServeHTTP
	/usr/local/go/src/net/http/server.go:2007
github.com/gorilla/mux.(*Router).ServeHTTP
	/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:212
github.com/urfave/negroni.Wrap.func1
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:46
github.com/urfave/negroni.HandlerFunc.ServeHTTP
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:29
github.com/urfave/negroni.middleware.ServeHTTP
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:38
github.com/rs/cors.(*Cors).ServeHTTP
	/go/pkg/mod/github.com/rs/[email protected]/cors.go:252
github.com/urfave/negroni.middleware.ServeHTTP
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:38
github.com/urfave/negroni.(*Negroni).ServeHTTP
	/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:96
net/http.serverHandler.ServeHTTP
	/usr/local/go/src/net/http/server.go:2802
net/http.(*conn).serve
	/usr/local/go/src/net/http/server.go:1890
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1357 
@tboeckmann tboeckmann added bug Something isn't working area/public-key-finder labels Mar 21, 2020
@stale
Copy link

stale bot commented Jul 19, 2020

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Mailchain team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the master branch, please reply in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please reply in order to keep the issue open. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant