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

GetUpdates failed: org.json4s.package$MappingException: No usable value for result #59

Closed
kitsunyan opened this issue Jun 10, 2018 · 10 comments

Comments

@kitsunyan
Copy link

kitsunyan commented Jun 10, 2018

The full stack trace is quite long…

GetUpdates failed
org.json4s.package$MappingException: No usable value for result
No usable value for message
No usable value for entities
No usable value for type
No usable value for $outer
Can't find field scala$Enumeration$$vmap from class scala.Enumeration
	at org.json4s.reflect.package$.fail(package.scala:95)
	at org.json4s.Extraction$ClassInstanceBuilder.buildCtorArg(Extraction.scala:526)
	at org.json4s.Extraction$ClassInstanceBuilder.$anonfun$instantiate$4(Extraction.scala:546)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
	at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:59)
	at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:52)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
	at scala.collection.TraversableLike.map(TraversableLike.scala:234)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at org.json4s.Extraction$ClassInstanceBuilder.instantiate(Extraction.scala:546)
	at org.json4s.Extraction$ClassInstanceBuilder.result(Extraction.scala:597)
	at org.json4s.Extraction$.$anonfun$extract$9(Extraction.scala:400)
	at org.json4s.Extraction$.customOrElse(Extraction.scala:606)
	at org.json4s.Extraction$.extract(Extraction.scala:392)
	at org.json4s.Extraction$.extract(Extraction.scala:39)
	at org.json4s.ExtractableJsonAstNode.extract(ExtractableJsonAstNode.scala:21)
	at info.mukel.telegrambot4s.marshalling.JsonMarshallers.fromJson(JsonMarshallers.scala:46)
	at info.mukel.telegrambot4s.marshalling.JsonMarshallers.fromJson$(JsonMarshallers.scala:46)
	at info.mukel.telegrambot4s.marshalling.JsonMarshallers$.fromJson(JsonMarshallers.scala:49)
	at info.mukel.telegrambot4s.marshalling.AkkaHttpMarshalling$.$anonfun$camelCaseJsonUnmarshaller$1(AkkaHttpMarshalling.scala:16)
	at akka.http.scaladsl.util.FastFuture$.$anonfun$map$1(FastFuture.scala:23)
	at akka.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:41)
	at akka.http.scaladsl.util.FastFuture$.$anonfun$transformWith$3(FastFuture.scala:51)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
	at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: org.json4s.package$MappingException: No usable value for message
No usable value for entities
No usable value for type
No usable value for $outer
Can't find field scala$Enumeration$$vmap from class scala.Enumeration
	at org.json4s.reflect.package$.fail(package.scala:95)
	at org.json4s.Extraction$ClassInstanceBuilder.buildCtorArg(Extraction.scala:526)
	at org.json4s.Extraction$ClassInstanceBuilder.$anonfun$instantiate$4(Extraction.scala:546)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
	at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:59)
	at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:52)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
	at scala.collection.TraversableLike.map(TraversableLike.scala:234)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at org.json4s.Extraction$ClassInstanceBuilder.instantiate(Extraction.scala:546)
	at org.json4s.Extraction$ClassInstanceBuilder.result(Extraction.scala:597)
	at org.json4s.Extraction$.$anonfun$extract$9(Extraction.scala:400)
	at org.json4s.Extraction$.customOrElse(Extraction.scala:606)
	at org.json4s.Extraction$.extract(Extraction.scala:392)
	at org.json4s.Extraction$CollectionBuilder.$anonfun$mkCollection$1(Extraction.scala:410)
	at scala.collection.immutable.List.map(List.scala:283)
	at org.json4s.Extraction$CollectionBuilder.mkCollection(Extraction.scala:410)
	at org.json4s.Extraction$CollectionBuilder.result(Extraction.scala:443)
	at org.json4s.Extraction$.$anonfun$extract$8(Extraction.scala:382)
	at org.json4s.Extraction$.customOrElse(Extraction.scala:606)
	at org.json4s.Extraction$.extract(Extraction.scala:382)
	at org.json4s.Extraction$.$anonfun$extract$6(Extraction.scala:366)
	at scala.Option.flatMap(Option.scala:171)
	at org.json4s.Extraction$.$anonfun$extract$5(Extraction.scala:366)
	at org.json4s.Extraction$.customOrElse(Extraction.scala:606)
	at org.json4s.Extraction$.extract(Extraction.scala:366)
	at org.json4s.Extraction$ClassInstanceBuilder.buildCtorArg(Extraction.scala:514)
	... 28 more
Caused by: org.json4s.package$MappingException: No usable value for entities
No usable value for type
No usable value for $outer
Can't find field scala$Enumeration$$vmap from class scala.Enumeration
	at org.json4s.reflect.package$.fail(package.scala:95)
	at org.json4s.Extraction$ClassInstanceBuilder.buildCtorArg(Extraction.scala:526)
	at org.json4s.Extraction$ClassInstanceBuilder.$anonfun$instantiate$4(Extraction.scala:546)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
	at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:59)
	at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:52)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
	at scala.collection.TraversableLike.map(TraversableLike.scala:234)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at org.json4s.Extraction$ClassInstanceBuilder.instantiate(Extraction.scala:546)
	at org.json4s.Extraction$ClassInstanceBuilder.result(Extraction.scala:597)
	at org.json4s.Extraction$.$anonfun$extract$9(Extraction.scala:400)
	at org.json4s.Extraction$.customOrElse(Extraction.scala:606)
	at org.json4s.Extraction$.extract(Extraction.scala:392)
	at org.json4s.Extraction$.$anonfun$extract$6(Extraction.scala:366)
	at scala.Option.flatMap(Option.scala:171)
	at org.json4s.Extraction$.$anonfun$extract$5(Extraction.scala:366)
	at org.json4s.Extraction$.customOrElse(Extraction.scala:606)
	at org.json4s.Extraction$.extract(Extraction.scala:366)
	at org.json4s.Extraction$ClassInstanceBuilder.buildCtorArg(Extraction.scala:514)
	... 54 more
Caused by: org.json4s.package$MappingException: No usable value for type
No usable value for $outer
Can't find field scala$Enumeration$$vmap from class scala.Enumeration
	at org.json4s.reflect.package$.fail(package.scala:95)
	at org.json4s.Extraction$ClassInstanceBuilder.buildCtorArg(Extraction.scala:526)
	at org.json4s.Extraction$ClassInstanceBuilder.$anonfun$instantiate$4(Extraction.scala:546)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
	at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:59)
	at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:52)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
	at scala.collection.TraversableLike.map(TraversableLike.scala:234)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at org.json4s.Extraction$ClassInstanceBuilder.instantiate(Extraction.scala:546)
	at org.json4s.Extraction$ClassInstanceBuilder.result(Extraction.scala:597)
	at org.json4s.Extraction$.$anonfun$extract$9(Extraction.scala:400)
	at org.json4s.Extraction$.customOrElse(Extraction.scala:606)
	at org.json4s.Extraction$.extract(Extraction.scala:392)
	at org.json4s.Extraction$CollectionBuilder.$anonfun$mkCollection$1(Extraction.scala:410)
	at scala.collection.immutable.List.map(List.scala:283)
	at org.json4s.Extraction$CollectionBuilder.mkCollection(Extraction.scala:410)
	at org.json4s.Extraction$CollectionBuilder.result(Extraction.scala:443)
	at org.json4s.Extraction$.$anonfun$extract$8(Extraction.scala:382)
	at org.json4s.Extraction$.customOrElse(Extraction.scala:606)
	at org.json4s.Extraction$.extract(Extraction.scala:382)
	at org.json4s.Extraction$.$anonfun$extract$6(Extraction.scala:366)
	at scala.Option.flatMap(Option.scala:171)
	at org.json4s.Extraction$.$anonfun$extract$5(Extraction.scala:366)
	at org.json4s.Extraction$.customOrElse(Extraction.scala:606)
	at org.json4s.Extraction$.extract(Extraction.scala:366)
	at org.json4s.Extraction$ClassInstanceBuilder.buildCtorArg(Extraction.scala:514)
	... 73 more
Caused by: org.json4s.package$MappingException: No usable value for $outer
Can't find field scala$Enumeration$$vmap from class scala.Enumeration
	at org.json4s.reflect.package$.fail(package.scala:95)
	at org.json4s.Extraction$ClassInstanceBuilder.buildCtorArg(Extraction.scala:526)
	at org.json4s.Extraction$ClassInstanceBuilder.$anonfun$instantiate$4(Extraction.scala:546)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
	at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:59)
	at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:52)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
	at scala.collection.TraversableLike.map(TraversableLike.scala:234)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at org.json4s.Extraction$ClassInstanceBuilder.instantiate(Extraction.scala:546)
	at org.json4s.Extraction$ClassInstanceBuilder.result(Extraction.scala:597)
	at org.json4s.Extraction$.$anonfun$extract$9(Extraction.scala:400)
	at org.json4s.Extraction$.customOrElse(Extraction.scala:606)
	at org.json4s.Extraction$.extract(Extraction.scala:392)
	at org.json4s.Extraction$ClassInstanceBuilder.buildCtorArg(Extraction.scala:514)
	... 99 more
Caused by: org.json4s.package$MappingException: Can't find field scala$Enumeration$$vmap from class scala.Enumeration
	at org.json4s.reflect.package$.fail(package.scala:95)
	at org.json4s.reflect.ScalaSigReader$.read$1(ScalaSigReader.scala:43)
	at org.json4s.reflect.ScalaSigReader$.$anonfun$readField$3(ScalaSigReader.scala:47)
	at scala.Option.getOrElse(Option.scala:121)
	at org.json4s.reflect.ScalaSigReader$.read$1(ScalaSigReader.scala:47)
	at org.json4s.reflect.ScalaSigReader$.readField(ScalaSigReader.scala:49)
	at org.json4s.reflect.Reflector$ClassDescriptorBuilder.$anonfun$fields$3(Reflector.scala:69)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
	at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:59)
	at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:52)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
	at scala.collection.TraversableLike.map(TraversableLike.scala:234)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at org.json4s.reflect.Reflector$ClassDescriptorBuilder.fields(Reflector.scala:68)
	at org.json4s.reflect.Reflector$ClassDescriptorBuilder.properties(Reflector.scala:85)
	at org.json4s.reflect.Reflector$ClassDescriptorBuilder.result(Reflector.scala:184)
	at org.json4s.reflect.Reflector$.createDescriptor(Reflector.scala:53)
	at org.json4s.reflect.Reflector$.$anonfun$describe$1(Reflector.scala:48)
	at org.json4s.reflect.package$Memo.apply(package.scala:36)
	at org.json4s.reflect.Reflector$.describe(Reflector.scala:48)
	at org.json4s.Extraction$.$anonfun$extract$9(Extraction.scala:393)
	at org.json4s.Extraction$.customOrElse(Extraction.scala:606)
	at org.json4s.Extraction$.extract(Extraction.scala:392)
	at org.json4s.Extraction$ClassInstanceBuilder.buildCtorArg(Extraction.scala:514)
	... 113 more

I'm not sure that the problem is on your side. I think the actual JSON value would be helpful, I can send it to you privately if you wish.

@mukel
Copy link
Member

mukel commented Jun 11, 2018

It seems a problem with MessageEntityType, I checked and there's nothing obviously wrong (except two extra members in the enum, but that shouldn't be a problem). Please share the JSON, you can remove/alter IDs, text and any sensitive information.

@kitsunyan
Copy link
Author

I removed ids/names/timestamps. Hope I left the bug cause itself. get-updates-fail.txt

@mukel
Copy link
Member

mukel commented Jun 11, 2018

Got it, it's the cashtag entity type, which is not mentioned anywhere in the bot API documentation. It seems is triggered by $USD-like patterns on the message text, can you confirm?
I'll push a new version with a fix, but a major update is coming soon.

@kitsunyan
Copy link
Author

Indeed. text is Не задана $DISPLAY или не могу подключиться к Х серверу, and it seems that $DISPLAY is marked with {"offset":10,"length":8,"type":"cashtag"} entity. This entity appears to be unused.

@kitsunyan
Copy link
Author

Tried to build with your commit, works fine! I think the problem is solved. Thanks.

@kitsunyan kitsunyan reopened this Jun 17, 2018
@kitsunyan
Copy link
Author

That happened again. There is one more new entity type: phone_number. I think there should be a fallback enum value (e.g. Unknown) which will be user for all undeclared entities.

@mukel
Copy link
Member

mukel commented Jun 17, 2018

It seems they are live-updating their API. Let me guess + prefix?
I'll push a generic fallback.

@kitsunyan
Copy link
Author

kitsunyan commented Jun 17, 2018

Let me guess + prefix?

… No! The text was 17.12x12.32x1.88 (substring by entity bounds). Try it yourself.

@TobsCore
Copy link
Contributor

Mine broke with the following input string 29.06.2018. If a message contained this string, it would cause the above error.

@mukel
Copy link
Member

mukel commented Jun 20, 2018

3.0.15 is out with a fix.

@mukel mukel closed this as completed Jun 20, 2018
TobsCore added a commit to TobsCore/IWINewsBot that referenced this issue Jun 21, 2018
This eliminates some errors with this framework. Check out bot4s/telegram#59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants