[asterisk-bugs] [Asterisk 0014379]: AMI shows utils.c:1198 ast_careful_fwrite: fflush() returned error: Broken pipe

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Feb 4 14:33:54 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14379 
====================================================================== 
Reported By:                chris-mac
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   14379
Category:                   Core/ManagerInterface
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): 1.6.1 
SVN Revision (number only!): 172030 
Request Review:              
====================================================================== 
Date Submitted:             2009-01-31 16:50 CST
Last Modified:              2009-02-04 14:33 CST
====================================================================== 
Summary:                    AMI shows utils.c:1198 ast_careful_fwrite: fflush()
returned error: Broken pipe
Description: 
When sending data to AMI socket, without reading (waiting for) response -
console shows:

ERROR[5148]: utils.c:1198 ast_careful_fwrite: fflush() returned error:
Broken pipe

How to reproduce:
0. You will need php5-cli installed
1. Download 'AMI.class.php' and 'ami-test.php' attached.
2. Edit AMI username/password in 'ami-test.php'.
3. Run ./ami-test.php
4. Watch Asterisk console

NOTE: To revert back to a 'normal' behaviour, change line 72 of
'AMI.class.php' to: 'public $sync = true;'


====================================================================== 

---------------------------------------------------------------------- 
 (0099440) putnopvut (administrator) - 2009-02-04 14:33
 http://bugs.digium.com/view.php?id=14379#c99440 
---------------------------------------------------------------------- 
I believe I see what the problem is. The problem is that the response sent
by the manager for the Logoff action is being sent to a remotely-closed
socket. I was able to easily reproduce the error message by using your
scripts.

I re-ran the test and changed the "sync" variable in AMI.class.php to be
true instead of false. While it took noticeably longer for the script to
complete, it meant that we waited for the responses to reach us before
moving on to the next command, and we did not get any broken pipe messages
that way either.

In your particular case, the "Broken pipe" message can be safely ignored
because you have purposely closed your end of the socket. Removing the
message may not be a great idea though, because in other cases, it can
serve as a genuine indication to someone that there is a problem with their
connection. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-02-04 14:33 putnopvut      Note Added: 0099440                          
======================================================================




More information about the asterisk-bugs mailing list