Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezones are not properly handled when creating a silenced entry #1448

Closed
palourde opened this issue May 4, 2018 · 5 comments
Closed

Timezones are not properly handled when creating a silenced entry #1448

palourde opened this issue May 4, 2018 · 5 comments
Assignees
Labels

Comments

@palourde
Copy link
Contributor

palourde commented May 4, 2018

Expected Behavior

When specifying a beginning date with a specific timezone, I expect this timezone to be used.

Current Behavior

The timezone is ignored and we don't throw any error. In this example, I expect the entry to start at May 04 2018 5:30PM EST but when displaying it, I have 04 May 18 23:30 EDT instead!

$ date
Fri May  4 17:18:58 EDT 2018
$ sensuctl silenced create \
--subscription 'entity:i-424242' \
--begin 'May 04 2018 5:30PM EST' \
--expire 3600 \
--reason 'Testing'
OK
$ sensuctl silenced list
         ID            Subscription     Check          Begin          Expire   ExpireOnResolve   Creator   Reason    Organization   Environment
 ─────────────────── ───────────────── ─────── ───────────────────── ──────── ───────────────── ───────── ───────── ────────────── ─────────────
  entity:i-424242:*   entity:i-424242           04 May 18 23:30 EDT   59m59s   false             admin     Testing   default        default

Possible Solution

Steps to Reproduce (for bugs)

  1. Create a silencing entry, with a date in the future:
sensuctl silenced create \
--subscription 'entity:i-424242' \
--begin 'May 04 2018 5:30PM EST' \
--expire 3600 \
--reason 'Testing
  1. List the silenced entries:
sensuctl silenced list

Context

Your Environment

  • Sensu version used (sensuctl, sensu-backend, and/or sensu-agent): master
  • Installation method (packages, binaries, docker etc.): manually
  • Operating System and version (e.g. Ubuntu 14.04): macOS 10.13.4
@jamesdphillips
Copy link
Contributor

jamesdphillips commented May 4, 2018

What is the timestamp on the entry? In other words, is the issue on create or when we format the date for display?

@palourde
Copy link
Contributor Author

palourde commented May 4, 2018

@jamesdphillips It's stored with the wrong date. For example, using --begin 'May 04 2018 5:30PM EST', it gives the following:

$ sensuctl silenced list --format json
[
  {
    "id": "entity:i-424242:*",
    "expire": 24310,
    "creator": "admin",
    "reason": "Testing",
    "subscription": "entity:i-424242",
    "organization": "default",
    "environment": "default",
    "begin": 1525491000
  }
]

Where 1525491000 is:
screen shot 2018-05-04 at 5 45 12 pm

@echlebek
Copy link
Contributor

echlebek commented May 7, 2018

@palourde just an observation, 04 May 18 5:30 PM EST should be EDT since daylight savings occurs in March.

@palourde
Copy link
Contributor Author

palourde commented May 7, 2018

@echlebek See below

$ sensuctl silenced create \
--subscription 'entity:i-424242' \
--begin 'May 04 2018 5:00PM EDT' \
--expire 3600 \
--reason 'Testing'
Error: cannot find EDT in zip file /usr/local/Cellar/go/1.10.2/libexec/lib/time/zoneinfo.zip

@echlebek
Copy link
Contributor

echlebek commented May 7, 2018

😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants