Problem with elbow/knee joints breaking with IK

I’ve made a quadruped rig, with ik bones at the ankles, and added ik for intermediate leg joints (not exactly elbows/knees, but around there). For some reason the latter disconnect the bones in the pose mode:



There’s no incorrect parenting, as far as I can see. It also seems that if I set the ankle IK constraint to the length of 2, the problem disappears but I really need it to span the whole leg, and previously I haven’t had this problem. It’s also funny that the result is the same on both sets of legs, so I don’t think I would have misclicked something while editing. Any idea what could have gone wrong? Here’s the blend:

Visayam_Deer.blend (538 KB)