Check engine light on 2024 sentra

I have a new 2024 sentra i got about a month ago. I noticed the check engine light is on only when i have the battery turned in, along with that red light. When i turn on the car, both lights go away. Not sure what this means. Any help would be great.

I have a new 2024 sentra i got about a month ago. I noticed the check engine light is on only when i have the battery turned in, along with that red light. When i turn on the car, both lights go away. Not sure what this means. Any help would be great.