[ZBX-25424] Cannot build Zabbix agent2 or plugins on el6 using latest go 1.22 or 1.23 Created: 2024 Oct 22  Updated: 2024 Nov 25  Resolved: 2024 Nov 25

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G), Agent2 plugin (G)
Affects Version/s: 6.0.35rc1, 7.0.6rc1
Fix Version/s: 6.0.37rc1, 7.0.7rc1, 7.2.0rc1

Type: Documentation task Priority: Trivial
Reporter: Jurijs Klopovskis Assignee: Jurijs Klopovskis
Resolution: Fixed Votes: 0
Labels: rhel6
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Team D
Sprint: Prev.Sprint, S24-W44/45
Story Points: 1

 Description   

On rhel/centos 6 (x86_64)

Try building 6.0.35 or 7.0.5 Zabbix agent2 or any of the plugins and get an error.

# runtime/cgo
cc1: warnings being treated as errors
gcc_libinit.c: In function '_cgo_wait_runtime_init_done':
gcc_libinit.c:51: error: implicit declaration of function '__atomic_load_n'
gcc_libinit.c:51: error: '__ATOMIC_CONSUME' undeclared (first use in this function)
gcc_libinit.c:51: error: (Each undeclared identifier is reported only once
gcc_libinit.c:51: error: for each function it appears in.)
gcc_libinit.c:78: error: implicit declaration of function '__atomic_store_n'
gcc_libinit.c:78: error: '__ATOMIC_RELEASE' undeclared (first use in this function)
gcc_libinit.c: In function 'x_cgo_notify_runtime_init_done':
gcc_libinit.c:129: error: '__ATOMIC_RELEASE' undeclared (first use in this function)
gcc_libinit.c: In function 'x_cgo_set_context_function':
gcc_libinit.c:137: error: '__ATOMIC_RELEASE' undeclared (first use in this function)
gcc_libinit.c: In function '_cgo_get_context_function':
gcc_libinit.c:142: error: '__ATOMIC_CONSUME' undeclared (first use in this function)
make[2]: *** [golang.zabbix.com/agent2/cmd/zabbix_agent2] Error 1
make[2]: Leaving directory `/tmp/build-rhel-6-x86_64.DSYAOldw/buildroot/BUILD/zabbix-6.0.35/src/go'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/build-rhel-6-x86_64.DSYAOldw/buildroot/BUILD/zabbix-6.0.35/src'
make: *** [all-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.e23ISj (%build)

Agent2 as well as mongodb, postgresql and ember-plus plugins can be built with an older unsupported version of go 1.21.3.

For mssql a different error is produced

+ make
go: downloading go1.22 (linux/amd64)
go: download go1.22 for linux/amd64: toolchain not available
go: downloading go1.22 (linux/amd64)
go: download go1.22 for linux/amd64: toolchain not available
GOOS="" GOARCH="" go build -o "/tmp/build-rhel-6-x86_64.91uTahlr/buildroot/BUILD/zabbix-agent2-plugin-mssql-6.0.35/zabbix-agent2-plugin-mssql"
go: downloading go1.22 (linux/amd64)
go: download go1.22 for linux/amd64: toolchain not available
make: *** [build] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.IEfygF (%build)

In general it is suboptimal to use an old unsupported version of go.



 Comments   
Comment by Arturs Dancis [ 2024 Nov 19 ]

Documentation updated:

Generated at Wed May 28 06:47:44 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.