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

[BUG] sqlite3 returner logs using local timezone #58002

Open
nathansgreen opened this issue Jul 22, 2020 · 5 comments
Open

[BUG] sqlite3 returner logs using local timezone #58002

nathansgreen opened this issue Jul 22, 2020 · 5 comments
Labels
Feature new functionality including changes to functionality and code refactors, etc. Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases Returners
Milestone

Comments

@nathansgreen
Copy link

Description
The sqlite3 returner logs in the local time zone. This means that a daylight saving change will cause results to appear out of order.

Setup
No special setup is needed.

Steps to Reproduce the behavior
Use the sqlite3 returner on any machine configured with a time zone.

Expected behavior
The logged return date should always go forward in time for a given minion.

Screenshots
n/a

Versions Report

Salt Version: Salt: 3001

Dependency Versions:
cffi: 1.12.2
cherrypy: unknown
dateutil: 2.8.0
docker-py: Not Installed
gitdb: 2.0.6
gitpython: 2.1.15
Jinja2: 2.10.1
libgit2: 1.0.1
M2Crypto: 0.35.2
Mako: 1.0.7
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: 2.19
pycrypto: Not Installed
pycryptodome: 3.9.7
pygit2: 1.2.1
Python: 3.8.3 (default, Jul 8 2020, 14:27:55)
python-gnupg: 0.4.4
PyYAML: 5.1.2
PyZMQ: 19.0.0
smmap: 3.0.4
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.2

System Versions:
dist: darwin 19.5.0
locale: utf-8
machine: x86_64
release: 19.5.0
system: Darwin
version: 10.15.5 x86_64

PASTE HERE

Additional context
Add any other context about the problem here.

@nathansgreen nathansgreen added the Bug broken, incorrect, or confusing behavior label Jul 22, 2020
@krionbsd
Copy link
Contributor

@nathansgreen could you please provide the salt run with end result to give us the overview what's going on

@krionbsd krionbsd added this to the Follow up milestone Jul 23, 2020
@krionbsd krionbsd added severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Returners labels Jul 23, 2020
@nathansgreen
Copy link
Author

The short answer is that datetime.datetime.now() is being used, and instead utcnow() should be used.

@sagetherage sagetherage removed this from the Follow up milestone Jul 27, 2020
@cmcmarrow cmcmarrow added the Feature new functionality including changes to functionality and code refactors, etc. label Jul 27, 2020
@cmcmarrow cmcmarrow added this to the Approved milestone Jul 27, 2020
@cmcmarrow
Copy link
Contributor

#58003

@cmcmarrow
Copy link
Contributor

@nathansgreen I see lint and pr-commit is failing. You can fix this by running pre-commit

pip3 install pre-commit
pre-commit install in the root of the salt git repo

Its okay to mock all the sql calls for your test.

@sagetherage sagetherage removed Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around labels Jul 29, 2020
@sagetherage sagetherage modified the milestones: Approved, Aluminium Jul 29, 2020
@sagetherage sagetherage added the Aluminium Release Post Mg and Pre Si label Jul 29, 2020
@sagetherage sagetherage added Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases phase-plan labels Dec 8, 2020
@sagetherage sagetherage removed Aluminium Release Post Mg and Pre Si phase-plan labels Feb 17, 2021
@sagetherage sagetherage modified the milestones: Aluminium, Approved Feb 17, 2021
@sagetherage
Copy link
Contributor

the Core team will not be able to get to this in Aluminium but we will review a PR if anyone in the community wants to submit one, moving to Approved until a test case can be written on the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc. Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases Returners
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants