Verse 17 is a whole list of things not going right. This is a list of things simply not working out. Nothing in this list is praiseworthy. A key word here is "Yet". Nothing good is happening. Yet (even so) I will rejoice in the Lord. He chooses to be joyful in his Savior when his circumstances are anything but joyful.
Can we choose the "yet" in our own lives. I am sure we can create a list of problems we are facing. But can we choose the "yet" despite all I can complain about I am going to choose to rejoice in the LORD?