Open jilavsky opened 1 year ago
Same problem with 0.1.0a80
Thanks for the clear report, @jilavsky, and for your patience with my delayed reply.
I can reproduce this on tiled-demo.blueskyproject.io
(running v0.1.0a80
).
This request, based on yours but using our example data instead of USAXS data, returns 500 Internal Server Error
: https://tiled-demo.blueskyproject.io/api/v1/node/search/bmm/raw?page[offset]=00&page[limit]=100&filter[time_range][condition][since]=1668816000&filter[time_range][condition][until]=1668902400sort=time
The server should reply 400 Bad Request
with some details about what's missing --- i.e. a timezone parameter. That's a bug in Tiled that we can fix.
If I insert a timezone parameter &filter[time_range][condition][timezone]=US/Central
I get a valid response.
(In this case it's an empty results set, but presumably the same filter parameters on http://usaxscontrol:8000/api/v1/node/search/20idb_usaxs
may return non-empty results.)
In the Swagger UI, I can reproduce this by omitted the timezone parameter. Observe the 500 Internal Server Error
at the bottom.
But when I fill in a timezone it works.
Note: In my post of I accidentally pasted in the broken screenshot again. I edited it to fix.
Outside the view of the screenshot, note that I set the path
parameter to /bmm/raw
in this example.
Hm, thanks. This works, checked it. Thanks!
But, the time provided is already UTC, I had to convert to UTC when originally writing my code for prior Tiled version months ago. Why is system not defaulting to UTC when no time zone is presented (as before), is there any solid reasoning?
In longer run a page with a good explanation of web query options is needed. Examples of queries would be probably more useful. May be link to some introductory page how to build the queries would be helpful. Existing help I can find: https://blueskyproject.io/tiled/reference/queries.html and https://swagger.io/docs/specification/about/ are difficult to turn into meaningful queries.
I don't recall intentionally removing the UTC default. That was probably an accidental change. I would be happy to reinstate the UTC default in a future release.
Yes, I definitely agree about documentation. I'd like to address this in two ways:
Issue for improving query docs: https://github.com/bluesky/tiled/issues/373
I'm second-guessing that statement about timezones though. I could see users coming in with different expectations:
Forcing the client to be specific about the timezone seems prudent, as long as the error message if they forget to do so is very clear. Users won't generally be forming these URLs by hand, so a given application like your Igor code can of course hard-code some timezone or other. Does that seem reasonable?
I understand different expectations. My view is that it should be UTC and that should be clearly stated in the manual -- there are limits to helpfulness. And you are right, if timezone is required, Igor code has no problem attaching the timezone once I know about this requirement. My bigger issue is with webUI, where user needs to add this field or gets error - web interface does not seem smart enough to require timezone selection when needed. And then we get to the simple problem of "what is the time zone code?" I have no clue, which means I need to figure out it is needed and then figure out what the proper syntax is by web search. All while web UI is returning error.
That makes sense. I think we can straightforwardly make that into a select box, to start, and improve further from there.
I am trying to search by time range defined as: http://usaxscontrol:8000/api/v1/node/search/20idb_usaxs?page[offset]=00&page[limit]=100&filter[time_range][condition][since]=1668816000&filter[time_range][condition][until]=1668902400&sort=time Server reports : Internal Server Error and log shows:
This is using current version 0.1.0a79 OAS3. This query was created from Swagger UI.