ADDIS ABABA, Ethiopia — For nearly 30 years, Somalia has been a weak, divided state threatening the stability of the Horn of Africa and the key international waterway leading to the Suez Canal. International actors, including the United States and the African Union, which has thousands of peacekeepers in the country to bolster the government, have been trying to train the country’s army, feed its people and keep Somalia from falling into total chaos or into the hands of the Islamist group al-Shabab. Saudi Arabia, the United Arab Emirates, Qatar and Turkey have also been among Somalia’s most generous supporters.