Skip to content

PassTicket misconfiguration in service metadata ends in hidden NPE #2937

Open
@pablocarle

Description

@pablocarle

Describe the bug
A service that requires an httpBasicPassTicket authentication scheme.
If the service configuration is incomplete (without APPLID in this case), requests to this service will fail to generate the passticket with a NullPointerException.
This Exception is not currently shown in logs. The following is the response body from Gateway, which does not provide enough details to troubleshoot.

{
  "messages": [
    {
      "messageType": "ERROR",
      "messageNumber": "ZWEAM701E",
      "messageContent": "The request to the URL '/serviceId/api/v1/service/path' has failed: ZuulException:  caused by: NullPointerException: ",
      "messageAction": "Refer to specific exception details for troubleshooting. Create an issue with this message.",
      "messageReason": "The request failed because of an internal error.",
      "messageKey": "org.zowe.apiml.common.internalRequestError"
    }
  ]
}

Adding log entries in InternalServerErrorController could remediate this last part.
It should be a clearer error if it's a service misconfiguration.

Steps to Reproduce

  1. Onboard service that requires httpBasicPassTickets without the APPLID configuration parameter.
  2. Try calling the service through the gateway with token or client certificate authentication

Expected behavior
The request should still fail, but the error code should be more clear about the misconfiguration.
The logs should show the NPE stack traces.

Details

  • Version and build number: nightly build v2
  • Test environment: z/OS 2.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status

      Unplanned Bugs

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions