You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We are using the datafaker library to generate sample data for testing in a Scala-based project. A singleton instance of the faker is implemented centrally to generate various data points, including city names in addresses.
Occasionally, a runtime exception occurs during the data generation process, indicating that datafaker is unable to resolve a directive. The issue is intermittent: sometimes the error is triggered, while other times the application completes the process successfully. This inconsistency might be due to the application's background recovery mechanism, which retries certain steps as needed.
Since the application is complex, the stack trace for this issue has been truncated to exclude internal application calls and focuses only on potentially relevant information:
01-03 08:18:24.636 ERROR main App: Failed with error [java.lang.RuntimeException] with message [Failed to call method net.datafaker.providers.base.Address.city() on net.datafaker.providers.base.Address@65af0c1a (args: [])]!||| 2025-01-03 09:18:24.649 | Exception in thread "main" java.lang.RuntimeException: Failed to call method net.datafaker.providers.base.Address.city() on net.datafaker.providers.base.Address@65af0c1a (args: []) ||| 2025-01-03 09:18:24.649 | at net.datafaker.service.FakeValuesService.lambda$resolveExpression$14(FakeValuesService.java:817) ||| 2025-01-03 09:18:24.649 | at net.datafaker.service.FakeValuesService.resExp(FakeValuesService.java:757) ||| 2025-01-03 09:18:24.649 | at net.datafaker.service.FakeValuesService.resolveExpression(FakeValuesService.java:659) ||| 2025-01-03 09:18:24.649 | at net.datafaker.service.FakeValuesService.resolve(FakeValuesService.java:527) ||| 2025-01-03 09:18:24.649 | at net.datafaker.service.FakeValuesService.resolve(FakeValuesService.java:503) ||| 2025-01-03 09:18:24.649 | at net.datafaker.providers.base.AbstractProvider.resolve(AbstractProvider.java:20) ||| 2025-01-03 09:18:24.649 | at net.datafaker.providers.base.Address.cityName(Address.java:90) ||| 2025-01-03 09:18:24.649 | more ... |# Internal application calls|| 2025-01-03 09:18:24.649 | at scala.Option.getOrElse(Option.scala:201) ||| 2025-01-03 09:18:24.649 | more ... |# Internal application calls|| 2025-01-03 09:18:24.649 | at scala.collection.parallel.AugmentedIterableIterator.map2combiner(RemainsIterator.scala:107) ||| 2025-01-03 09:18:24.649 | at scala.collection.parallel.AugmentedIterableIterator.map2combiner$(RemainsIterator.scala:104)||| 2025-01-03 09:18:24.649 | at scala.collection.parallel.immutable.ParVector$ParVectorIterator.map2combiner(ParVector.scala:70) ||| 2025-01-03 09:18:24.649 | at scala.collection.parallel.ParIterableLike$Map.leaf(ParIterableLike.scala:1020) ||| 2025-01-03 09:18:24.649 | at scala.collection.parallel.Task.$anonfun$tryLeaf$1(Tasks.scala:52) ||| 2025-01-03 09:18:24.649 | at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) ||| 2025-01-03 09:18:24.649 | at scala.util.control.Breaks$$anon$1.catchBreak(Breaks.scala:97) ||| 2025-01-03 09:18:24.649 | at scala.collection.parallel.Task.tryLeaf(Tasks.scala:55) ||| 2025-01-03 09:18:24.649 | at scala.collection.parallel.Task.tryLeaf$(Tasks.scala:49)||| 2025-01-03 09:18:24.649 | at scala.collection.parallel.ParIterableLike$Map.tryLeaf(ParIterableLike.scala:1017) ||| 2025-01-03 09:18:24.649 | at scala.collection.parallel.AdaptiveWorkStealingTasks$AWSTWrappedTask.compute(Tasks.scala:152) ||| 2025-01-03 09:18:24.649 | at scala.collection.parallel.AdaptiveWorkStealingTasks$AWSTWrappedTask.compute$(Tasks.scala:148)||| 2025-01-03 09:18:24.649 | at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$AWSFJTWrappedTask.compute(Tasks.scala:304) ||| 2025-01-03 09:18:24.649 | at java.base/java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:194) ||| 2025-01-03 09:18:24.649 | at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ||| 2025-01-03 09:18:24.649 | at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ||| 2025-01-03 09:18:24.649 | at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ||| 2025-01-03 09:18:24.649 | at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ||| 2025-01-03 09:18:24.649 | at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ||| 2025-01-03 09:18:24.649 | Caused by: java.lang.reflect.InvocationTargetException ||| 2025-01-03 09:18:24.649 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ||| 2025-01-03 09:18:24.649 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ||| 2025-01-03 09:18:24.649 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ||| 2025-01-03 09:18:24.649 | at java.base/java.lang.reflect.Method.invoke(Method.java:569) ||| 2025-01-03 09:18:24.649 | at net.datafaker.service.FakeValuesService.lambda$resolveExpression$14(FakeValuesService.java:815) ||| 2025-01-03 09:18:24.650 | ... 30 more ||| 2025-01-03 09:18:24.650 | Caused by: java.lang.RuntimeException: Unable to resolve #{female_first_name} directive for FakerContext FakerContext{SingletonLocale{en}, net.datafaker.service.RandomService@1}. ||| 2025-01-03 09:18:24.650 | at net.datafaker.service.FakeValuesService.resolveExpression(FakeValuesService.java:662) ||| 2025-01-03 09:18:24.650 | at net.datafaker.service.FakeValuesService.resolveExpression(FakeValuesService.java:664) ||| 2025-01-03 09:18:24.650 | at net.datafaker.service.FakeValuesService.resolve(FakeValuesService.java:527) ||| 2025-01-03 09:18:24.650 | at net.datafaker.service.FakeValuesService.resolve(FakeValuesService.java:503) ||| 2025-01-03 09:18:24.650 | at net.datafaker.providers.base.AbstractProvider.resolve(AbstractProvider.java:20) ||| 2025-01-03 09:18:24.650 | at net.datafaker.providers.base.Address.city(Address.java:86) ||| 2025-01-03 09:18:24.650 | ... 35 more
To Reproduce
We are using a simple call to generate the city names using the global singleton faker. This is ofc a simplified version of the code we use, but the structure is the same in our codebase.
Expected behavior
We expect datafaker to reliably generate fake city names without any exceptions during the process.
Versions:
OS: Windows 11 Pro 24H2
JDK: OpenJDK 21.0.1
Scala: 2.13
Faker Version: 2.3.1 - 2.4.0 - 2.4.2
Additional context
We upgraded the datafaker dependency to the latest version (2.4.2) and noticed this issue. Attempting to downgrade to an older version (2.40) did not resolve the problem. We also tried rolling back by one minor version (specifically 2.3.1), but the issue persisted.
We suspect that this is not a new issue but rather one we encountered infrequently in the past. Unfortunately, it has now become a significant blocker for our testing phase. This is why we are seeking a resolution for this bug.
PS: If additional information would help identify the root cause, please let us know, and we will gladly provide any necessary details to assist in resolving this issue.
The text was updated successfully, but these errors were encountered:
Describe the bug
We are using the datafaker library to generate sample data for testing in a Scala-based project. A singleton instance of the faker is implemented centrally to generate various data points, including city names in addresses.
Occasionally, a runtime exception occurs during the data generation process, indicating that datafaker is unable to resolve a directive. The issue is intermittent: sometimes the error is triggered, while other times the application completes the process successfully. This inconsistency might be due to the application's background recovery mechanism, which retries certain steps as needed.
Since the application is complex, the stack trace for this issue has been truncated to exclude internal application calls and focuses only on potentially relevant information:
To Reproduce
We are using a simple call to generate the city names using the global singleton faker. This is ofc a simplified version of the code we use, but the structure is the same in our codebase.
Expected behavior
We expect datafaker to reliably generate fake city names without any exceptions during the process.
Versions:
Additional context
We upgraded the datafaker dependency to the latest version (2.4.2) and noticed this issue. Attempting to downgrade to an older version (2.40) did not resolve the problem. We also tried rolling back by one minor version (specifically 2.3.1), but the issue persisted.
We suspect that this is not a new issue but rather one we encountered infrequently in the past. Unfortunately, it has now become a significant blocker for our testing phase. This is why we are seeking a resolution for this bug.
PS: If additional information would help identify the root cause, please let us know, and we will gladly provide any necessary details to assist in resolving this issue.
The text was updated successfully, but these errors were encountered: