On “The Amazing Race,” it’s not unusual to see a team’s trek around the world delayed due to a flat tire or a driver who gets lost. But it’s not just the contestants who are in a race against the clock — it’s the crew, too.

Up to 3,000 people —producers, camera and sound technicians, local crew members — work on the CBS reality show globally each season, which films at a break-neck pace for 23 days straight (with no second takes). And though each location is meticulously scouted and permitted by executive producers in advance, with travel involved, things are bound to go wrong.

“There are all of these real-life factors that we have no control over,” says host Phil Keoghan. “Every single day is so planned out, if one thing falls out of place — which it does constantly — then you have to fix not just the immediate problem,” but everything that comes after that.

Ahead of Thursday’s 29th season finale (10 p.m. on CBS), Keoghan and “Amazing Race” executive producers/co-creators Bertram van Munster and Elise Doganieri reveal the one country they said no to visiting (Qatar, the government was too disorganized), the one Keoghan wouldn’t want to go back to (Madagascar, the crew got sick with a stomach bug) and other tales from behind the scenes.

Detained in Ukraine

In Season 10, the crew was traveling to Ukraine in the middle of the night when Keoghan, who was told he didn’t need a visa to enter the country on his New Zealand passport, got pulled out of line at the airport, escorted away by guards who didn’t speak English, and locked in a room alone for hours. Around sunrise, the producers were finally able to get him freed. “Some woman who worked for the American government had been up all night trying to process a visa for me — she’s a huge ‘Amazing Race’ fan,” Keoghan says. His passport was processed just in time to get to the pit stop 10 minutes ahead of the first team arriving.

Working on island time

The urgency and pace of TV production doesn’t always translate to more laid-back cultures. Van Munster recalls one shoot at the pyramids in Egypt where their local production coordinator never showed up to the 5 a.m. call time. His reasoning? “He says, ‘Mr. Bert, I was very tired yesterday.’ You can only say ‘OK,’ because what are you going to do? His excuse was genuine.” Producers have since come up with a foolproof way to make sure all the local crew members arrive in time to meet the teams. “Now, we will get a van and we’ll drive around the village knocking on doors and we’ll pick everybody up,” Doganieri says.

Joyriding contestants

It’s not just slow-moving locals producers have to wrangle — the show is occasionally at the mercy of rogue teams. In one episode in Hong Kong, the two contestants in last place loved the city so much, they decided not to check in with Keoghan so as to extend the race (and their vacation). “They waited for hours and hours, went to a restaurant — it cost me a fortune in overtime,” van Munster says. “We heard them on the mic say we’re not checking in because this is too much fun.”

Camera-ready on the road

The 50-year-old Keoghan doesn’t have the luxury of a wardrobe or makeup staff on the road, which means he’s often washing his hair in some strange places (in a parking lot, on a plane). “The hair dryer on the go is my head out the window, which always gets a laugh from the drivers,” he says. And the hats he took to wearing in later seasons aren’t a fashion statement, but a preventative measure after having six sunspots removed from his face. “My dermatologist said … ‘You’ve got to cover it up.’ It’s not all ‘Race.’ I grew up in the Caribbean and I’ve had a lot of sun damage over the years. Now I try to be really careful.”