Connie,
GET version of basic-search doesn’t provide an option to return classification
attributes. Please use the POST version, as shown below:
curl -iv -H 'Content-Type: application/json' -u admin:admin -X POST
atlas-server.service.consul:21000/api/atlas/v2/search/basic -d '{
"classification" : "PII2", "includeClassificationAttributes": true }'
Madhan
From: Connie Chen <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Tuesday, December 12, 2017 at 12:18 PM
To: "[email protected]" <[email protected]>
Subject: Re: 500 returns when I try to basic search
Also, if I do something like this
curl -H "Content-Type: application/json" -iv -u admin:admin
atlas-server.service.consul:21000/api/atlas/v2/search/basic?classification=PII2&includeClassificationAttributes=true
The attributes don't come back either.
On Tue, Dec 12, 2017 at 12:01 PM, Connie Chen <[email protected]> wrote:
Hi, I am still trying to resolve this issue and it is somewhat difficult as I
don't understand the gremlin query language. I am trying to just run the query
that outputs on gremlin, and it is giving me this error
> GET /api/atlas/discovery/search/gremlin?gremlinQuery=def r=(([]) as Set);def
> f1={GremlinPipeline x->x.as('theTrait').in().as('theInstance')};
> [0..<25].select(['theTrait',
> 'theInstance']).fill(r)};f1(g.V().has('__typeName','PII2'));f1(g.V().has('__superTypeNames','PII2'));r._().as('__tmp').transform({((Row)it).getColumn('theTrait')}).as('theTrait').back('__tmp').transform({((Row)it).getColumn('theInstance')}).as('theInstance').select(['theTrait',
>
> 'theInstance'],{[it]},{[it]}).as('a0').has('PII2.pii_type',T.'eq','example').back('a0')
> [0..<25].toList() HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.35.0
> Host: atlas-server.service.consul:21000
> Accept: */*
>
< HTTP/1.1 400 Unknown Version
< Content-Length: 0
< Connection: close
* Server Jetty(9.2.12.v20150709) is not blacklisted
< Server: Jetty(9.2.12.v20150709)
<
* Closing connection 0
If it works in your env do you think you can add an example of this in the
QuickStartV2? That entire quick start works on our setup. But, there is no
example of a attribute def on a classification (and searching for it). I am not
sure if something is wrong with the query it is generating (see above) or our
setup. Thanks again for your help.
Connie
On Fri, Dec 8, 2017 at 4:03 PM, Connie Chen <[email protected]> wrote:
Hi Madhan, thanks for the response. It is still producing the same result. Do
you have any suggestions for where to debug this? It looks like it is in the
jersey layer, but where is that being controlled? thank you.
Connie
On Thu, Dec 7, 2017 at 7:58 PM, Madhan Neethiraj <[email protected]> wrote:
Connie,
The error was due to missing request header: -H 'Content-Type:
application/json'. Can you try the following?
curl -iv -H 'Content-Type: application/json' -u admin:admin -X POST
atlas-server/api/atlas/v2/search/basic -d '{
"excludeDeletedEntities": true,
"classification" : "PII",
"query" : "",
"limit" : 50,
"offset" : 0,
"entityFilters" : null,
"tagFilters" : {
"attributeName" : "pii_type",
"operator" : "eq",
"attributeValue": "example"
},
"attributes": [""]
}'
Hope this helps.
Madhan
From: Connie Chen <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Wednesday, December 6, 2017 at 11:38 AM
To: "[email protected]" <[email protected]>
Subject: Re: 500 returns when I try to basic search
I tried an example from the suggested queries applied to classification, like
`PII PII.type="name"` and got this error
2017-12-06 19:36:35,743 ERROR - [pool-1-thread-7 -
4cdc2d8b-f710-4c59-9eb2-ef7560801a74:] ~ Error handling a request:
e83408f35ae8fcd6 (ExceptionMapperUtil:32)
org.apache.atlas.exception.AtlasBaseException: Discovery query failed L:{def
r=(([]) as Set);def f1={GremlinPipeline
x->x.as('theTrait').in().as('theInstance') [0..<25].select(['theTrait',
'theInstance']).fill(r)};f1(g.V().has('__typeName','PII'));f1(g.V().has('__superTypeNames','PII'));r._().as('__tmp').transform({((Row)it).getColumn('theTrait')}).as('theTrait').back('__tmp').transform({((Row)it).getColumn('theInstance')}).as('theInstance').select(['theTrait',
'theInstance'],{[it]},{[it]}).as('a0').has('PII.type').back('a0')
[0..<25].toList()}
at
org.apache.atlas.discovery.EntityDiscoveryService.searchUsingDslQuery(EntityDiscoveryService.java:143)
at org.apache.atlas.web.rest.DiscoveryREST.searchUsingDSL(DiscoveryREST.java:94)
On Wed, Dec 6, 2017 at 11:30 AM, Connie Chen <[email protected]> wrote:
Hi Madhan, thanks for looking. I changed the config properties but getting the
same error. I don't see the "Given type" error in the startup anymore though:
https://gist.github.com/connie-stripe/597e087433869036e63e5d8363d61bd3#file-taxonomy-enable-false
I also tried an advanced search in the UI I think that was causing those
`Discovery query` errors. Let me know what you think, thanks
Connie
On Wed, Dec 6, 2017 at 11:00 AM, Madhan Neethiraj <[email protected]> wrote:
Connie,
The query text is correct; it works in my env. The log file shows failures in
bunch of other calls as well:
- com.sun.jersey.api.NotFoundException: null for uri:
http://atlas-server.service.consul:21000/api/atlas/discovery/search/basic
- com.sun.jersey.api.NotFoundException: null for uri:
http://atlas-server.service.consul:21000/api/atlas/v2/types/typedefs/classification
- com.sun.jersey.api.NotFoundException: null for uri:
http://atlas-server.service.consul:21000/api/atlas/v2/discovery/search/attribute?attrName=dataType
- org.apache.atlas.exception.AtlasBaseException: Discovery query failed
L:{def r=(([]) as Set);def f1={GremlinPipeline
x->x.as('theTrait').in().as('theInstance') [0..<25].select(['theTrait',
'theInstance']).fill(r)};f1(g.V().has('__typeName','PII'));f1(g.V().has('__superTypeNames','PII'));r._().as('__tmp').transform({((Row)it).getColumn('theTrait')}).as('theTrait').back('__tmp').transform({((Row)it).getColumn('theInstance')}).as('theInstance').select(['theTrait',
'theInstance'],{[it]},{[it]}).as('a0').has('PII.dataType',T.'eq','example').back('a0')
[0..<25].toList()}
- org.apache.atlas.exception.AtlasBaseException: Discovery query failed PII
OR Metric
- org.apache.atlas.exception.AtlasBaseException: Discovery query failed
Column WHERE Column isa PII
Log file shows a restart of Atlas running into the following error during
initialization: “Given type TaxonomyTerm already exists”. If taxonomy feature
(which is in tech-preview) is enabled, can you try after disabling it? Please
set the following configuration in atlas-application.properties:
atlas.feature.taxonomy.enable=false
Madhan
From: Nixon Rodrigues <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Wednesday, December 6, 2017 at 1:04 AM
To: "[email protected]" <[email protected]>
Subject: Re: 500 returns when I try to basic search
Connie,
Can you try this json as the body, I think to search on attribute needs to be
added to in criterion attribute.
http://atlasUrl:21000/api/atlas/v2/search/basic method - post
{
"excludeDeletedEntities": true,
"entityFilters": null,
"tagFilters": {
"criterion": [
{
"attributeName": "type",
"operator": "eq",
"attributeValue": "example"
}
]
},
"attributes": [],
"limit": 25,
"offset": 0,
"classification": "PII"
}
On Wed, Dec 6, 2017 at 11:50 AM, Connie Chen <[email protected]> wrote:
Hi Madhan, thanks for the fast response.
I added the snippet of the application log that shows the stack trace when I
make the search request.
https://gist.github.com/connie-stripe/597e087433869036e63e5d8363d61bd3#gistcomment-2277245
I also added as much of the application log as I could in another file
https://gist.github.com/connie-stripe/597e087433869036e63e5d8363d61bd3#file-application-log
Let me know if that helps, thanks!
Connie
On Tue, Dec 5, 2017 at 6:41 PM, Madhan Neethiraj <[email protected]> wrote:
Connie,
Thanks for the details provided on this issue. Classification definition and
basic-search REST API call details look good. To troubleshoot further, can you
add complete application.log file?
Madhan
From: Connie Chen <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Tuesday, December 5, 2017 at 5:17 PM
To: "[email protected]" <[email protected]>
Subject: 500 returns when I try to basic search
Hi, I am new to using Atlas and I am testing out the API to create my data
models. I've created a classification with a string attribute "dataType" where
"isIndexable" is set to true. However, I cannot figure out how to query for a
specific value via the API without getting a 500.
Here is my configuration:
https://gist.github.com/connie-stripe/597e087433869036e63e5d8363d61bd3
This is the field I am indexing on:
https://gist.github.com/connie-stripe/597e087433869036e63e5d8363d61bd3#file-gistfile1-txt-L22
Here is the curl command I am running to try and retrieve a value where that
attribute field is a specific value:
https://gist.github.com/connie-stripe/597e087433869036e63e5d8363d61bd3#gistcomment-2277045
Then I am getting these logs back:
https://gist.github.com/connie-stripe/597e087433869036e63e5d8363d61bd3#gistcomment-2277047
Am I doing something wrong? Is there an easier way to debug these sorts of
errors? The stack trace hasn't been very helpful. Thanks!
Connie