But Joshua said to the people, “You are not able to serve the Lord, for he is a holy God. He is a jealous God; he will not forgive your transgressions or your sins. If you forsake the Lord and serve foreign gods, then he will turn and do you harm and consume you, after having done you good.” And the people said to Joshua, “No, but we will serve the Lord.” Then Joshua said to the people, “You are witnesses against yourselves that you have chosen the Lord, to serve him.” And they said, “We are witnesses.” He said, “Then put away the foreign gods that are among you, and incline your heart to the Lord, the God of Israel.” And the people said to Joshua, “The Lord our God we will serve, and his voice we will obey.” So Joshua made a covenant with the people that day, and put in place statutes and rules for them at Shechem. And Joshua wrote these words in the Book of the Law of God. And he took a large stone and set it up there under the terebinth that was by the sanctuary of the Lord. And Joshua said to all the people, “Behold, this stone shall be a witness against us, for it has heard all the words of the Lord that he spoke to us. Therefore it shall be a witness against you, lest you deal falsely with your God.” So Joshua sent the people away, every man to his inheritance. Joshua 24:19-28.
Joshua had just finished reminding the nation of Israel of how good brought Abraham out of idolotry and led them out of Egypt and all His miraculous works. He has challenged them to serve the Lord and put away all idols. Then he tells them they will not be able to do it.
It is hard to say whether Joshua perceives the future and is warning them of failure, or provoking them the argue for their future obedience. But we know God is not, through Joshua, trying to discourage them. In the moment, I am sure they mean well. But the generations within them will not all pass the test.
Warnings and admonitions and corrections are part of any effective Minister’s arsenal. He cannot be all sunshine and flowers. People, even God’s people, are sinful, devious, and self-deluded. And sometimes someone has to say it.