Query Widget "Query Failed" error

5027
8
03-02-2016 01:02 AM
MohamedMostafa
New Contributor II

I am using Portal for ArcGIS. The Query widget in Web AppBuilder generates a "Query Failed!" error although results are found when using a service containing a join.

8 Replies
RobertScheitlin__GISP
MVP Emeritus

Nohammed,

   What error is displayed in your browsers web console?

0 Kudos
AndrewValenski
New Contributor II

Mohamed,

Do you mind providing the following information?

  • What version of Portal are you using?
  • Have you specified the ObjectID field?
  • Are there joins in your data?
  • Is this behavior consistent through all browsers (IE, Chrome, Firefox, etc)?
  • Does your data have date fields assigned to be 'string' or 'date' fields?

Thanks in advance, Mohamed!

- Andrew

0 Kudos
NatCarter
New Contributor III

Andrew,

We are also experiencing the same issue although we are hitting our ArcGIS Server v10.41 services from the WAB applications hosted by AGOL.  Our query widget was working fine until the ArcGIS.com outage earlier this week and now that its come back on line and then updated (March release) our query widgets are returning "Query Failed" although querying the service through its REST endpoint with the same where clause is just fine.

Checking the network traffic in debug mode in the browser shows that the query request is returning a valid and correct response of the ObjectID assigned to the result of the query so it must be the code in the updated widget???

I tried adding a brand new query widget from the WAB seeing if my previous widget didn't update correctly but the new one added 3/3/17 doesn't work either.

- Object ID field is defined

- There are no joins to the feature layer in our service

- The behavior is consistent across browsers

- We are querying against an integer field type 

Thanks for the help in modifying the configs in the widget to get it to work or just keeping us in the loop on this bug.

Nat Carter
GIS Coordinator

Montana DEQ

0 Kudos
LemaoWu
Esri Contributor

Hi Nat, 

Does it happen on a specific service? Could you try one of the services here, and see if it's still reproducible? 

0 Kudos
NatCarter
New Contributor III

We figured out that our issue was a result of the way the Query Widget sends the request to the service it's tied to. The Query Widget first goes after the count of the returned features of the request and then goes after a full feature set by listing all Attribute Fields noted in the service for the Query's "Out Fields" parameter vs leaving it empty. Going after all the Fields listed by the service for the Feature Layer being queried failed the request as the service's JSON was not up to date with backend data changes. Once we re-published the service with the update feature attributes the Query Widget was able to process the request correctly.

Although our service definition needed to be refreshed we never assumed that the WAB Query Widget was going after specific fields in our feature layers without us defining them. Maybe a "*" or leaving the Out Fields empty by default would be a better implementation unless its explicitly defined in the Widget's paramaters.

Thanks for the follow up.

0 Kudos
MohamedMostafa
New Contributor II

I am using Portal for ArcGIS 10.3.1, I have a map service that contains 1 feature class and 1 database view. they are both joined to each other.

Using the Query widget in the Web AppBuilder, i try to add a filter to the feature class using one of the fields in the database view. I get a message telling "Query Failed".

I have done some investigations and i found that when adding the view to the MXD in adds % to the view name and when the Query Widget build the query expression it continue using the % which makes the query fails.

This is a sample from the query

query?where=TTSYS.%25XXPN_GIS_PLOTS_V.STATUS%20%3D%20'AVAILABLE'

If i add " " to the field name it will work fine

query?where="TTSYS.%25XXPN_GIS_PLOTS_V.STATUS"%20%3D%20'AVAILABLE'

I think this case is not handle in the Query widget logic

0 Kudos
MohamedMostafa
New Contributor II

This is the error displayed in the console

Error: Unable to complete operation.

Widget.js (91,418)

   {

      [functions]: ,

      __proto__: { },

      _ssl: undefined,

      code: 400,

      description: "",

      details: [ ],

      httpCode: 400,

      log: undefined,

      message: "Unable to complete operation.",

      name: "Error",

      number: 0,

      stack: "Error: Unable to complete operation.

   at h.load (/jsapi/jsapi/init.js:897:324)

   at Anonymous function (/jsapi/jsapi/init.js:191:60)

   at c (/jsapi/jsapi/init.js:76:215)

   at d (/jsapi/jsapi/init.js:76:10)

   at callback (/jsapi/jsapi/init.js:77:350)

   at c (/jsapi/jsapi/init.js:76:355)

   at d (/jsapi/jsapi/init.js:76:10)

   at callback (/jsapi/jsapi/init.js:77:350)

   at Anonymous function (/jsapi/jsapi/init.js:1483:44)

   at k (/jsapi/jsapi/init.js:199:425)"

   }

0 Kudos