Behind-the-scenes diplomatic wrangling and last-minute programming issues threatened to derail the three-day Brics summit, currently underway in Johannesburg.
At least two of the five presidents, Vladimir Putin from Russia and Narendra Modi from India, had issues with South Africa's diplomacy.
According to a government official, there was some unhappiness among Russian diplomats that Chinese President Xi Jinping was granted a state visit while Putin, who had been publicly invited twice before by former president Jacob Zuma, had not been granted a date for a visit yet.
Zuma had a warm relationship with Putin and in 2014 spent six days in Russia, reportedly to recover from a poisoning episode.
"We tried to advise that it would not be a good idea to have a state visit with the Chinese and not the Russians, but that advice wasn't taken," an official said.
Putin only arrived in South Africa at 09:00 on Thursday - two hours before the Brics leaders' summit was due to start.
He is set to have a bilateral meeting with President Cyril Ramaphosa later on Thursday, as well as bilaterals with Turkish President Recep Tayyip Erdogan, Xi and some African leaders attending the Brics outreach on Friday, before leaving later that day, press attaché from the Russian embassy Alexander Kulyaev said.
He denied that there was unhappiness among the Russians about the state visit and said a date would be decided in due course.
Neither Putin, nor Modi and Brazilian President Michel Temer attended the Brics Business Forum on Wednesday, something which an official said was the essence of the Brics gathering and which is usually attended by all presidents. Modi arrived in Pretoria on Wednesday afternoon.
Another official, however, said it was not essential for presidents to attend the forum and that Xi attended and spoke because he had been in the country since the state visit on Tuesday.
Modi almost snubbed the summit after the National Prosecuting Authority (NPA) wrote him a letter earlier this month, saying they were investigating charges laid by the Muslim Lawyers Association related to human rights violations in Kashmir.
"The prime minister thought this was an order from above because in India, that's how the system works," the official said.
Energy Minister Jeff Radebe was dispatched to India last week to smooth over the cracks and to explain the NPA's decision not to prosecute. The official said the NPA would not have been able to arrest or charge Modi anyway, as he was protected by the Geneva Convention governing international summits.
READ: The Johannesburg declaration signed at the Brics summit
Diplomats also complained of programming issues.
"Do you know the chaos theory? This is it," one said in exasperation on Thursday after the president's summit. He confirmed that embassies only received the programmes the day before. On Wednesday night, there was a three-hour wait for a Brics cultural event to start.
A retreat of the five presidents, scheduled for late Thursday afternoon at the Cradle of Humankind at Maropeng, was also cancelled at the last minute, and a live video crossing was done after lunch time on Thursday instead.
Ramaphosa told his peers and government officials: "The logistical arrangements were a little difficult for us to do so."
There was no sound for the first few minutes on the shaky video link as proceedings started, prompting Ramaphosa to joke: "I'm sure they will find someone for us to talk to in a minute, one who passed away millions of years ago."
The summit is to end on Friday with a gathering that will include a number of invited African leaders.
The Brics summit in Durban in 2013 was marred with similar programming issues, which left the Indian delegation unhappy because it left no time for a bilateral meeting with Zuma.
This is the first major summit in South Africa organised since Ramaphosa became president, and his loyalists felt it was important to go all-out to make a success of it.