Tesla is smack-dab in the midst of “production hell” for its Model 3 electric car, and one of the most bedeviling demons is the process of putting together the batteries at its massive factory outside Reno, Nevada.

No wonder Tesla CEO Elon Musk has camped out on the roof of the structure trying to solve the problem.

On Wednesday afternoon, during Tesla’s third-quarter earnings announcement, the car company revised its early production goals for the Model 3. Previously, Tesla said it planned to make 5,000 Model 3 cars per week at some point this year. Instead, Tesla said it will now attempt to hit that goal by “late Q1 2018.”

That could equate to a potential delay of around three months.

Tesla said that because production of the Model 3 is so automated -- compared to both its previous cars and other cars on the market -- “bringing this level of automation on-line is simply challenging in the early stages of the ramp.” The company said that it is difficult to predict how long bottlenecks would take to clear or when new ones might emerge.

While the delay isn’t all that long considering Tesla has historically delayed its previous cars for many months, it could be a worrisome sign for the company’s extremely ambitious production goals. It doesn’t just plan to make 5,000 Model 3 cars per week next year -- it hopes to boost that to 10,000 cars per week at some point.

By 2018, Tesla wants to make 500,000 of all of its cars combined each year -- a massive jump from the nearly 80,000 it made last year. This year, Tesla expects to make 100,000 cars. The company will need to quintuple its production next year to meet its overarching vehicle manufacturing goal.

Tesla said on Wednesday that the main problem holding up production of the Model 3 has been with the battery module assembly line at the Gigafactory. That’s where battery cells are packaged into modules, and four modules are packaged into a battery pack with an aluminum case. 

Tesla said that two of the sections of this module assembly process were previously completed by suppliers, but that Tesla took over those steps and automated them. Musk said on the earnings call that Tesla had to rewrite much of the software for these sections and that a supplier has “dropped the ball.”

The company is using its best engineering talent to try to fix the problem, according to the CEO. Musk added that Tesla CTO JB Straubel is basically spending his entire life at the Gigafactory right now.

Musk himself is laser-focused on fixing the bottlenecks -- even conducting the earnings call from the Gigafactory, because that’s where the bottleneck is. “One should lead from the front lines; that’s why I’m here,” said Musk.

It’s not a surprise that Tesla is pushing back its Model 3 production goal. Last month the company said it had delivered just 220 Model 3 cars, instead of the 1,500 it planned. On Wednesday, Tesla confirmed that it had delivered 222 Model 3 cars for the third quarter.

Tesla could see a jump in its costs related to the Model 3 as a result of the extra work spent on eliminating bottlenecks. Overall, Tesla plans to make $1 billion worth of capital expenditures in the fourth quarter -- much of that consists of payments on Model 3 equipment and Gigafactory gear.

Tesla will lose money on each Model 3 car made in the short term, but plans to break even by the end of the year. At some point in 2018, the Model 3 should reach its margin target of 25 percent, according to company leadership.

For the third quarter, Tesla said it generated $2.98 billion in revenue, a jump from the $2.30 billion that it generated in the third quarter a year ago. Over the same period, Tesla said it lost $671.16 million, compared to the $21.88 million in profit it made in the third quarter of 2016.

That’s a massive loss -- and it looks to be the largest loss in the company’s history.

The loss was also bigger than analysts had expected. Tesla’s stock dropped over 4 percent in after-hours trading to $306.53 from $321.08 at close.