Question not returning results for SPECIFIC period

Hi guys!
Well, this one got me really scared. Check this out:

And, then:

There is no trick on the SQL - when run directly on the database, both questions return rows, and they should (table only contained data until October 21st). I had cache turned on, turned it off, and nothing changed. Any clue on what might this be?

If I change the period to any other data ending in Octoer 21st, I get no results. If it ends later, it returns the results normally. I restarted metabase instance, nothing changed. Nothing special on the logs, either.

I’ve tried literally anything I could think of, no results, no matter what I try. I really need support on this - if this is to ever happen, how am I supposed to trust metabase, and I have been doing, to present data to my users?

If I simply replace the parameters placeholders for a string, it runs normally. It is totally on metabase’s end. Looking at the log, absolutely nothing even pops. It is like metabase is not even trying to run the question. no matter what I do.

I’m running a 0.29 instance on an EC2 machine. But I’ve tried the same query and foundd the same behaviour in a local instance of metabase 0.30.3. This is definitely a bug, I dare to say, but I have no clue about what type of bug.

I also did start metabase, and, imediatly run this query. This is what I saw in the log:

  {:data_inicio {:id "9e6055f3-73a1-8023-ecab-06c3ffad4a8a", :name "data_inicio", :display_name "Data inicio", :type "date", :required true},                                                                                                   
   :data_fim {:id "d7a5d43b-45c1-5418-106a-7f99dd957e42", :name "data_fim", :display_name "Data fim", :type "date", :required true}}},                                                                                                          
 :constraints {:max-results 10000, :max-results-bare-rows 2000},                                                                                                                                                                                
 :parameters [],                                                                                                                                                                                                                                
 :cache_ttl nil,                                                                                                                                                                                                                                
 {:executed-by 2,                                                                                                                                                                                                                               
  :context :question,                                                                                                                                                                                                                           
  :card-id 524,                                                                                                                                                                                                                                 
  :dashboard-id nil,                                                                                                                                                                                                                            
  :query-hash [-77, 1, -5, 101, -56, 87, 41, 126, 109, 100, 127, -40, 95, 51, 103, -118, -102, -33, 24, 86, 43, 53, 43, -93, -93, 15, -20, -22, -121, -105, 112, 17],                                                                           
  :query-type "native"}},                                                                                                                                                                                                                       
:expanded-query nil}                                                                                                                                                                                                                            
0-22 17:44:20 ^[[1mWARN metabase.query-processor^[[0m :: ^[[31mQuery failure: 'Data inicio' is a required param.                                                                                                                                

I can’t, for the life in me, figure out what is happening - only I know it seriously makes me think about reliability here…

Hey, Lucas. Sorry you’re having trouble. Could we see the SQL for your query, as well as your variables’ settings in the side panel? And could you remind me what type of database it is that you’re querying against? One last thing that might be helpful to know is what your Report Timezone setting is set to in /admin/settings/general. Thanks!

Oh, gosh, I talked about everything and forgot to mention I was querying against a MySQL 5.6 instance. I’m not using any particular timezone, I’m leaving it for the Default (no option selected).

Regarding to the variables, here are they:

Hm… Now you mentioned timestamp, let me add more info on this: Brazil had a daylight saving time scheduled to start last week, but our government did change it, delaying it a week or so. And it should have started exactly at July 21st. It happens that my EC2 server did not delay it, so it is an hour ahead - but the database itself works at GMT 00:00. Things are a bit messed up, even cellphones in Brazil lost their stuff and got the wrong hour.

I think that is the cause. But, how? Why? I mean, what is happening?

If you still think it necessary, I might provide SQL, but it seems not to be the case anymore.

As a first step, have you taken a look at this timezones troubleshooting guide?

Yes, Maz. I have. No good so far. Looking at raw data, all my time and hour fields are being displayed correctly. It happens to, and only to, the 21st July - it is somehow a cursed day. In the troubleshooting, the thing is incorrect numbers. But, in my case, it is more like “data is there, but can’t br retrived by metabase”. As I said, if I query data from, say, ‘2018-10-15’ -> ‘2018-10-22’, I can get it; if, however, I query for ‘2018-10-15’ -> ‘2018-10-21,’ no data is retrived at all. I don’t really get it.

Did you solve this?. I am facing the same error.

Not really :frowning:

What I’ve found, since them, is that I can check what query Metabase is actually running by checking the network tab on Chrome (probably the same in Firefox, Safari etc). This is the filter metabase is generating for me:

WHERE s.date_purchase BETWEEN CAST(convert_tz(?, '+00:00', '-03:00') AS date) AND NULL

The parameters in the JSON are alright, but the query gets messed up. I suppose, at least in my case, it has something to do with my country (Brazil) daylight saving time - it was scheduled to start at October 21st, but the government changed it to start two weeks later. I’ve had issues with MySQL timezone conversion as well - and, given metabase does convert timezones, even for date parameters, it is probably messing it up on that step. I know I don’t really solve your problem, but I hope to at least be able to clarify it a little bit.

Encountering the same. Seems like a very troubling bug.

@jburkart There has been so many timezone fixes the past couple of years, since the last comment in the topic, so you are likely experiencing something different, but details like the exact query and what you expect, as well as “Diagnostic Info” from Admin > Troubleshooting, will make it much easier to understand