Error: Incorrect parameter for prepared name in encoded plan

@Marco_Greco, I’m not sure what makes you think that N1QL prepared cache is not storing as much statements as expected. I just verified and system:prepareds holds 16384 statements on our dev environment as expected. Also, I there no such process written which deletes from system:prepareds periodically. But still this issue persisted.
Can you explain how this relates to the bug you resolved by fixing your code?

Since I had to do something to unblock our testing team, I deleted old cached plans and restarted all the nodes. For now, the issue is not visible but I’m not sure it will work for long.

I’d appreciate if you can explain whats going on behind the curtain so that I don’t have to shoot in the dark. :stuck_out_tongue: