1

When I updated my appengine logging version to v2. I got these errors.

Package: google.golang.org/appengine/v2/log

import (
    "context"
    "google.golang.org/appengine/v2/log"
)

// LogDebug
func LogDebug(ctx context.Context, format string, args ...interface{}) {
    log.Debugf(ctx, format, args)
}

// LogInfo
func LogInfo(ctx context.Context, format string, args ...interface{}) {
    log.Infof(ctx, format, args)
}

Anyone knows how to resolve this?

Errors:

panic: proto: message appengine.base.StringProto is already registered

See https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict

google.golang.org/protobuf/reflect/protoregistry.glob..func1(0xf2a3d8, 0xc0001a4c00, 0xf11ac0, 0xc0002a8370, 0xdce5a0)

/layers/google.go.gomod/gopath/pkg/mod/google.golang.org/protobuf@v1.27.1/reflect/protoregistry/registry.go:54 +0x25f

/layers/google.go.gomod/gopath/pkg/mod/google.golang.org/protobuf@v1.27.1/reflect/protoregistry/registry.go:577 +0x32d

github.com/golang/protobuf/proto.RegisterType(0xf1d6f0, 0x0, 0xdf658a, 0x1a)

/layers/google.go.gomod/gopath/pkg/mod/google.golang.org/appengine@v1.6.7/internal/base/api_base.pb.go:280 +0x4f

Start program failed: failed to detect app after start: ForAppStart():
Kboyz
  • 179
  • 4
  • 13
  • I'd bet you have some code (maybe from a 3rd-party package) still importing `google.golang.org/appengine/log`. So the both package try to register whatever thing from your pic (which I'm unable to copy and paste, thanks), and whichever manages to do that fitst, succeeds, and the second one fails. – kostix Dec 15 '22 at 10:56
  • 2
    Please do not post images of text; here's [why](https://meta.stackoverflow.com/a/285557/720999). Think for a moment, how anyone supposed to help you would type that error message to make a query to their Internet search engine of choice? You have optimized your time to post your message at the expense of those supposed to help. That obviously sucks – kostix Dec 15 '22 at 10:56
  • Okay copy that @kostix. Thanks – Kboyz Dec 15 '22 at 10:59

0 Answers0