Support Questions

Find answers, ask questions, and share your expertise
Announcements
Now Live: Explore expert insights and technical deep dives on the new Cloudera Community BlogsRead the Announcement

NIFI API and Provenance info - Unable to get info out

avatar
Explorer

When I try to run a query against the nifi 2.5.0 API to get info about provenance activities, it seems to be quite difficult.

I installed NIfi on my PC with no modifications and all default settings, and just use the default user and password that's created when you install it.

I run this in my local windows CMD window and get   "unknown error" :

curl --insecure -X DELETE -H "Authorization: Bearer <my token> " https://localhost:8443/nifi-api/provenance/queries

Then I run this and get : 

curl --insecure -X DELETE -H "Authorization: Bearer <token>" https://localhost:8443/nifi-api/provenance/queries > test.txt

In text.txt file I get :

"An unexpected error has occurred. Please check the logs for additional details."

I'm starting to think the Provenance part of the API might be broken as it shouldn't be this hard?

I ran other API queries and they work fine.

What I'm trying to do is get a list of all files that have passed through my small local nifi installation so we can track what files have moved through nifi and when, as a form of monitoring.

Any help appreciated!

Thanks in advance.

 

1 ACCEPTED SOLUTION

avatar
Explorer

Hi Matt,

What I discovered is that when running nifi on windows 10 ( and possibly linux as well?), any passwords that have special characters like + or \ etc need to be converted to ascii I think it is. 

so :

/     becomes   %2F 

+    becomes   %2B

Once i did this, it worked OK.

View solution in original post

4 REPLIES 4

avatar
Community Manager

@zzzz77, Welcome to our community! To help you get the best possible answer, I have tagged in our NiFi experts @MattWho @haridjh , who may be able to assist you further.

Please feel free to provide any additional information or details about your query. We hope that you will find a satisfactory solution to your question.



Regards,

Vidya Sargur,
Community Manager


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
Master Mentor

@zzzz77 

When you executed your curl commands, did you check both the nifi-app.log and nifi-user.log for any ERROR or WARN log output that would provide more detail on the exception.

The Apache NIFi 2.x Provenance rest-api endpoint request should look more like this:

curl 'https://<HOSTNAME>:<PORT>/nifi-api/provenance' \
-H 'accept: application/json, text/plain, */*' \
-H 'content-type: application/json' \
-H 'Authorization:Bearer <TOKEN>' \
--data-raw '{"provenance":{"request":{"incrementalResults":false,"maxResults":1000,"summarize":true}}}' \
--insecure


Please help our community grow. If you found any of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt

avatar
Explorer

Hi Matt,

What I discovered is that when running nifi on windows 10 ( and possibly linux as well?), any passwords that have special characters like + or \ etc need to be converted to ascii I think it is. 

so :

/     becomes   %2F 

+    becomes   %2B

Once i did this, it worked OK.

avatar
Community Manager

@zzzz77, Did the response assist in resolving your query? If it did, kindly mark the relevant reply as the solution to help others find the answer more easily in the future. 



Regards,

Vidya Sargur,
Community Manager


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community: