mathieuprog / tz

Time zone support for Elixir
Apache License 2.0
125 stars 11 forks source link

required files missing in CI #25

Open mayel opened 6 months ago

mayel commented 6 months ago

I'm getting this error only in a particular CI env and not sure why, are those files that tz is meant to download or expects to already be there, and if so where do they usually come from?



    ** (EXIT) an exception was raised:

        ** (RuntimeError) files ["antarctica", "asia", "australasia", "backward", "etcetera", "europe", "northamerica", "southamerica", "iso3166.tab", "zone1970.tab"] are missing in /var/www/bonfire/_build/prod/rel/bonfire/lib/tz-0.26.5/priv/tzdata2023d

            (tz 0.26.5) lib/tz/compiler.ex:196: Tz.Compiler.validate_tzdata_dir_has_required_files/1

            (tz 0.26.5) lib/tz/compiler.ex:15: Tz.Compiler.compile/0

            (tz 0.26.5) lib/tz/updater.ex:23: Tz.Updater.maybe_recompile/0

            (tz 0.26.5) lib/tz/update_periodically.ex:31: Tz.UpdatePeriodically.init/1

            (stdlib 4.0.1) gen_server.erl:848: :gen_server.init_it/2

            (stdlib 4.0.1) gen_server.erl:811: :gen_server.init_it/6

            (stdlib 4.0.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3

[os_mon] memory supervisor port (memsup): Erlang has closed
lapineige commented 5 months ago

If we can help to debug this (by explaining the CI context for instance), feel free to ping :)

lapineige commented 5 months ago

Referencing https://github.com/YunoHost-Apps/bonfire_ynh/pull/5#issuecomment-1924190658

Apparently it's not only a CI issue. If you have any idea of to debug this, it would be very appreciated :)

mathieuprog commented 5 months ago

Looking at the error of @lapineige it doesn't prevent your app to start but only prevents updating tz, right?

What is your tz config? Are you using the :data_dir option? In which environment does this happen? Do you have that problem in localhost/dev or only when deployed?

mayel commented 5 months ago

Based on messages like Erlang has closed or Application bonfire exited: Bonfire.Application.start(:normal, []) returned an error: shutdown: failed to start child: Tz.UpdatePeriodically I'm pretty sure it's preventing the app from starting, right @lapineige?

IIRC the only config is:

config :tzdata, :autoupdate, :disabled
config :elixir, :time_zone_database, Tz.TimeZoneDatabase

and in Application supervision tree {Tz.UpdatePeriodically, [interval_in_days: 10]}

The environment is an Elixir/OTP release built and running within https://yunohost.org (Debian-based and the whole setup is defined in code rather than manually). I haven't seen this issue when running a release in Docker or in dev.

lapineige commented 5 months ago

Looking at the error of @lapineige it doesn't prevent your app to start but only prevents updating tz, right?

In that case it seems to fail the app start. In the CI and other people install situations, it prevent the first start.

In which environment does this happen?

A Yunohost x86 server on Debian 11, I don't know what information would be meaningful.

Do you have that problem in localhost/dev or only when deployed?

I'm deploying and app.

lapineige commented 5 months ago

I can provide details about how the thing is installed in Yunohost environment. The main thing I guess is that it's a dedicated NodeJS (18 if I remember correctly) version for this app, and not a global npm package installation. It's running with the bonfire user and file rights, not root or whatever.

lapineige commented 3 months ago

Do you need additional details to help us on this issue ?

mayel commented 3 months ago

@lapineige how can one trigger such a build and observe its output?

lapineige commented 3 months ago

It's not that quick, but relatively simple. You would need a Yunohost environment.

Basically:

I can provide more details if needed.

mayel commented 3 months ago

couldn't we also do it by forking a repo and getting github's CI to run it?

lapineige commented 3 months ago

Oh yes you're right. A PR with a dedicated branch in the repo is possible too (I can provide help on this, because you need write access). As for forking the repo, the CI won't be launched if it's not in Yunohost-Apps.

mathieuprog commented 1 day ago

Sorry I'm not proficient with CI/deploys. We expect the files to be there: https://github.com/mathieuprog/tz/blob/v0.26.5/lib/tz/compiler.ex#L15

Those are under the /priv folder in this library: https://github.com/mathieuprog/tz/tree/v0.26.5/priv/tzdata2023c

Could you clarify the problem and context in further details?