Coder Social home page Coder Social logo

Crash on startup about tzdata HOT 8 CLOSED

uberbrodt avatar uberbrodt commented on July 22, 2024
Crash on startup

from tzdata.

Comments (8)

FabienHenon avatar FabienHenon commented on July 22, 2024 1

I have the same issue with the same crash when release_ets is empty (:data_dir has been specified and is readable/writable. Everything was working fine a few weeks ago)

from tzdata.

bmurithi avatar bmurithi commented on July 22, 2024 1

Ran into this issue in a live release after a box restart (was using /tmp as the data_dir).

The documentation in the README is pretty clear on how to handle this in releases.

You basically need to copy over _build/prod/lib/tzdata/priv/release_ets during deployment to the configured data_dir in prod.exs or config.exs.

Examples

prod.exs

config :tzdata, :data_dir, "/etc/elixir_tzdata_data"

Docker build example (multi-stage)

COPY --from=builder /app/_build/prod/lib/tzdata/priv/release_ets /etc/elixir_tzdata_data/release_ets/

Ansible Task example

    - name: copy tzdata data release directory
      synchronize:
        src: "_build/prod/lib/tzdata/priv/release_ets"
        dest: "/etc/elixir_tzdata_data"
        use_ssh_args: yes
      tags:
        - code
        - tzdata

from tzdata.

lau avatar lau commented on July 22, 2024

This can happen if you don't have an existing .ets file e.g. priv/release_ets/2017c.ets.

Did you configure the tzdata data_dir with config :tzdata, :data_dir, "/etc/elixir_tzdata_data" ? If so there should be a working .ets file there with timezone data. The tzdata Elixir library ships with one (https://github.com/lau/tzdata/tree/05dcdb4e3f5d05ba1281be9df959a70b52fad9ae/priv/release_ets)

If you are in an "iex" console and run Tzdata.Util.data_dir() this is the dir where there should be an .ets file with the timezone data.

from tzdata.

uberbrodt avatar uberbrodt commented on July 22, 2024

So I did have it configured to use a :data_dir and it was writeable by the process. I tested today and now it seems to work? I guess you can close the issue, I'll re-open if I can reproduce it.

from tzdata.

uberbrodt avatar uberbrodt commented on July 22, 2024

Actually, I was able to replicated it. So here's the issue. If I don't set the data_dir it works fine, but if I set it to an empty, readable/writeable, directory it fails with the above error. So are you saying that I need to have a .ets file there before the app boots? It won't create the .ets file on it's own?

from tzdata.

lau avatar lau commented on July 22, 2024

Thank you for writing about this. If there is no .ets file in the configured directory already it tries to download one at startup. However that functionality might be broken in the current version. I will investigate that.

Yes, if you add a compatible .ets file to that directory (for instance the one that ships with the version of the tzdata hex package), then it should work.

I will add some more information about it to the README.

from tzdata.

lau avatar lau commented on July 22, 2024

I have made a new branch for automatically copying the release from priv to the custom data dir.
See #53
@uberbrodt and @FabienHenon would you mind trying that branch and seeing if it fixes your problems?

from tzdata.

lau avatar lau commented on July 22, 2024

A new version 0.5.15 has just been released. It addresses a configured data_dir without any pre existing release_ets/*.ets files.

from tzdata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.