EvoMaster icon indicating copy to clipboard operation
EvoMaster copied to clipboard

EvoMaster process terminated abruptly when using BlackBox and a local file for schema

Open ElenaLobo opened this issue 2 years ago • 1 comments

Hi, I am trying to run the EvoMaster using Black Box technique. I do not have access to the source code of the API but I have the schema downloaded as a local file and the API up and running in the remote server. I am also using authentication. This is how my command looks like: java -jar evomaster.jar --blackBox true --bbSwaggerUrl file://microservice-swagger.yaml --bbTargetUrl http://remote-host/api/v1/microservice --header0 "Authorization: Bearer " --outputFormat JAVA_JUNIT_5 --outputFolder \GeneratedTCs --maxTime 30s --ratePerMinute 60

I got the following result, saying it is most likely a bug in the EvoMaster and asked to log this issue.

  • EvoMaster version: 1.6.0
  • WARNING: You are doing Black-Box testing, but you did not specify the 'problemType'. The system will default to RESTful API testing.
  • Initializing...
  • [ERROR] EvoMaster process terminated abruptly. This is likely a bug in EvoMaster. Please copy&paste the following stacktrace, and create a new issue on https://github.com/EMResearch/EvoMaster/issues java.lang.reflect.InvocationTargetException: invokedynamic: method=public void org.evomaster.core.problem.rest.service.AbstractRestSampler.initialize(), target=org.evomaster.core.problem.rest.service.RestSampler@556d0826 at com.netflix.governator.lifecycle.LifecycleMethods.methodInvoke(LifecycleMethods.java:316) at com.netflix.governator.lifecycle.LifecycleMethods.methodInvoke(LifecycleMethods.java:298) at com.netflix.governator.lifecycle.LifecycleManager.startInstance(LifecycleManager.java:266) at com.netflix.governator.lifecycle.LifecycleManager.add(LifecycleManager.java:175) at com.netflix.governator.guice.InternalLifecycleModule.onProvision(InternalLifecycleModule.java:81) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:117) at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:66) at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:93) at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:296) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169) at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45) at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:60) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169) at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45) at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:213) at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:186) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:113) at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:239) at com.netflix.governator.guice.LifecycleInjector.createChildInjector(LifecycleInjector.java:331) at com.netflix.governator.guice.LifecycleInjector.createInjector(LifecycleInjector.java:411) at com.netflix.governator.guice.LifecycleInjector.createInjector(LifecycleInjector.java:352) at org.evomaster.core.Main$Companion.init(Main.kt:327) at org.evomaster.core.Main$Companion.initAndRun(Main.kt:148) at org.evomaster.core.Main$Companion.main(Main.kt:81) at org.evomaster.core.Main.main(Main.kt) Caused by: java.lang.IllegalArgumentException: URI path component is empty at sun.nio.fs.WindowsUriSupport.fromUri(Unknown Source) at sun.nio.fs.WindowsFileSystemProvider.getPath(Unknown Source) at java.nio.file.Paths.get(Unknown Source) at org.evomaster.core.problem.rest.OpenApiAccess.readFromDisk(OpenApiAccess.kt:67) at org.evomaster.core.problem.rest.OpenApiAccess.getOpenAPIFromURL(OpenApiAccess.kt:45) at org.evomaster.core.problem.rest.service.AbstractRestSampler.initForBlackBox(AbstractRestSampler.kt:270) at org.evomaster.core.problem.rest.service.AbstractRestSampler.initialize(AbstractRestSampler.kt:61) at com.netflix.governator.lifecycle.LifecycleMethods.methodInvoke(LifecycleMethods.java:313) ... 26 common frames omitted

ElenaLobo avatar Feb 04 '23 15:02 ElenaLobo

Hi, thanks for reporting this bug. The issue is with --bbSwaggerUrl file://microservice-swagger.yaml. It is a valid URL (so the first sanity checks pass), but it is not a valid locator for a file (and so this is why you get IllegalArgumentException: URI path component is empty) See for example this

But there is clearly an issue here with EM, as we should give a meaningful error message instead of such stack-trace

arcuri82 avatar Feb 04 '23 20:02 arcuri82