Encounter error Requested API version requires a newer version of this header

Hi experts,

I encountered issues when I tried to run go get github.com/apple/foundationdb/bindings/go/src/fdb on both fdb v6.3.18 and v6.2.29 environment , I am not sure if there is anything need to configure, thanks!

  1. For fdb v6.3.18:
[root@cdcliyue1 go]# fdbcli -v
FoundationDB CLI 6.3 (v6.3.18)
source version 6efe82c759fbac4f841f799d0d75768b1e9182cd
protocol fdb00b063010001
[root@cdcliyue1 go]# go get github.com/apple/foundationdb/bindings/go/src/fdb
# github.com/apple/foundationdb/bindings/go/src/fdb
In file included from /opt/gocode/src/github.com/apple/foundationdb/bindings/go/                                                                             src/fdb/database.go:26:0:
/usr/include/foundationdb/fdb_c.h:34:2: error: #error Requested API version requ                                                                             ires a newer version of this header
 #error Requested API version requires a newer version of this header

In /usr/include/foundationdb/fdb_c.h:34, I found
...
#elif FDB_API_VERSION > 630
#error Requested API version requires a newer version of this header
#endif
...
[root@cdcliyue1 go]# go version
go version go1.11.4 linux/amd64
  1. For fdb v6.2.29:
[root@fdbliyyue1 ~]# fdbcli -v
FoundationDB CLI 6.2 (v6.2.29)
source version f3aef311ccfbbd66ae3fff6afe88a43de1d39707
protocol fdb00b062010001
[root@fdbliyyue1 ~]# go get github.com/apple/foundationdb/bindings/go/src/fdb
# github.com/apple/foundationdb/bindings/go/src/fdb
In file included from /opt/gocode/pkg/mod/github.com/apple/foundationdb/bindings/go@v0.0.0-20220113225319-07e531947765/src/fdb/database.go:26:
/usr/include/foundationdb/fdb_c.h:35:2: error: #error Requested API version requires a newer version of this header
 #error Requested API version requires a newer version of this header

...
#elif FDB_API_VERSION > 620
#error Requested API version requires a newer version of this header
#endif
...
[root@fdbliyyue1 ~]# go version
go version go1.16.10 linux/amd64

If you go get from github, it pulls main, which is on 7.1. You’ll need to fetch the go bindings as of the specific version that you have installed locally.

If you use go modules, then I think something like go get github.com/apple/foundationdb/bindings/go/src/fdb@6.2.29 (to pull the go bindings code as of the 6.2.29 tag) should work.

1 Like

Thank you so much! I can pass the command now:
[root@fdbliyyue1 ~]# go get github.com/apple/foundationdb/bindings/go/src/fdb@6.2.29
go: downloading github.com/apple/foundationdb/bindings/go v0.0.0-20201222225940-f3aef311ccfb

We should add this to the Go documentation, this will ease on-boarding new gophers.

1 Like