This could be because the food goes stale. A bag of food shouldn’t be open for more than 4 weeks (in a sealed bag or other airtight container). You can do one of 2 things:
Divide the bag into weekly portions, put them in zip lock bags and freeze them, or Freeze (in a zip lock bag/container) the amount that is normally left at the end of the bag when your pet goes off the food. This helps to keep the food fresh.