Asterisk's AMI Return Empty String

About 2 months a ago, one day server of our customer decided to response empty string on Command Action. we feed bunch of data for reporting with AMI and especially with Command Action.

It was so mystery for us ! what happen suddenly ? anyway we were lucky, we had a backup and moved server to backup ones.

After works on that server we discovered this problem solved when we run asterisk as a root !
Anyway we did not work on that server until today. I get asterisk source code and debug lines and found a problem :
For unknown reason ownership of /tmp was different from always and a function wants to create temporary file but could not access to /tmp (file main/manager.c about line 1736).

If Asterisk Developers checks return value of mkstemp and debug if value is -1, life would be more pleasure