For the last five years, top shipping companies pushed forward with fat investments in more and bigger vessels, even as signs of trouble piled up.
The goal was to shore up profits by doing business on a larger scale as global trade bounced back after the recession. But the new business never came. Freight rates dropped and shippers' revenues plunged.
Today, the supply of ships and their capacity is completely out of whack with demand. China's economy has slowed and consumer goods flooding the U.S. have saturated the market to the point where there's no more room for growth, analysts say.
And the industry is no longer under the delusion that it can grow its way out of trouble. That became clear with the Aug. 31 bankruptcy of South Korea's Hanjin Shipping Co., the world's seventh-largest shipper, which temporarily marooned $14 billion of goods as ships were denied access to ports from Shanghai to Los Angeles.
"That cozy assumption that carriers can't be killed off has been eroded. We know they have breaking points now," said Simon Heaney, an analyst at London-based Drewry Shipping Consultants.
Hanjin began unloading ships at San Pedro Bay last week, after a court in New Jersey gave the company protection from U.S. creditors, and a South Korean court OK'd the release of $10 million to process the cargo.
But the debacle is a sign that the economic failures that have been roiling shipping for years may be reaching a crisis point.
Shippers prepared for a bonanza that never materialized, and now they are paying the high cost of sending partly empty vessels around the world.
The stall is visible at the nation's largest ports, in Los Angeles and Long Beach, where combined cargo traffic — imports and exports — is up only 0.9% through August.
Imports alone were down 10.2% at the Port of Long Beach compared with last August, and up less than 1% at the Port of Los Angeles.
The world's fleet of container ships is likely to grow 2% faster than the demand for them in 2016, the credit rating firm Moody's Investors Service reported in June. Moody's said the supply/demand mismatch would continue at least through next June.
The industry is expected to lose $5 billion this year, according to Drewry.
The problem has been magnified by the launch of several mega-ships, which carry twice as much cargo as the ones that came to U.S. shores five years ago. These vessels can stretch for five city blocks, and accommodate more than 18,000 20-foot containers.
"It's as if the airlines went out and bought 20% more aircraft than they had customers to buy tickets, and then wondered what happened," said Paul Bingham, a trade economist with the Economic Development Research Group Inc., in Boston. "It was unsustainable."
In April, the cost of shipping a 40-foot container from Hong Kong to Los Angeles fell to $623, the lowest rate in five years, according to Drewry.
In other words, you could have packed your bed, sofa, shelves, dining room table, chest of drawers and all your clothes in a 40-foot container and shipped it across the Pacific Ocean at half the price you'd pay to put it all on a truck and send it to New York.
AJ Forsythe, the 28-year-old chief executive of San Francisco-based iCracked, started to notice shipping rates drop two years ago and couldn't quite believe how far down they went.
ICracked — which repairs cellphones and tablets, and sells gadget parts and accessories on its website — was recently paying $800 to ship a 40-foot steel box from one continent, which Forsythe called "insane."
Every day, the company has products and parts moving on the sea between China, Japan, South Korea and Oakland, so the savings add up. In the last two years, Forsythe has doubled the size of his staff, which now includes 4,000 technicians.
"Every dollar that we save that isn't going into shipping, that's more people we can hire to run our business," Forsythe said.
He just cut the cost of a do-it-yourself repair kit by about $90, partly because of low freight costs. "It's coming through as cheaper products and cheaper commodities," Forsythe said.
Ryan Petersen knew that the price drop would wreak havoc on Hanjin, which is minuscule compared with the Danish APM-Maersk line or the Swiss Mediterranean Shipping Co.
Petersen, 36, is the chief executive of Flexport, a San Francisco company that coordinates the shipment of retailers' products to and from the U.S., acting like a travel agent for importers and exporters.
Two months ago, Petersen says, he began avoiding Hanjin.
"It wasn't that hard to see this coming," Petersen says. "You can look and see whose balance sheet is the weakest and who doesn't have the scale."
It's been hard to find many attractive balance sheets in the industry of late. Experts have pointed to the Japanese Nippon Yusen and the South Korean Hyundai Merchant Marine Co as potentially vulnerable. Shares of Nippon are down 37% since last September, and shares of HMM are down 84% over the year.
Shipping giants have begun to contain the damage by pulling vessels out of service — or destroying them.
In August, 4.5% of the total container ship capacity had been sitting idle for at least two weeks, Drewry said. And 124 ships have already been demolished this year, up from 85 in 2015, according to Braemar ACM Shipbroking in London.
Hanjin is trying to sell the majority of its current fleet and offload all of its 61 chartered ships, as part of a rehabilitation proposal during bankruptcy proceedings in South Korea, the Wall Street Journal reported on Friday.
Maersk, the world's biggest shipping line, had been at the forefront of the mega-ship frenzy, ordering 20 of some of the biggest vessels on the market in 2011. But recently the company has reduced the size of its orders relative to its overall fleet, and it has become more likely to give up chartered ships, which it leases for a period of time.
"We have been growing our fleet at a more modest pace than we would have in the past," said Soren Egholm, vice president of trade and marketing for Maersk Line North America.
Egholm said the company prefers to relinquish leased vessels than to cancel sailings or leave ships at anchor, which reduces supply but can be costly. Idling vessels "is just like buying a car you don't use — it's a way to save fuel but it's not the best way to save money."
Partly thanks to the capacity moves, rates have started to recover. Drewry, the consulting firm, expects them to rise even more next year, if only because they simply can't go any lower than they've been.
"Even a dead cat bounces, so any bump you might see doesn't meant there is any life in anything," analyst Heaney said.
Follow me @NatalieKitro on Twitter