A cloud of orange smoke rises over nearby Cape Canaveral Air Force Station as seen from Cocoa Beach, Fla., Saturday, April 20, 2019. SpaceX reported a failure during test firing of their Dragon 2 capsule at their LZ-1 landing site. (Craig Bailey/Florida Today via AP)

It seemed like things were going so well.

SpaceX had pulled off an impressive launch of its Dragon spacecraft, which then docked with the International Space Station autonomously, like a car parallel parking on its own.

When it returned with a splash down in the Atlantic Ocean last month, NASA heralded the mission as a success, one that put the space agency a step closer to having its astronauts fly again from U.S. soil after an eight-year hiatus.

But since then, NASA’s “commercial crew” program, a bold bet by the agency to outsource human space flight to a pair of corporations, has suffered setbacks that have caused significant delays. On Saturday, something went dramatically wrong with SpaceX’s Dragon capsule when it failed during an engine test, sending a massive cloud of smoke over Cape Canaveral, Fla. Boeing — the other company under contract to fly crews to the space station — also recently announced it would delay its first test launch by several months, as it continues to struggle with the development of its spacecraft.

Now many believe both companies — which won contracts worth nearly $7 billion combined to fly astronauts to the station — may be forced to push their first flights with crews into next year, three years later than initially anticipated.

The setbacks forced NASA recently to purchase two more seats on Russian spacecraft for about $170 million total. Those will ensure that the agency doesn’t have to face the embarrassing prospect of not having an American astronaut on board the station — the orbiting laboratory that has cost American taxpayers about $100 billion.

“Past experience has shown the difficulties associated with achieving first flights on time in the final year of development,” the agency said in a solicitation announcing the intent to purchase the additional seats. “Typically, problems will be discovered during these test flights.”

SpaceX and NASA are at the beginning stages of investigating what caused SpaceX’s Dragon capsule to fail Saturday during a test fire of the engines designed to propel the spacecraft away from the rocket booster in the event of an emergency.

Neither have released much information about what happened, the extent of the damage or what impact it will have on SpaceX’s schedule. On Thursday, during a meeting of NASA’s Aerospace Safety Advisory Panel, Patricia Sanders, the chair of the committee, said it would take time to determine what happened, as investigators examine the data and establish a timeline of what went wrong.

But even before the failure, SpaceX still “had a large body of work yet to be completed” before it could fly crews, said Sandra Magnus, a former NASA astronaut who also serves of the safety advisory panel. She said it was too early to speculate what impact the failure would have. SpaceX is leading the investigation, with NASA’s support.

“NASA has full insight into the results of the mishap investigation,” NASA said in a statement. Investigators are “reviewing all of the data collected during the test, including high speed imagery and detailed spacecraft telemetry data and will include analysis of the recovered hardware from the test. We have full confidence in the SpaceX and NASA team working the investigation to determine the cause of the mishap and design updates should they be required.”

Last year, Boeing also faced a significant setback when during a test of the emergency abort system of its capsule, it discovered a propellant leak. It is currently planning to fly a test mission without anyone on board in August and a mission with crews by the end of the year. But NASA warned that both dates are tentative, and that it would extend astronauts’ mission on the space station from several days to as long as several months in order to ensure an American presence on the station.

Despite Saturday’s setback, SpaceX still plans to fly a different version of its Dragon spacecraft — one designed to carry cargo, not people — on a resupply mission to the space station next week.

Meanwhile, NASA is facing delays of its own. Nearly six months ago, the agency confirmed it was conducting a safety review of SpaceX and Boeing that was designed to evaluate the culture of the workplaces after SpaceX founder Elon Musk was seen smoking marijuana on a podcast streamed on the Internet.

But that review has yet to begin because the agency is still working on the required contract modifications, NASA spokesman Joshua Finch said. He said the goal is “to complete the safety assessment prior to flight tests with a crew.”

The review is expected to take months and involve hundreds of interviews to examine “everything and anything that could impact safety” as the companies prepare to fly human beings, William Gerstenmaier, NASA’s associate administrator for human exploration, said in an interview last year, announcing the probe.