cli: prevent demo and start from working if TZ db not avail#45680
cli: prevent demo and start from working if TZ db not avail#45680tbg merged 1 commit intocockroachdb:masterfrom
demo and start from working if TZ db not avail#45680Conversation
ajwerner
left a comment
There was a problem hiding this comment.
Should we provide a mechanism to allow a user to ignore this problem if they know what they're doing. The case I worry about is somebody is trying to show off some specific feature of cockroach and encourages somebody else to download cockroach and try demo. That person doesn't have a TZ database for whatever reason but maybe for the context of this example, they don't care. Specifically I'm thinking of either an env var or flag that tells this change to just log like it used to.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @ajwerner)
I'm having a hard time of imagining a scenario where this would be desirable: the user who has been instructed to "simply download cockroach" but then "set this env var otherwise it doesn't work" is likely to keep the env var forever without understanding it and then complain to support that TZ operations don't work properly. |
|
(I am going to add the env var though) |
|
Done |
|
bors r=ajwerner |
Build failed |
|
unrelated fluke it seems bors r=ajwerner |
|
bors r=ajwerner |
Previously, unavailability of named time zones (issue cockroachdb#36864) was only causing an error message to be printed on the terminal and the log files. However, some users were not looking and would instead run directly into silently incorrect results in SQL. This change ensures a node doesn't even start when the TZ database is not ready. Example output: ``` ERROR: unable to load named timezones HINT: See: cockroachdb#36864 -- Check that the time zone database is installed on your system, or set the ZONEINFO environment variable to a Go time zone .zip archive. Failed running "demo" ``` Release note (cli change): CockroachDB now refuses to start if named time zones are not properly configured. It is possible to override this behavior for testing purposes, with the understanding that doing so will cause incorrect SQL results and other inconsistencies, using the environment variable `COCKROACH_INCONSISTENT_TIME_ZONES`.
Build failed (retrying...) |
|
bors r- |
Canceled |
|
@rkruze copying this over from slack: |
|
We added a workaround if a user is willing to deal with not having the TZ db. You'll need to specify |
|
Andrew, the (in my opinion reasonable) concern is that this is a pretty high friction workaround for something that people might conceivably run into when trying CockroachDB for the very first time. Also, pretending to be a user who is not a CockroachDB developer, the well-intentioned hints are still obtuse. Why would I know what a Go time zone .zip archive is? Also, the Why would we disable |
|
I don't disagree. I'm cool with demo just logging in this case. @knz was hesistant offer an escape hatch. I also buy the concern that the env var is not in the hint. Seems like another iteration here is in order. |
This PR is a follow-up to cockroachdb#45680 to re-enable `cockroach demo` even if the tz db is not available. Demo should not force users into workarounds that are vague and poorly documented. Release justification: low risk, high benefit changes to existing functionality Release note: None
|
@jordanlewis see how you feel about #46178 |
Citation needed on this. On MacOS and Linux, where the tzdata package is pre-installed, this error would never happen.
This could be solved by documentation (we provide a download link on our site) and a hint in the error message. |
|
I'm a user trying to learn and I can't get past this error. I've added zoneinfo.zip and updated path statement. Based on the comments above I've also tried: set COCKROACH_INCONSISTENT_TIME_ZONES=t and set COCKROACH_INCONSISTENT_TIME_ZONES=true. It still does not work. Any help would be great!!! ;) Also, what is GO language and how to install on windows: This should be off by default, and turned on when people care about it. PS C:\Users\q> set COCKROACH_INCONSISTENT_TIME_ZONES=t
ERROR: failed to initialize node: unable to load named timezones
|
Recommended by @rkruze .
Previously, unavailability of named time zones (issue #36864) was only
causing an error message to be printed on the terminal and the log
files. However, some users were not looking and would instead run
directly into silently incorrect results in SQL.
This change ensures a node doesn't even start when the TZ database is
not ready.
Example output:
Release note (cli change): CockroachDB now refuses to start if named
time zones are not properly configured. It is possible to override
this behavior for testing purposes, with the understanding that doing
so will cause incorrect SQL results and other inconsistencies, using
the environment variable
COCKROACH_INCONSISTENT_TIME_ZONES.