Joshua was leading the armies of Israel into Canaan. They had wiped out Jericho – the fortified gateway city. Now they were doing a mop-up operation on the tiny city of Ai. The 3,000 man force they sent to Ai was defeated – 36 men died and the people panicked (Joshua 7:5). Joshua had spent enough time with Moses to know the dangers of the people panicking and murmuring. Joshua knew that God had promised this land to Israel so he prayed, complaining to God about the defeat.
6 And Joshua rent his clothes, and fell to the earth upon his face before the ark of the Lord until the eventide, he and the elders of Israel, and put dust upon their heads.
7 And Joshua said, Alas, O Lord God, wherefore hast thou at all brought this people over Jordan, to deliver us into the hand of the Amorites, to destroy us? would to God we had been content, and dwelt on the other side Jordan!
8 O Lord, what shall I say, when Israel turneth their backs before their enemies!
9 For the Canaanites and all the inhabitants of the land shall hear of it, and shall environ us round, and cut off our name from the earth: and what wilt thou do unto thy great name
The LORD redirected the course of Joshua’s prayers immediately. The problem wasn’t the LORD’s – it was Joshua’s!
10 And the Lord said unto Joshua, Get thee up; wherefore liest thou thus upon thy face?
11 Israel hath sinned, and they have also transgressed my covenant which I commanded them: for they have even taken of the accursed thing, and have also stolen, and dissembled also, and they have put it even among their own stuff.
If we’re asking the LORD for something – instead of complaining that He isn’t providing it – we need to check to see if we’re not obeying.