If you think your job is exciting, try working at SpaceX in its early days.

As author Eric Berger puts it, "SpaceX was not a job; it was a lifestyle."

In his first book, for example, one engineer told him about crawling inside an imploding rocket, while others talked about running out of food on a small Pacific island.

For his latest, "Reentry: SpaceX, Elon Musk, and the Reusable Rockets that Launched a Second Space Age," published in September, Berger spoke with about 100 current and former SpaceX employees.

crane on a barge lifting charred white spaceship in the ocean
SpaceX's recovery ship lifts a Crew Dragon spaceship from the Atlantic Ocean. (NASA/Cory Huston)

In the new book, Berger recounts the night SpaceX engineers got stuck on a barge and slept near a spaceship full of potentially explosive gases.

The team was helping SpaceX secure much-needed cash flow from NASA. CEO Elon Musk had been "weeks away from personal bankruptcy" just two years earlier, Berger, who is the senior space editor at Ars Technica, writes.

Here's what happened, according to Berger's book.

SpaceX did not respond to Business Insider's request for comment.

Dragon's first flight

Musk wanted SpaceX's flagship Dragon spaceship – designed to shuttle cargo and NASA astronauts to and from the International Space Station – to be reusable.

Reusability is the company's signature, making its Falcon 9 rocket launches significantly cheaper than NASA's Space Shuttles.

crew dragon endeavour crew 2 spacex iss arrival
A Dragon spaceship approaches the International Space Station with astronauts on board in 2021. (NASA)

That meant SpaceX engineers had to retrieve Dragon from the Pacific Ocean after its first flight in December 2010.

It didn't go exactly as planned.

The danger of Dragon's explosive fuel

The fuel inside Dragon is hypergolic, meaning its components spontaneously combust when they meet. That makes it simple to ignite the thrusters – just open the valves between the fuel components.

It also put the ship's first recovery crew at risk.

SpaceX had never flown Dragon before, so nobody knew how much damage it would sustain during reentry. It could have fuel leaks, which would pose an explosion risk.

That's why SpaceX workers immediately checked for leaks, according to the book. An engineer named Kevin Mock extended a 20-foot pole with a "sniffer" tool, which can detect propellant gases in the air, toward the spaceship bobbing in the water.

person in a hardhat works on equipment on the outside of a towering, dirty-looking white spaceship
Support teams onboard a SpaceX recovery ship work around a Dragon spacecraft shortly after it lands. (NASA/Keegan Barber)

With no leaks detected, the team hauled Dragon onto the barge with a crane. Then, two engineers and three technicians donned protective gear and independent air supplies, boarded the barge, and began the hazardous task of emptying the spaceship's fuel tanks.

That went off without a hitch, and the team returned to the crew boat to sleep. The next day brought trouble.

Stuck sleeping in a shipping container

On day two, Mock's five-person team spent about eight hours draining fuel from the spaceship's system and storing it in containers.

The ocean became rough, buffeting the barge with large waves by nightfall. When the workers were ready to return to the crew boat, the captain decided conditions were too dangerous for them to cross over.

Mock and his crew were stuck on a barge full of toxic, highly reactive fuel and had no beds for the night.

The SpaceX employees on the crew boat filled a trash bag with snacks and a thermos of coffee, shoved sleeping bags into another trash bag, and threw both onto the barge. Mock's crew laid their sleeping bags inside a 20-foot-long shipping container on board the barge.

"We got the best night's sleep we could," Mock told Berger. "We were exhausted, so I can't say that I slept terribly that night."

The next day, they finished emptying the spaceship's propellant.

"It's the hardest work I've ever seen at SpaceX or anywhere," Roger Carlson, a physicist who was watching from the crew boat, told Berger.

Berger's new book said that working at SpaceX in those days was tough, but the gig had a strong appeal.

"You're going to work super hard, but you're also going to get to work on cutting-edge stuff," Berger told BI when promoting the book. "After a few years there with that on your résumé, you can basically write your ticket anywhere in the industry you want to go."

Berger wrote that after that first flight, SpaceX got authorization to ship Dragon back to its facilities on land after depressurizing the propellant system.

Future crews did not have to spend days offloading hypergolic fuel at sea. These days, retrieving a Dragon only takes a few hours and hasn't caused deadly explosions.

The Dragon spaceship went on to become a staple of NASA's programming, transporting supplies and astronaut crews to and from the International Space Station. It's also flown five private crew missions.

This article was originally published by Business Insider.

More from Business Insider: