Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-7682

Nifi web api crashes on empty payload to versions/active-requests

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.11.4
    • Fix Version/s: 1.12.0
    • Component/s: Flow Versioning
    • Labels:
      None

      Description

      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 :

       $ curl -X POST http://localhost:8080/nifi-api/versions/active-requests
       An unexpected error has occurred. Please check the logs for additional details

      Error log :

      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)
      

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              xtreak Karthikeyan Singaravelan

              Dates

              • Created:
                Updated:
                Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0h
              0h
              Logged:
              Time Spent - 40m
              40m

                Issue deployment