Welcome.

Check all vacuum hoses too. Test by spraying some carb. cleaner on them. If it idles faster when you spray on that location, you found your leak.
From TSB.
P0171 - System Too Lean (Bank 1 Firewall side) The Adaptive Fuel Strategy continuously monitors fuel delivery hardware. The code is set when the adaptive fuel tables reach a rich calibrated limit.
Fuel System:
�· Contaminated fuel injectors
�· Low fuel pressure or running out of fuel (fuel pump, filter, fuel supply line restrictions)
�· Vapor recovery system (VMV)
Induction System:
�· MAF contamination
�· Air leaks between the MAF and throttle body
�· Vacuum leaks
�· PCV system concern
�· Improperly seated engine oil dipstick
EGR System:
�· Leaking gasket
�· Stuck EGR valve
�· Leaking diaphragm or EVR
Base Engine:
�· Exhaust leaks before or near the HO2S
�· Secondary air concern
Powertrain Control System:
�· PCM concern
P0174 - System Too Lean (Bank 2 Radiator side) Same as DTC P0171, but Bank 2. See Possible Causes for DTC P0171