# Error Message for GrammarRules and GrammarApply

I have been struggling with the following issue regarding an irregularity when deploying and applying GrammarRules. Specifically, it often takes several failed attempts before the execution is successful.

The following is a simple example where I observe such an irregularity. Namely, for those attempts which fail, the error message is the following:

grammar1 =
CloudDeploy[
GrammarRules[{FixedOrder[x : GrammarToken["GivenName"],
y : GrammarToken["SemanticNumber"]] :> x -> y}]]

$Failed The below is the detailed error message for this case: The same problem occurs when applying GrammarApply to a successfully deployed GrammarRule: GrammarApply[grammar1, "Joan 1289"]$Failed

The below is the detailed error message for this case:

Here again, it often takes several attempts until it actually works.

Any advice or hints on how to deal with this would be greatly appreciated.

Many thanks