Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: tiproxy 无法使用
[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachment: Screenshot / Logs / Monitoring]
CentOS 7, downloaded the TiProxy binary package
https://github.com/pingcap/TiProxy/releases/download/v0.1.1/TiProxy_0.1.1_linux_amd64v3.tar.gz
Error when checking the version after extraction
$ ./tiproxy --version
./tiproxy: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by ./tiproxy)
./tiproxy: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by ./tiproxy)
ldd --version
Is the glibc version insufficient?
Instant reply, it’s not enough, so
I guess we need to upgrade glibc, but this is very risky…
Unacceptable, the operating environment requirements for tiproxy are a bit high.
It should just be an issue with the glibc associated with this installation package.
I compiled it once, and as long as you add go to the PATH variable, a single make command will compile it.
At most, if you think the dependent go packages are downloading slowly, you can additionally set
export GO111MODULE=on
export GOPROXY=https://goproxy.io
and it will work.
That’s right, there’s no problem with compiling it yourself. This is just to discover other issues in advance. Adding the operating system version to tiproxy’s asset would be better; just writing “linux” is too broad.
Boss, try installing this version as instructed and see if it works.
I found that the package in the GitHub repo asset is compiled under the latest Ubuntu, with CGO_ENABLED=1 enabled by default. Also, the go mod is still using go 1.19. The tiproxy version update is a bit slow, and various versions are not aligned. I will explain in more detail later. Since it hasn’t reached GA, it’s normal to have issues. I believe these will be fixed later.
There are many similar issues, such as:
go, heroku
opened 03:16PM - 15 Dec 22 UTC
closed 10:31PM - 15 Dec 22 UTC
Unfortunate
NeedsInvestigation
FrozenDueToAge
GoCommand
<!--
Please answer these questions before submitting your issue. Thanks!
-->
…
### What version of Go are you using (`go version`)?
<pre>
$ ~/go/bin/go version
go version go1.19.4 linux/amd64
</pre>
### Does this issue reproduce with the latest release?
This is the latest stable release from the website.
### What operating system and processor architecture are you using (`go env`)?
<details><summary><code>go env</code> Output</summary><br><pre>
$ ~/go/bin/go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ubuntu/.cache/go-build"
GOENV="/home/ubuntu/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/ubuntu/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/ubuntu/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/ubuntu/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/ubuntu/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.4"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build646395045=/tmp/go-build -gno-record-gcc-switches"
</pre></details>
### What did you do?
<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on go.dev/play is best.
-->
Building a minimal binary (using `net/http` code) with `-trimpath` on Ubuntu 22.04 makes it incompatible with Ubuntu 20.04:
```
ubuntu@jammy:~$ cat main.go
package main
import "fmt"
import "net/http"
func main() {
fmt.Println("Hello World")
http.ListenAndServe(":8080", nil)
}
ubuntu@jammy:~$ ~/go/bin/go build -o main-jammy -trimpath ./main.go
```
Copying the resulting binary to an Ubuntu 20.04 machine yields the following error:
```
$ ./main-jammy
./main-jammy: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./main-jammy)
./main-jammy: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./main-jammy)
```
Dropping `-trimpath` from the `go build` call and the binary works.
### What did you expect to see?
Invoking `main-jammy` on an Ubuntu 20.04 machine should yield `Hello World` and start a webserver.
### What did you see instead?
```
$ ./main-jammy
./main-jammy: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./main-jammy)
./main-jammy: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./main-jammy)
```
### Context
Github Actions is currently rolling out Ubuntu 22.04 for its `ubuntu-latest` tag and as a result some of our releases are becoming invalid with Ubuntu 20.0.
opened 09:39PM - 15 Feb 23 UTC
closed 10:03PM - 15 Feb 23 UTC
WaitingForInfo
### What version of Go are you using (`go version`)?
<pre>
$ go version
go … version go1.20 darwin/arm64
</pre>
### Does this issue reproduce with the latest release?
yes
### What operating system and processor architecture are you using (`go env`)?
<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/andig/Library/Caches/go-build"
GOENV="/Users/andig/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/andig/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/andig/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/andig/htdocs/evcc/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sv/rs_453y57xj86xsbz3kw1mbc0000gn/T/go-build3562167146=/tmp/go-build -gno-record-gcc-switches -fno-common"
GOROOT/bin/go version: go version go1.20 darwin/arm64
GOROOT/bin/go tool compile -V: compile version go1.20
uname -v: Darwin Kernel Version 22.2.0: Fri Nov 11 02:04:44 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8103
ProductName: macOS
ProductVersion: 13.1
BuildVersion: 22C65
lldb --version: lldb-1400.0.38.17
Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
</pre></details>
### What did you do?
After upgrading our build environment and `go.mod` requirement to Go 1.20, users started to see this error message on Ubuntu: https://github.com/evcc-io/evcc/issues/6263. The application does not use CGO.
### What did you expect to see?
No error. Same build was working fine with Go ^1.18.
### What did you see instead?
GLIBC version required. This output of `go version -m` should be similar to what the build produces for arm:
build -buildmode=exe
build -compiler=gc
build -ldflags="-X github.com/evcc-io/evcc/server.Version=0.109.2 -X github.com/evcc-io/evcc/server.Commit=3ec2d1b70 -s -w"
build -tags=release
build CGO_ENABLED=0
build GOARCH=arm
build GOOS=linux
build GOARM=6
build vcs=git
build vcs.revision=3ec2d1b70abf2a5a827e43755f5e94df59eb1add
build vcs.time=2022-12-19T13:08:03Z
build vcs.modified=true
Here you go:
TiDB Source Code Compilation: TiProxy Chapter - ShawnYan’s Column - 专栏 - TiDB 7.x 源码编译之 TiProxy 篇,及尝鲜体验 | TiDB 社区
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.