The Poem of the Righteous Sufferer, or Ludlul-Bel-Nimeqi, is one of the oldest works of theodicy in history, and part of a long running philosophical tradition in Mesopotamian society. Marduk, clad in splendor and robed in dread brings first suffering and then relief on a man for seemingly no reason, and in this tale we will see both the events that occurred to him and his attempts to make sense of it all.
This poem might actually be from the Kassite period, but that is pretty well continuous with the literary tradition begun in the old Babylonian period.
The translation used here is from Benjamin Foster’s collection called Before the Muses, available online at the excellent Gateways to Babylon site: http://www.gatewaystobabylon.com/myths/texts/life/righteousufferer.htm