Bad Gas or Electrical Problem (or something else maybe)?

I have a 2006 Subaru Legacy with ~78,000 miles on it. For the last 6 months I have been experincing an intermittant problem. Every now and then I’ll try to accelerate from a complete stop and I will have limited power (can’t go more than 5-10 MPH). If I turn my car off and try to turn it back on, the engine will not start. On the second try, it always starts with no problem. Also, when this happens the Check Engine and the Battery indicator lights turn on and flash. I have been told it’s an electrical problem, but the Subaru mechanics have not been able to replicate it or find any issues with the eletrical connections. I was then told the other day it could be bad / dirty gasoline. Any ideas? Thanks!

What OBD-II codes are being recorded when this happens? Knowing that would help greatly with the guesses on this problem.
Some auto stores will pull the codes for free for you. The codes are in the format of one letter followed by four numbers. Report back the codes, not what the store says they mean.
The light does not have to still be on to get the codes, as long as it hasn’t been too many days since it last happened.

Bad gas is seldom the cause of a problem. I would not worry about that, especially when that CEL (check engine light) is just a kid in class waving her hand trying to get you attention because she has the answer. You need to have the codes read. Some places will read them for FREE. Try Autozone or Advanced Auto Parts. Get the exact code (like P0123) not just their translation into English and post it back here.

It’s almost never a case of bad gasoline. That’s what know-it-alls always say whenever they are stumped. That remark is almost as common as “They all do that.”

As mentioned above, the OBD-II codes will provide a valuable first clue. Do this the next time your car acts up.