Multirotor aircraft cannot lock heading

We recently conducted a flight test for our own Octo-copter, but it could not lock the heading and would continue to deflect counterclockwise when it is in loiter mode. Here is the log file. Please help. thank you!

https://drive.google.com/file/d/1Wf4v1rq7Mcavq9ipkWSL12qAKRFZ9g-4/view?usp=sharing

How sure are you that all motors are operating correctly?

Please update to ArduCopter 4.0.7 and setup the system again.

if you use pwm for the motors, calibrate the ESCs and make sure all of the motors are straight and there are no trims.