More Useful Log When Auth Fails to Execution Client (#10609)

* more helpful auth message when auth to engine does not work

* better language

* clarity

* check for 401

* fix panic

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Raul Jordan 2022-05-03 18:40:08 +00:00 committed by GitHub
parent 55883876e4
commit 5315c45453
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import (
"context"
"fmt"
"math/big"
"strings"
"time"
"github.com/ethereum/go-ethereum/common"
@ -287,6 +288,13 @@ func handleRPCError(err error) error {
}
e, ok := err.(rpc.Error)
if !ok {
if strings.Contains(err.Error(), "401 Unauthorized") {
log.Error("HTTP authentication to your execution client is not working. Please ensure " +
"you are setting a correct value for the --jwt-secret flag in Prysm, or use an IPC connection if on " +
"the same machine. Please see our documentation for more information on authenticating connections " +
"here https://docs.prylabs.network/docs/execution-node/authentication")
return fmt.Errorf("could not authenticate connection to execution client: %v", err)
}
return errors.Wrap(err, "got an unexpected error")
}
switch e.ErrorCode() {