Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
time: cannot find zone in zip file /usr/local/go/lib/time/zoneinfo.zip #34188
What version of Go are you using (
Do you mean you have compiled a go program on some machine with Go 1.11.4, and then you transfer the binary to an Ubuntu 16.04 system without Go installed? And then you get the error on that system?
The compiled binary needs access to time zone data files on the destination system. You need to ensure this. Go cannot do it.
On Ubuntu, you might be missing the tzdata package that has provides /usr/share/zoneinfo contents. Try "apt-get install tzdata".
On the other hand, the error would imply that you have a /usr/local/go/lib/time/zoneinfo.zip file on that Ubuntu system. No ubuntu package should ever install anything to that location. Do you know where that file comes from?
Hi @antong , Thanks for the help!
Yes, I am running go binary as Debian package in Ubuntu(16.x) without go runtime.
And I could see zoneinfo file in usr/share/zoneinfo file system
I run locate zoneinfo command to find the zoneinfo in filesystem, it listdowns all zonefiles as below
It means we have the zoneinfo in the filesystem but go library is not able to locate/find it seems.
i tried setting ZONEINFO variable, that also didn't work
I see two different issues that need to be figured out. First, why does the program not pick up the system tzdata on the Ubuntu system? Second, why can't the program find the zone data in zoneinfo.zip.
@pagidi , Can you confirm that that you have /usr/share/zoneinfo/Asia/Kolkata on your system and that it is readable by the user running your program?
I checked this on Ubuntu 16.04 LTS (is this what you mean with Ubuntu 16.x?). And with tzdata installed, it exists.
For the second issue, can you check whether zoneinfo.zip is readable by the user running your program, and that it contains Asia/Kolkata:
Where did this file /usr/go/lib/time/zoneinfo.zip come from, as you say there is no Go installed? I verified that in the file distributed with Go, the Asia/Kolkata entry does exist.
I used the following program for testing (https://play.golang.org/p/lPgieqX_wj4). Can you verify that this is what you are doing?
Ideally program should try to read it from /usr/share/zoneinfo/, But I am not sure why it tries for /usr/local/go/lib/time/zoneinfo
When I look at /usr/share/zoneinfo/Asia/Kolkata file access, it has full access
ubuntu@dev-vir-abc:/usr/share/zoneinfo/Asia$ ls -l Kolkata
Not sure what I am missing here...
Thanks. Unfortunately I have no explanation for this. The Go code should always look for /usr/share/zoneinfo first. The error message you are seeing is a bit misleading; it was improved in the Go 1.12 release (#20969).
As nobody else has reported this problem I think it is likely to have something to do with your environment, but I don't know what that would be. The next debugging step I would suggest would be to run your program under
The username and directory in the output hints that this may not be a standard way running a binary, but perhaps a snapcraft/snappy app. I don't know much about that architecture, but I've understood that dependencies are bundled and there are different forms of security confinement.
The problem is with my code
Value being passed as "Asia/Kolkata" instead Asia/Kolkata (extra double-quote)
I just trimmed the extra chars using