I have unfortunately have the dreaded P0171 in my 02 WRX. I've been doing a lot of reading on the issue and there are such a wide array of problems I'm not sure of what to do next. Only mods I have are Perrin crank pully, K&N short ram intake and Invidia turbo-back exhaust.
. My car just just under 150k miles and was running awful, pulsing when I would get on the throttle, and wasn't idling the best. I cleaned the IACV out and put in a new gasket (even though the old one was fine), changed spark plugs since I'm pretty sure they were the originals, and also changed the fuel filter. I have a K&N short ram that has been on the car for at least 6 years and I re-oiled the filter about a month ago. The MAF was really dirty so I clean it with MAF cleaner. When I was changing the spark plugs I noticed two hoses were disconnected either side of the car, so I reconnected and hose clamped them on so they wouldn't come out. I looked into it and they were just the breathers that connect to each other and run through the line in front of the intercooler so that shouldn't have been the source of the problem either. After about 100 miles the CEL came back on and was P0171 still. After all those changes the car was running the best it has in a long time and was driving like there were no issues anymore.
I was wondering what my next course of action should be. I checked to make sure no lines were blatantly unhooked but didn't see any except for the breather hoses. Is there a diagram or even a checklist of all vacuum lines to check? Would it be a good idea to pull the intercooler and check all of the lines for leaks? I don't know anyone who could swap MAF's for a day but should i just buy a new one and if the code doesn't go away return it? Another idea I had to was put the stock air box setup back in, even though the car has been running great for years with the K&N setup. Also, to check the front O2 sensor could I do the CEL fix and put a resistor where the plug is and see if it goes away? Any and all help is appreciated, thanks!