Go SDK dependency build issues

I'm attempting to use the openziti/sdk-golang SDK to build a Go application, somewhat similar to example/jwtchat/jwtchat-server. When trying to build the application, the following errors occur:

RUN CGO_ENABLED=0 GOOS=linux go build -o proxy .:
22.62 # github.com/openziti/identity/engines/parsec
22.62 /go/pkg/mod/github.com/openziti/identity@v1.0.101/engines/parsec/parsec_engine.go:20:18: undefined: pfxlog.ContextLogger
23.95 # github.com/openziti/transport/v2/proxies
23.95 /go/pkg/mod/github.com/openziti/transport/v2@v2.0.171/proxies/http_connect.go:60:20: pfxlog.Logger().WithError undefined (type pfxlog.Builder has no field or method WithError)
30.89 # github.com/openziti/sdk-golang/ziti/edge/posture
30.89 /go/pkg/mod/github.com/openziti/sdk-golang@v1.1.0/ziti/edge/posture/cache.go:119:26: cannot use err (variable of type []error) as string value in argument to pfxlog.Logger().Error

We're using Go version 1.24.0, and the dependency is require github.com/openziti/sdk-golang v1.1.0, which has the following indirect dependencies (of note):

github.com/openziti/identity v1.0.101 // indirect
github.com/openziti/transport/v2 v2.0.171 // indirect

Any assistance would be greatly appreciated, thanks.

Not entirely sure what has changed, but the error has changed to:

31.67 # github.com/openziti/sdk-golang/ziti/edge
31.67 /go/pkg/mod/github.com/openziti/sdk-golang@v1.1.0/ziti/edge/channel.go:168:34: cannot use self (variable of type *DialSdkChannel) as channel.GroupedUnderlayFactory value in argument to self.constraints.Apply: *DialSdkChannel does not implement channel.GroupedUnderlayFactory (wrong type for method CreateGroupedUnderlay)
31.67           have CreateGroupedUnderlay(string, string, time.Duration) (channel.Underlay, error)
31.67           want CreateGroupedUnderlay(string, []byte, string, time.Duration) (channel.Underlay, error)
31.67 /go/pkg/mod/github.com/openziti/sdk-golang@v1.1.0/ziti/edge/channel.go:178:29: cannot use self (variable of type *DialSdkChannel) as channel.GroupedUnderlayFactory value in argument to self.constraints.Apply: *DialSdkChannel does not implement channel.GroupedUnderlayFactory (wrong type for method CreateGroupedUnderlay)
31.67           have CreateGroupedUnderlay(string, string, time.Duration) (channel.Underlay, error)
31.67           want CreateGroupedUnderlay(string, []byte, string, time.Duration) (channel.Underlay, error)

Hi @sdundas,
Your errors look like they're caused by upstream version mismatches.

Make sure you're using:

github.com/michaelquigley/pfxlog v0.6.10
github.com/openziti/channel/v4 v4.0.6

A new version of the golang sdk should be released soon which is compatible with the latest channel release.

Paul

1 Like