Dishwasher keeps draining

my dishwasher will fill up with hot water, then instead of moving to
a wash cycle, it drains the water back out. the motor keeps running.
it’s not going thru the wash or rince cycles. It does not matter which cycle i start with i tried pot&pans , just rinse , or normal wash. none of
these cycles work. it just fills then empties…any suggestions??

does it pump the water out or does it just drain out? it matters. you can disconnect the drain hose and let it pump into a bucket to know for certain.

I disconnected the hose & ran the dishwasher. It fills up & washes the 1st cycle, pumps the water out, then stops for about 1 minute. Then the motor runs continuously, no water in or out.