simulot / immich-go

An alternative to the immich-CLI command that doesn't depend on nodejs installation. It tries its best for importing google photos takeout archives.
GNU Affero General Public License v3.0
1.91k stars 55 forks source link

Failed to get local machine timezone: "/etc/localtime" is not a symlink - cannot infer name #525

Closed seryrzu closed 3 weeks ago

seryrzu commented 3 weeks ago

Running either the latest build for Linux x86_64 or building immich-go from source, results in the following issue.

$ ./immich-go --help
panic: failed to get local machine timezone: "/etc/localtime" is not a symlink - cannot infer name

goroutine 1 [running]:
github.com/simulot/immich-go/immich/metadata.init.0()
        /var/services/homes/seryrzu/soft/immich-go/immich/metadata/timezone.go:15 +0x5c

I do this on a Synology NAS, that is technically a Linux

uname --all
Linux <> 4.4.302+ <> Fri Jan 12 17:01:14 CST 2024 x86_64 GNU/Linux <>

and Linux is supposed to (?) have a symlink at /etc/localtime, but in my case it is a binary.

A temporary fix that I found is to set env variable first

$ export TZ="America/Los_Angeles"
./immich-go --help

It would be cool if there is an automated solution for this or at least a clarification in the manual. Thanks!

simulot commented 3 weeks ago

Another workaround is to use the time-zone=time_zone_name option

I don't know how to make it working in all cases. I was glad enough to get it working for linux (ubuntu at least), freeBSD and MacOS 😅 I think to remove this dependence in the future.