{ "id": "119082", "key": "AC-2222", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-08-30T17:41:15.000+0000", "created": "2013-08-27T11:03:50.000+0000", "labels": [ "ACS", "triage" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:13.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "The following query returns Internal Server Error 500 since 2013-08-27 01:32:58 UTC. This query was working fine until 2013-08-26 23:25:28 UTC and no code changes occurred.\r\n\r\n{code:javascript}\r\nCloud.Events.query({\r\n order : {\r\n\tlnglat : {\r\n\t '$nearSphere' : [currentlat, currentlon],\r\n\t}\r\n }\r\n}, function(e) {\r\n...\r\n}{code}\r\n\r\n{code}Request Time\t2013-08-27 01:32:58 UTC\r\nRequest Name\tGET /v1/events/query.json\r\nResponse Status\t500\r\nResponse Message\tError: Internal Server Error\r\nParameters\t { \"oauth_consumer_key\" => \"oA7...a9L\", \"_session_id\" => \"Vtb-aHJbcIH0k0syT08CjDgL2E0\", \"order\" => \"{\"lnglat\":{\"$nearSphere\":[40.42369079589844,-79.92929077148438]}}\", \"suppress_response_codes\" => \"true\", \"controller\" => \"events\", \"action\" => \"query\", \"version\" => \"v1\", \"format\" => \"json\" }\r\nAuthorization\tOAuth realm=\"\",oauth_version=\"1.0\",oauth_consumer_key=\"oA7...a9L\",oauth_signature_method=\"HMAC-SHA1\",oauth_nonce=\"TGKlzI22QnrEA23\",oauth_timestamp=\"1377567177\",oauth_signature=\"4IBNrfxaeRVEL%2BWt0bClDeWzSto%3D\"\r\nUser Agent\tAppcelerator Titanium/3.1.2.GA (iPhone/6.1.3; iPhone OS; en_US;)\r\nSource IP\t71.206.237.230\r\nResponse Size\t135 bytes\r\n\r\nRequest Time\t2013-08-26 23:25:28 UTC\r\nRequest Name\tGET /v1/events/query.json\r\nResponse Status\t200\r\nParameters\t { \"oauth_consumer_key\" => \"oA7...a9L\", \"_session_id\" => \"ZLEH6hH4qixFpbXKfH8x-H3ShdY\", \"order\" => \"{\"lnglat\":{\"$nearSphere\":[40.305538177490234,-79.99760437011719]}}\", \"suppress_response_codes\" => \"true\", \"controller\" => \"events\", \"action\" => \"query\", \"version\" => \"v1\", \"format\" => \"json\" }\r\nAuthorization\tOAuth realm=\"\",oauth_version=\"1.0\",oauth_consumer_key=\"oA7...a9L\",oauth_signature_method=\"HMAC-SHA1\",oauth_nonce=\"72fLOFlpvzG3OrO\",oauth_timestamp=\"1377559528\",oauth_signature=\"YyBJI%2BM7%2FXBUNqwj9Ldf6TJJVsw%3D\"\r\nUser Agent\tAppcelerator Titanium/3.1.2.GA (iPhone/6.1.3; iPhone OS; en_US;)\r\nSource IP\t166.137.81.166\r\nResponse Size\t5844 bytes{code}", "attachment": [ { "id": "41936", "filename": "photo.PNG", "author": { "name": "bp4151", "key": "bp4151", "displayName": "Bruce Parr", "active": true, "timeZone": "America/New_York" }, "created": "2013-08-28T17:33:47.000+0000", "size": 179876, "mimeType": "image/png" } ], "flagged": false, "summary": "ACS - Event.Query suddenly returns Internal 500 response", "creator": { "name": "bp4151", "key": "bp4151", "displayName": "Bruce Parr", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Appcelerator ACS, Titanium 3.1.2GA, iOS 6.1.3", "comment": { "comments": [ { "id": "268491", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi N Morris,\r\n\r\nOur deepest apologies for the inconvenience. We have fixed the issue. It would be great if you could try again and let us know the outcome.\r\n\r\nThanks!", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-27T23:10:13.000+0000", "updated": "2013-08-27T23:10:13.000+0000" }, { "id": "268494", "author": { "name": "bp4151", "key": "bp4151", "displayName": "Bruce Parr", "active": true, "timeZone": "America/New_York" }, "body": "Just tested from my application. I am still getting the same error.", "updateAuthor": { "name": "bp4151", "key": "bp4151", "displayName": "Bruce Parr", "active": true, "timeZone": "America/New_York" }, "created": "2013-08-27T23:23:37.000+0000", "updated": "2013-08-27T23:23:37.000+0000" }, { "id": "268495", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks. I will escalate to engineering.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-27T23:25:47.000+0000", "updated": "2013-08-27T23:25:47.000+0000" }, { "id": "268500", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Bruce,\n\nPlease can you try again?\n\nThanks a lot!", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-28T00:01:05.000+0000", "updated": "2013-08-28T00:01:05.000+0000" }, { "id": "268505", "author": { "name": "joindup", "key": "joindup", "displayName": "Nicholas Conroy", "active": true, "timeZone": "Australia/Sydney" }, "body": "Of course our client is presenting his app to investors today. \r\nWe are getting a slightly different problem now. The response returns 200 but zero results. This is the same search that has been running perfectly for months and definitely has results.\r\n\r\nHere is the search: {\"per_page\":60,\"response_depth\":3,\"where\":{\"lnglat\":{\"$nearSphere\":[150.8077095,-34.4821236],\"$maxDistance\":47.08836917281432},\"start_time\":{\"$lte\":\"2013-09-04T10:25:58+00:00\",\"$gte\":\"2013-08-28T10:25:58+00:00\"}},\"order\":\"start_time\"}\r\n\r\nRemoving either lnglat OR start_time filters has no effect on the issue. Removing the where clause entirely returns everything.\r\n\r\nIs this related to the same issue?\r\nAny word on ETA for this fix?\r\n", "updateAuthor": { "name": "joindup", "key": "joindup", "displayName": "Nicholas Conroy", "active": true, "timeZone": "Australia/Sydney" }, "created": "2013-08-28T00:15:14.000+0000", "updated": "2013-08-28T00:30:56.000+0000" }, { "id": "268507", "author": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "body": "We are not seeing this issue any more based on your sample query. Can you please confirm it is still an issue?", "updateAuthor": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-28T00:17:54.000+0000", "updated": "2013-08-28T00:17:54.000+0000" }, { "id": "268512", "author": { "name": "joindup", "key": "joindup", "displayName": "Nicholas Conroy", "active": true, "timeZone": "Australia/Sydney" }, "body": "This is still an issues on our end. ", "updateAuthor": { "name": "joindup", "key": "joindup", "displayName": "Nicholas Conroy", "active": true, "timeZone": "Australia/Sydney" }, "created": "2013-08-28T00:38:37.000+0000", "updated": "2013-08-28T00:38:37.000+0000" }, { "id": "268513", "author": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "body": "we are looking into it. Please provide your app key so that we can look into it. you can email to me wkong@appcelerator.com", "updateAuthor": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-28T00:40:19.000+0000", "updated": "2013-08-28T00:40:19.000+0000" }, { "id": "268515", "author": { "name": "joindup", "key": "joindup", "displayName": "Nicholas Conroy", "active": true, "timeZone": "Australia/Sydney" }, "body": "I am now getting \"Error: Internal Server Error\" with the same search", "updateAuthor": { "name": "joindup", "key": "joindup", "displayName": "Nicholas Conroy", "active": true, "timeZone": "Australia/Sydney" }, "created": "2013-08-28T00:45:43.000+0000", "updated": "2013-08-28T00:45:43.000+0000" }, { "id": "268537", "author": { "name": "h5y1m141", "key": "h5y1m141", "displayName": "Hiorshi Oyamada", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi, Wei,\n\nI have similar issue.\n\nh2. symptom\n\nIn my case *Cloud.Places.query* suddenly doesn't work at Aug 26. Probably around 21:00-23:00(PDT)\n\nIt works following sample code which is written by CoffeeScript\n----\n Cloud = require('ti.cloud') \n Cloud.Places.query\n page: 1\n per_page: 200\n where:\n state:'tokyo'\n----\n\nBut, it doesn't work\n\n----\nCloud = require('ti.cloud')\nCloud.Places.query\n page: 1\n per_page: 20\n where:\n lnglat:\n $nearSphere:[longitude,latitude] \n $maxDistance: 0.01\n----\n\nAccroding to My App log, status code is 200 and parameters is as follows\n\n\nbq. { \"key\" => \"xx\", \"page\" => \"1\", \"per_page\" => \"20\", \"where\" => \"{\"lnglat\":{\"$nearSphere\":[longitude,latitude],\"$maxDistance\":0.01}}\n\n\nh2. expected\n\nRetreive shopData from acs and then show icon as follows\n\n!http://craftbeer-fan.info/assets/themes/clean-canvas-wrap/img/capture/feature-01.png!\n\nShould I send my app key to your email *wkong@appcelerator.com* if you need?\n\nBest Regards,\nHiroshi", "updateAuthor": { "name": "h5y1m141", "key": "h5y1m141", "displayName": "Hiorshi Oyamada", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-28T04:02:51.000+0000", "updated": "2013-08-28T04:02:51.000+0000" }, { "id": "268540", "author": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Can you please try again?\r\n\r\nBTW, there are several issues with this query\r\n\r\n\"$maxDistance\":47.08836917281432},\"start_time\":{\"$lte\":\"2013-09-04T10:25:58+00:00\",\"$gte\":\"2013-08-28T10:25:58+00:00\"}}\r\n\r\nmaxDistance is way too big here. See http://docs.appcelerator.com/cloud/latest/#!/guide/search_query\r\n\r\n$maxDistance\tused with $nearSphere to limit maximum search distance. All distances use radians. This allows you to easily multiply by the radius of the earth (about 6371 km or 3959 miles) to get the distance in your choice of units. Conversely, divide by the radius of the earth when doing queries\r\n To find users named joe near longitude -122.1 and latitude 37.1 with maximum distance of 5 miles (convert 5 miles to radians, 5/3959 = 0.00126)\r\n\r\nAlso we don't support timestamp format\r\n\r\n2013-09-04T10:25:58+00:00\r\n\r\nit should be\r\n2013-09-04T10:25:58+0000 or 2013-09-04T10:25:58-0000\r\n\r\nDid this work before?\r\n", "updateAuthor": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-28T05:17:11.000+0000", "updated": "2013-08-28T05:17:32.000+0000" }, { "id": "268541", "author": { "name": "h5y1m141", "key": "h5y1m141", "displayName": "Hiorshi Oyamada", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi, Wei,\nMy apps work fine! \n\nAppreciate your support.\n\nHiroshi", "updateAuthor": { "name": "h5y1m141", "key": "h5y1m141", "displayName": "Hiorshi Oyamada", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-28T05:40:08.000+0000", "updated": "2013-08-28T05:40:08.000+0000" }, { "id": "268639", "author": { "name": "bp4151", "key": "bp4151", "displayName": "Bruce Parr", "active": true, "timeZone": "America/New_York" }, "body": "As of 1:14 PM EDT, this is still a problem in my app. This morning I tried reversing the lat/lon to lon/lat in the query thinking that was the issue. It did not resolve anything.\r\nhttps://docs.google.com/file/d/0B3HdkNE9WNvPbm9EMjhNeWl1aFk/edit?usp=sharing", "updateAuthor": { "name": "bp4151", "key": "bp4151", "displayName": "Bruce Parr", "active": true, "timeZone": "America/New_York" }, "created": "2013-08-28T17:33:47.000+0000", "updated": "2013-08-28T17:37:54.000+0000" }, { "id": "268671", "author": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "body": "The issue with Bruce's app is that the $nearSphere is pass in as order instead of where.", "updateAuthor": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-28T18:51:53.000+0000", "updated": "2013-08-28T18:51:53.000+0000" }, { "id": "268685", "author": { "name": "bp4151", "key": "bp4151", "displayName": "Bruce Parr", "active": true, "timeZone": "America/New_York" }, "body": "Wei,\r\n\r\nIf that were the case, \r\n1) Why did it work for an entire year until last week?\r\n2) Please refer to ACS documentation at http://docs.appcelerator.com/cloud/latest/#!/guide/search_query where it states \r\n\"To find users named joe near longitude -122.1 and latitude 37.1 with maximum distance of 5 miles (convert 5 miles to radians, 5/3959 = 0.00126)\r\n\r\nwhere={\"first_name\":\"joe\", \"coordinates\":{\"$nearSphere\":[-122.1,37.1], \"$maxDistance\" : 0.00126}}\r\n\r\norder\r\n\r\nSort results by one or more fields. In general, you can sort based on any predefined field that you can query using the where operator, as well as on custom fields. Any exceptions to this rule are noted in API reference for the individual query methods.\"\r\n\r\nIf there are exceptions to this documentation, I have yet to find them. From what I can tell, your own documentation supports what I tried to do. ", "updateAuthor": { "name": "bp4151", "key": "bp4151", "displayName": "Bruce Parr", "active": true, "timeZone": "America/New_York" }, "created": "2013-08-28T19:08:13.000+0000", "updated": "2013-08-28T19:10:38.000+0000" }, { "id": "268692", "author": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hi Bruce,\r\n\r\n\r\nAccording to the log you sent me(see blow), you did \r\n\r\norder={\"first_name\":\"joe\", \"coordinates\":{\"$nearSphere\":[-122.1,37.1], \"$maxDistance\" : 0.00126}}\r\n\r\ninstead of \r\nwhere={\"first_name\":\"joe\", \"coordinates\":{\"$nearSphere\":[-122.1,37.1], \"$maxDistance\" : 0.00126}}\r\n\r\nI don't see any where in the parameters\r\n\r\nfor order we only accept a list of field names not a json hash. The internal server error is a bug on our side when order is passed in with invalid format. We can fix it to output better error message. \r\n\r\nI'm not sure how geo query worked for you for one year since from the log, I don't think any geo query was performed, it was just a basic query. It is possible that we changed the code so that invalid order string is throwing error instead of being slient\r\n\r\nExcept from your log:\r\n\r\nParameters\t{ \"oauth_consumer_key\" => \"xxx\", \"_session_id\" => \"xxx\", \"order\" => \"{\"lnglat\":{\"$nearSphere\":[-79.69265747070313,40.31901931762695]}}\", \"suppress_response_codes\" => \"true\", \"controller\" => \"events\", \"action\" => \"query\", \"version\" => \"v1\", \"format\" => \"json\" }", "updateAuthor": { "name": "wkong", "key": "wkong", "displayName": "Wei Kong", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-28T19:18:50.000+0000", "updated": "2013-08-28T19:23:13.000+0000" }, { "id": "268848", "author": { "name": "bp4151", "key": "bp4151", "displayName": "Bruce Parr", "active": true, "timeZone": "America/New_York" }, "body": "I eliminated the where clause and sort from my query and it at least returns data. I can live with that for now until I figure out a way to sort by distance from the current user. \n", "updateAuthor": { "name": "bp4151", "key": "bp4151", "displayName": "Bruce Parr", "active": true, "timeZone": "America/New_York" }, "created": "2013-08-29T15:42:02.000+0000", "updated": "2013-08-29T15:42:02.000+0000" } ], "maxResults": 18, "total": 18, "startAt": 0 } } }