Quick little DIY on the M54 6 cylinders valve cover gasket. Sometimes the covers themselves have very small hairline cracks that cause intake leaks and check engine lights. I've had to replace the entire cover on 2 cars so far, and they're not cheap ($350).
If you can get away with just a gasket, consider yourself very lucky!
https://www.youtube.com/watch?v=XkNaNGtnyYU
May as well do the spark plugs while you're in there:
https://www.youtube.com/watch?v=sjAojOoi_ZQ