[
https://issues.apache.org/jira/browse/NIFI-7682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17166647#comment-17166647
]
ASF subversion and git services commented on NIFI-7682:
-------------------------------------------------------
Commit cee6cfddf2e1918a1edda5fb1e02c151663a2d97 in nifi's branch
refs/heads/main from Karthikeyan Singaravelan
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=cee6cfd ]
NIFI-7682: Check for request object to be null.
Signed-off-by: Pierre Villard <[email protected]>
This closes #4437.
> Nifi web api crashes on empty payload to versions/active-requests
> -----------------------------------------------------------------
>
> Key: NIFI-7682
> URL: https://issues.apache.org/jira/browse/NIFI-7682
> Project: Apache NiFi
> Issue Type: Bug
> Components: Flow Versioning
> Affects Versions: 1.11.4
> Reporter: Karthikeyan Singaravelan
> Priority: Major
>
> There is a crash in the nifi web api on posting empty payload via curl to
> versions/active-requests endpoint. It seems the request is not validated to
> be null and causes NullPointerException.
> There should be a null check to throw exception stating request should not be
> empty before getting group ID at
> [https://github.com/apache/nifi/blob/4d940bb151eb8d250b0319318b96d23c4a9819ae/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/VersionsResource.java#L263]
> .
> I would like to contribute a patch to nifi with the fix that I have already
> tested manually. I am a new contributor so any help on this will be
> appreciated.
> *Curl request :*
> {code:java}
> $ curl -X POST http://localhost:8080/nifi-api/versions/active-requests
> An unexpected error has occurred. Please check the logs for additional
> details{code}
> *Error log :*
> {code:java}
> 2020-07-28 12:26:50,706 ERROR [NiFi Web Server-27]
> o.a.nifi.web.api.config.ThrowableMapper An unexpected error has occurred:
> java.lang.NullPointerException. Returning Internal Server Error response.
> java.lang.NullPointerException: null
> at
> org.apache.nifi.web.api.VersionsResource.createVersionControlRequest(VersionsResource.java:263)
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)