Comments (8)
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.
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.
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.
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.
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.
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.
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.
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)
- Argument Error on :ets.lookup in ReleaseReader
- UndefinedFunctionError or wrong gap when date-time hits exactly the start of a gap HOT 1
- Tzdata polling for update HOT 9
- Function to list possible offsets for a time zone HOT 1
- Question: why were the functions related to `zone1970.tab` data removed (module `TableData`)? HOT 4
- Ability to download fresh tz release during build HOT 3
- Erlang 23 HTTPC support - update Hackney to ~> 1.16 HOT 2
- IANA data does not seem to be correctly parsed for America/Whitehorse (Canada/Yukon) and America/Dawson HOT 5
- Compiler warnings on Elixir 1.11.0
- Possible to force HTTP client Hackney
- Invalid gap for the first naive datetime in the gap range
- tzdata_current_release raise an argument error
- Method to convert an alias to a canonical zone? HOT 1
- Dropping hackney dependency HOT 10
- Tzdata 2.0 plans HOT 4
- Update to calendar version 2022g
- tzdata without timezone upon boot: (with time zone database Tzdata.TimeZoneDatabase), reason: :time_zone_not_found HOT 2
- state of this library
- Possible edge case around last rule applicable for a zone lines last year HOT 4
- Mainteners
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tzdata.