question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate why Synchronous API logs `java.util.NoSuchElementException: key not found`

See original GitHub issue

Follow the dagger quickstart: https://github.com/DACH-NY/dagger to reproduce the error. Creating a PostPaymentIntents contract through the navigator (this will result in a PostPaymentIntentsResponse which should trigger the error).

java.util.NoSuchElementException: key not found: TemplateId(9d2a07f50e31b04e5d651fb3cf9110d1dbfd80c25d964b96922448dc988787f9,StripeAPI,PostPaymentIntentsResponse)
	at scala.collection.immutable.Map$EmptyMap$.apply(Map.scala:98)
	at scala.collection.immutable.Map$EmptyMap$.apply(Map.scala:96)
	at com.digitalasset.http.ContractsService.$anonfun$searchInMemory$6(ContractsService.scala:255)
	at com.digitalasset.http.ContractsService.$anonfun$searchInMemory$6$adapted(ContractsService.scala:254)
	at scala.collection.TraversableLike.$anonfun$filterImpl$1(TraversableLike.scala:248)
	at scala.collection.Iterator.foreach(Iterator.scala:944)
	at scala.collection.Iterator.foreach$(Iterator.scala:944)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1432)
	at scala.collection.IterableLike.foreach(IterableLike.scala:71)
	at scala.collection.IterableLike.foreach$(IterableLike.scala:70)
	at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
	at scala.collection.TraversableLike.filterImpl(TraversableLike.scala:247)
	at scala.collection.TraversableLike.filterImpl$(TraversableLike.scala:245)
	at scala.collection.AbstractTraversable.filterImpl(Traversable.scala:104)
	at scala.collection.TraversableLike.filter(TraversableLike.scala:259)
	at scala.collection.TraversableLike.filter$(TraversableLike.scala:259)
	at scala.collection.AbstractTraversable.filter(Traversable.scala:104)
	at com.digitalasset.http.ContractsService.$anonfun$searchInMemory$2(ContractsService.scala:254)
	at akka.stream.impl.fusing.Map$$anon$1.onPush(Ops.scala:54)
	at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:541)
	at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:423)
	at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:624)
	at akka.stream.impl.fusing.ActorGraphInterpreter$SimpleBoundaryEvent.execute(ActorGraphInterpreter.scala:55)
	at akka.stream.impl.fusing.ActorGraphInterpreter$SimpleBoundaryEvent.execute$(ActorGraphInterpreter.scala:51)
	at akka.stream.impl.fusing.ActorGraphInterpreter$BatchingActorInputBoundary$OnNext.execute(ActorGraphInterpreter.scala:94)
	at akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:599)
	at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:768)
	at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:783)
	at akka.actor.Actor.aroundReceive(Actor.scala:533)
	at akka.actor.Actor.aroundReceive$(Actor.scala:531)
	at akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:690)
	at akka.actor.ActorCell.receiveMessage(ActorCell.scala:573)
	at akka.actor.ActorCell.invoke(ActorCell.scala:543)
	at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:269)
	at akka.dispatch.Mailbox.run(Mailbox.scala:230)
	at akka.dispatch.Mailbox.exec(Mailbox.scala:242)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
leo-dacommented, Mar 4, 2020

@lJoublanc Regarding this output:

{
  "warnings":{"unknownTemplateIds":["StripeAPI:GetCheckoutSessions"]},
  "result":[],
  "errors":["Endpoints.ServerError: java.util.NoSuchElementException: key not found: TemplateId(9d2a07f50e31b04e5d651fb3cf9110d1dbfd80c25d964b96922448dc988787f9,StripeAPI,PostPaymentIntentsResponse)"],"status":501
}

JSON API could not resolve StripeAPI:GetCheckoutSessions template ID, this means that the corresponding package has not been loaded yet or you have two versions of this template loaded from two different packages (with two different package IDs).

the fix for java.util.NoSuchElementException: is in the master, this was a JSON API bug. Thanks for reporting it.

0reactions
leo-dacommented, Mar 16, 2020

I am going to close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spark throws java.util.NoSuchElementException: key not found
I believe the issue is because of closure. When you run your application locally, everything might be running in same memory/process.
Read more >
java.util.NoSuchElementException: key not found: PLAINTEXT
My kafka cluster is SSL enabled, I started kafka manger in a separate box. Everything seems to be working fine except I am...
Read more >
NoSuchElementException key not found
The problem is typically caused by using the /scripts REST API endpoint to update a project to use an updated dataset that has...
Read more >
[2.3.1-Scala] java.util.NoSuchElementException: key not found ...
I'm seeing a strange error with Play 2.3.1. I have multi-project setup where each project enables PlayScala, with some inter-project dependencies. No matter ......
Read more >
Lettuce Reference Guide
While this guide helps you to understand the asynchronous API it is worthwhile to learn the impact on the synchronous API. The general...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found