Describe the bug
While trying to add the Loki datasource from grafana UI an error message pops up as "Loki: Bad Request. 400. invalid query, through < from (1583430645.678 < 1585661857.6)".
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I should be able to add the datasource successfully.
Screenshots, Promtail config, or terminal output
If applicable, add any output to help explain your problem.

When I see in browser console I see this API
http://localhost:3000/api/datasources/proxy/5/loki/api/v1/label?start=1585662649753000000
returning the response "invalid query, through < from (1583431503.718 < 1585662649.753)"
Thanks for reporting this. I'm taking a look at this now, do you have the loki version ?
You should see a log like this:
loki_1 | level=info ts=2020-03-31T19:36:54.1202226Z caller=main.go:74 msg="Starting Loki" version="(version=master-9a62deb, branch=master, revision=9a62deb8)"
My first impression is that your Loki server lives in the past. It seems to return now as the 5th March. Grafana seems to send the correct timestamp, so your browser seems fine.
Thanks for reporting this. I'm taking a look at this now, do you have the loki version ?
You should see a log like this:
loki_1 | level=info ts=2020-03-31T19:36:54.1202226Z caller=main.go:74 msg="Starting Loki" version="(version=master-9a62deb, branch=master, revision=9a62deb8)"
Yes.Please find below.
loki_1 | level=info ts=2020-03-05T17:14:23.352667434Z caller=main.go:74 msg="Starting Loki" version="(version=master-b7e868a, branch=master, revision=b7e868ad)"
Are you running Docker on Windows? There is a problem with container time desynchronizing while the computer is in hibernate which seems to manifest itself similar to what you're describing. See https://github.com/docker/for-win/issues/4526 for general details.
If that is your problem, it should be solved by following the steps below and will be solved by the Docker team going forward:
Get-VMIntegrationService -VMName DockerDesktopVM -Name "Time Synchronization" | Disable-VMIntegrationServiceGet-VMIntegrationService -VMName DockerDesktopVM -Name "Time Synchronization" | Enable-VMIntegrationServicede
Get-VMIntegrationService -VMName DockerDesktopVM -Name "Time Synchronization" | Disable-VMIntegrationServiceGet-VMIntegrationService -VMName DockerDesktopVM -Name "Time Synchronization" | Enable-VMIntegrationService
Thanks Emil. This worked for me.
Hence closing the issue.
Most helpful comment
Are you running Docker on Windows? There is a problem with container time desynchronizing while the computer is in hibernate which seems to manifest itself similar to what you're describing. See https://github.com/docker/for-win/issues/4526 for general details.
If that is your problem, it should be solved by following the steps below and will be solved by the Docker team going forward:
Get-VMIntegrationService -VMName DockerDesktopVM -Name "Time Synchronization" | Disable-VMIntegrationServiceGet-VMIntegrationService -VMName DockerDesktopVM -Name "Time Synchronization" | Enable-VMIntegrationService