[ZBX-19496] Agent2 build should be reproducible Created: 2021 Jun 01  Updated: 2024 Apr 10  Resolved: 2022 Nov 08

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 5.4.0
Fix Version/s: 6.4 (plan)

Type: Problem report Priority: Major
Reporter: Sergey Assignee: Jurijs Klopovskis
Resolution: Fixed Votes: 0
Labels: agent
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Causes
Duplicate
Sub-task
Team: Team I
Sprint: Sprint 77 (Jun 2021), Sprint 78 (Jul 2021), Sprint 79 (Aug 2021), Sprint 80 (Sep 2021), Sprint 81 (Oct 2021), Sprint 82 (Nov 2021), Sprint 83 (Dec 2021), Sprint 84 (Jan 2022), Sprint 85 (Feb 2022), Sprint 86 (Mar 2022), Sprint 87 (Apr 2022), Sprint 88 (May 2022), Sprint 89 (Jun 2022), Sprint 90 (Jul 2022), Sprint 91 (Aug 2022), Sprint 92 (Sep 2022), Sprint 93 (Oct 2022), Sprint 94 (Nov 2022)
Story Points: 1

 Description   

Steps to reproduce:

  1. Upload the sources of Zabbix to the server/pc without access to the Internet
  2. ./configure --enable-agent2
  3. make install

Result:
go: github.com/BurntSushi/[email protected]: Get "https://proxy.golang.org/github.com/%21burnt%21sushi/locker/@v/v0.0.0-20171006230638-a6e239ea1c69.mod": dial tcp: lookup proxy.golang.org on ...:53: server misbehaving

As the server doesn't have access to the Internet, Agent2 cannot be built from the sources as it tries to fetch Go modules from the Internet.

Expected:
The build should be reproducible in any environment.

There could be no Internet or could be some Internet problems, there could be issues with the availability of github.com or gopkg.in. Or even the needed version of some Go module or the module itself could be deleted, and you will have a broken build.

 

Go modules should be vendored within the source code of Zabbix to be sure to avoid described issues.



 Comments   
Comment by Dmitry Krupornitsky [ 2021 Jun 03 ]

Dear Sergey,

It is clearly stated on an installation page, that a Go language compiler is required for compiling a Zabbix agent 2:  https://www.zabbix.com/documentation/current/manual/installation/install

The Go compiler is a separate project with its own licensing. One should take care of obtaining a compiler package prior to building an agent 2 on a machine without internet access.

Comment by Sergey [ 2021 Jun 03 ]

Dear Dmitry.

 

I think you misunderstood me. Or I incorrectly described the issue.

I was talking about Go modules that used in Zabbix Agent 2, and not about the Go compiler itself.

Comment by Oleksii Zagorskyi [ 2021 Jun 03 ]

This is arguable. Let's keep this opened for now.

Comment by Alex Kalimulin [ 2022 Aug 19 ]

No firm promises, but the current ETA is September 2022.

Comment by Sergey [ 2022 Nov 01 ]

That is a good news. Thank you. As I can understand, the feature is almost done.

Comment by Jurijs Klopovskis [ 2022 Nov 01 ]

That is a good news. Thank you. As I can understand, the feature is almost done.

Yes. Starting with the upcoming release, Zabbix source tarball will contain src/go/vendor directory, which should force golang to not download dependency modules automatically, allowing for an offline build.

You can still update to the latest modules manually using go mod tidy or go get commands.

Also note, that some agent2 functionality has been moved into external plugins, so you have to build and deploy these also it you need that particular functionality.

Comment by Martins Valkovskis [ 2022 Nov 02 ]

Updated documentation:

Generated at Tue Apr 15 14:35:31 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.