Possible causes of 'Ask timed out on [...] after [# ms]. Sender[null] sent message of type "com.lightbend.lagom.scaladsl.persistence.CommandEnvelope"'?

Possible causes of 'Ask timed out on [...] after [# ms]. Sender[null] sent message of type "com.lightbend.lagom.scaladsl.persistence.CommandEnvelope"'?

This message means that the actor holding the PersistentEntity didn’t respond on time. It happens when the Future returned by the ask method didn’t complete after #ms.

This can be caused by many different reasons. You have to consider it as the symptom of some other problem in the system.

For instance, if you have a cluster it can be that the node that is responsible for hosting that entity is unreachable and the original message could not reach that Entity. Or, it did reach the Entity, but the response didn’t find its way back to the original caller.

Another possible cause can be that the Journal is unreachable, in which case, an Entity that needs to be brought into memory will fail to replay the journal and therefore will fail to respond to the new command. 
Watch out if you have a cluster. It can be that you see that logging message on the caller node, but the root cause of it may be on another node, the one supposed to host that Entity. If it’s failing to replay the journal because of db unreachability, the error log will be on the hosting node.

You will want to check your logs for any other errors. Of course should this not guide you towards the underlying issue, then please feel free to open a support case.

    • Related Articles

    • Can I customize error handling in Lagom?

      Yes, the best way to customize error handling in Lagom is to use a custom ExceptionSerializer.  This Knoldus blog post explains it well: https://blog.knoldus.com/2018/02/05/exception-serializer-in-lagom/ That example, however, is more focused on how ...
    • Fixing a NullPointerException when upgrading from Lagom while using Cinnamon (Telemetry)

      In case you are upgrading Lagom to 1.6.2 while using Cinnamon 2.14.0 you may come across the following error: Restarting graph due to failure. stack_trace: java.lang.NullPointerException      at ...
    • Can Lagom errors be handled using Play error handling?

      No, the Play error handler is not invoked from Lagom, because the Lagom exception serializer intercepts it first. Any exception thrown by application code will be wrapped in a transport exception, serialized to json and a response is built from it. ...
    • How to have a mixed read and write side persistence layers?

      This Lagom sample should provide everything you need for a successful mix of persistence sides. It focuses on a Cassandra write-side and JDBC read-side. The Cassandra section is covered by mixing in the WriteSideCassandraPersistenceComponents ...
    • Is it possible to bind path variables to a domain object in Lagom?

      Yes, Lagom provides an interface called PathParamSerializer that can be used to convert a path parameter to another type. In fact, there are already many built-in path parameter serializers at your disposal. However, there are still a number of ...