Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MP OpenAPI 4.0 NPE during validation #30303

Open
Azquelt opened this issue Nov 27, 2024 · 0 comments
Open

MP OpenAPI 4.0 NPE during validation #30303

Azquelt opened this issue Nov 27, 2024 · 0 comments
Assignees
Labels
in:MicroProfile/OpenAPI release bug This bug is present in a released version of Open Liberty

Comments

@Azquelt
Copy link
Member

Azquelt commented Nov 27, 2024

Describe the bug

During validation, it's possible to get an NPE. The following stack was seen:

------Start of DE processing------ = [11/26/24, 23:32:59:989 PST ]
Exception = java.lang.NullPointerException
Source = io.openliberty.microprofile.openapi20.internal.ApplicationProcessor
probeid = 291
Stack Dump = java.lang.NullPointerException: Cannot invoke "java.lang.String.contains(java.lang.CharSequence)" because "key" is null
	at io.openliberty.microprofile.openapi40.internal.services.validation.PathItem31Validator.validate(PathItem31Validator.java:44)
	at io.openliberty.microprofile.openapi40.internal.services.impl.OpenAPI31Validator$ValidationOperation31.visitPathItem(OpenAPI31Validator.java:74)
	at io.openliberty.microprofile.openapi20.internal.utils.OpenAPIModelWalkerImpl$Walker.traversePathItem(OpenAPIModelWalkerImpl.java:399)
	at io.openliberty.microprofile.openapi40.internal.services.impl.OpenAPI31ModelWalkerImpl$Walker31.traverseModelObject(OpenAPI31ModelWalkerImpl.java:166)
	at io.openliberty.microprofile.openapi40.internal.services.impl.OpenAPI31ModelWalkerImpl$Walker31.traverseObject(OpenAPI31ModelWalkerImpl.java:120)
	at io.openliberty.microprofile.openapi40.internal.services.impl.OpenAPI31ModelWalkerImpl$Walker31.lambda$traverseSchemaChildren$1(OpenAPI31ModelWalkerImpl.java:109)
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:986)
	at java.base/java.util.Collections$UnmodifiableMap.forEach(Collections.java:1707)
	at io.openliberty.microprofile.openapi40.internal.services.impl.OpenAPI31ModelWalkerImpl$Walker31.traverseSchemaChildren(OpenAPI31ModelWalkerImpl.java:107)
	at io.openliberty.microprofile.openapi20.internal.utils.OpenAPIModelWalkerImpl$Walker.traverseSchema(OpenAPIModelWalkerImpl.java:930)
	at io.openliberty.microprofile.openapi20.internal.utils.OpenAPIModelWalkerImpl$Walker.lambda$processSchemas$20(OpenAPIModelWalkerImpl.java:1751)
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:986)
	at java.base/java.util.Collections$UnmodifiableMap.forEach(Collections.java:1707)
	at io.openliberty.microprofile.openapi20.internal.utils.OpenAPIModelWalkerImpl$Walker.processSchemas(OpenAPIModelWalkerImpl.java:1749)
	at io.openliberty.microprofile.openapi20.internal.utils.OpenAPIModelWalkerImpl$Walker.traverseComponentChildren(OpenAPIModelWalkerImpl.java:340)
	at io.openliberty.microprofile.openapi40.internal.services.impl.OpenAPI31ModelWalkerImpl$Walker31.traverseComponentChildren(OpenAPI31ModelWalkerImpl.java:95)
	at io.openliberty.microprofile.openapi20.internal.utils.OpenAPIModelWalkerImpl$Walker.traverseComponents(OpenAPIModelWalkerImpl.java:288)
	at io.openliberty.microprofile.openapi20.internal.utils.OpenAPIModelWalkerImpl$Walker.traverseOpenAPIChildren(OpenAPIModelWalkerImpl.java:218)
	at io.openliberty.microprofile.openapi40.internal.services.impl.OpenAPI31ModelWalkerImpl$Walker31.traverseOpenAPIChildren(OpenAPI31ModelWalkerImpl.java:68)
	at io.openliberty.microprofile.openapi20.internal.utils.OpenAPIModelWalkerImpl$Walker.traverseOpenAPI(OpenAPIModelWalkerImpl.java:206)
	at io.openliberty.microprofile.openapi20.internal.utils.OpenAPIModelWalkerImpl$Walker.traverseOpenAPI(OpenAPIModelWalkerImpl.java:191)
	at io.openliberty.microprofile.openapi40.internal.services.impl.OpenAPI31ModelWalkerImpl.walk(OpenAPI31ModelWalkerImpl.java:57)
	at io.openliberty.microprofile.openapi20.internal.validation.OASValidator30Impl$ValidationOperation.run(OASValidator30Impl.java:91)
	at io.openliberty.microprofile.openapi40.internal.services.impl.OpenAPI31Validator.validate(OpenAPI31Validator.java:46)
	at io.openliberty.microprofile.openapi20.internal.ValidationComponent.validateModel(ValidationComponent.java:95)
	at io.openliberty.microprofile.openapi20.internal.ValidationComponent.validateAndReportErrors(ValidationComponent.java:69)
	at io.openliberty.microprofile.openapi20.internal.ApplicationProcessor.processWebModule(ApplicationProcessor.java:290)
	at io.openliberty.microprofile.openapi20.internal.ApplicationProcessor.processApplication(ApplicationProcessor.java:145)
	at io.openliberty.microprofile.openapi20.internal.ApplicationRegistryImpl.addApplication(ApplicationRegistryImpl.java:113)
	at io.openliberty.microprofile.openapi20.internal.ApplicationListener.applicationStarting(ApplicationListener.java:48)
	at com.ibm.ws.container.service.state.internal.ApplicationStateManager.fireStarting(ApplicationStateManager.java:53)
	at com.ibm.ws.container.service.state.internal.StateChangeServiceImpl.fireApplicationStarting(StateChangeServiceImpl.java:52)
	at com.ibm.ws.app.manager.module.internal.SimpleDeployedAppInfoBase.preDeployApp(SimpleDeployedAppInfoBase.java:623)
	at com.ibm.ws.app.manager.module.internal.SimpleDeployedAppInfoBase.installApp(SimpleDeployedAppInfoBase.java:584)
	at com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.deployApp(DeployedAppInfoBase.java:625)
	at com.ibm.ws.app.manager.war.internal.WARApplicationHandlerImpl.install(WARApplicationHandlerImpl.java:67)
	at com.ibm.ws.app.manager.internal.statemachine.StartAction.execute(StartAction.java:199)
	at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.enterState(ApplicationStateMachineImpl.java:1369)
	at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.performAction(ApplicationStateMachineImpl.java:1213)
	at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.run(ApplicationStateMachineImpl.java:920)
	at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:298)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1595)

Steps to Reproduce

Seen while running the TCK in the MP70_EE10 configuration.

Not sure yet exactly which part of the TCK causes the NPE.

Expected behavior
We should not get an NPE here.

Diagnostic information:

  • OpenLiberty Version: 24.0.0.12
  • Affected feature(s): mpOpenAPI-4.0
@Azquelt Azquelt added the release bug This bug is present in a released version of Open Liberty label Nov 27, 2024
@Azquelt Azquelt moved this from New to Backlog in MicroProfile UK Nov 27, 2024
@Azquelt Azquelt self-assigned this Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:MicroProfile/OpenAPI release bug This bug is present in a released version of Open Liberty
Projects
Status: Backlog
Development

No branches or pull requests

1 participant