Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Invoke Http with url containing %2F

avatar
New Contributor

I am using Apache nifi invokeHttp processor to call Google API. The url contains a path which i need to encode.So in the URL,only path is encoded e.g. resources%2F8cb90ae6-16cc-4460-99f4-3ae0689b3b66%2Fdata_asset%2FCETIvowels-38.pdf

However whenver I set encoded url, the processor internally replaces %2F with %252F which results in HTTP 404 response.

E.g. Nifi convert URL - https://storage.googleapis.com/storage/v1/b/t-bis-1hg-jk/o/resources%2F8cb90ae6-16cc-4460-99f4-3ae06...

to

https://storage.googleapis.com/storage/v1/b/t-bis-1hg-jk/o/resources%252F8cb90ae6-16cc-4460-99f4-3ae...

 

3 REPLIES 3

avatar
Super Mentor

@DeepakDonde 

The issue you are describing was caused by a change in Apache NiFi InvokeHTTP  processor that tries to URL encode the URL entered. 
 https://issues.apache.org/jira/browse/NIFI-12513

The fix for this is in https://issues.apache.org/jira/browse/NIFI-12785 which will be part of the Apache NiFi 1.26 and Apache NiFi 2.0.0-M3 releases.

Since the change that caused this issue was added to Apache NiFi 1.25 and Apache NiFi 2.0.0-M2, you could use and earlier version like Apache NiFi 1.24 or Apache NiFi 2.0.0-M1 to get around the issue until the two above mentioned versions are released.

Please help our community thrive. 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
New Contributor

Changing Nifi version seems overhead as its running on kubernetes and there are many process groups running on that version. And i am not sure if doing that won't introduce the issues from earlier version.

Is there any work around for this?

Can I use GetHttp instead of InvokeHttp?

avatar
Super Mentor

@DeepakDonde

 https://issues.apache.org/jira/browse/NIFI-12513 does not mention GetHTTP processor, so you could certainly try that processor to see if you experience the same issue.

Downgrade would lose all improvements and bug fixes introduced in Apache NiFi 1.25.  Otherwise you could wait until 1.26 is released that contains the fix.

The InvokeHTTP processor is part of the NiFi Standard nar which includes a lot of NiFi components.  You could also try Downloading just the 1.24.0 standard nar from the maven central repository and adding it the extensions folder of your 1.25.0 NiFi.  This would make both the 1.24 and 1.25 versions of many components available in your NiFi.  You could then use the 1.24 version of the invokeHTTP  over the 1.25 version that has issue.  This would allow you to continue to use 1.25 version for all other components.   While i have added multiple version of the same nar to my NiFi installations in the past, I have not done so with the standard nar.  If you have issues, you can stop your NiFi, remove the added nar and restart so thing go back to previous.

https://mvnrepository.com/artifact/org.apache.nifi/nifi-standard-shared-nar/1.24.0
https://repo1.maven.org/maven2/org/apache/nifi/nifi-standard-shared-nar/1.24.0/nifi-standard-shared-...

Please help our community thrive. 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