PDA

View Full Version : pipe works but also errors...


gbh1935
01-08-2008, 05:47 AM
The pipe I have setup works in that it sends the emails and creates the tickets, but it also always generates an error email back to the sender that submitted the ticket via email. Attached is there error email.

pipe to |/home/gbhloop/www/support/api/pipe.php
generated by bugtickets@something.com
local delivery failed

The following text was generated during the delivery attempt:

------ pipe to |/home/gbhloop/www/support/api/pipe.php
generated by bugtickets@something.com ------

PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in /home/gbhloop/public_html/support/main.inc.php on line 48
PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent in /home/gbhloop/public_html/support/main.inc.php on line 48
PHP Fatal error: Call to undefined method Dept::getDeptId() in /home/gbhloop/public_html/support/include/class.ticket.php on line 1009

------ This is a copy of the message, including all the headers. ------
...

Any ideas???

waynei61
01-08-2008, 08:45 AM
I use cpanel

I set up an email forward rule:
support@mydomain.com
|"/home/MY_USER_NAME/public_html/support/api/pipe.php"

Notice I used quotes - I have seen others use the quotes outside everything

Also my pipe.php is CHMOD 764

It looks like the errors are in the program execution - maybe check the CHMOD settings
of the files involved. Start by checking pipe.php

Wayne

runewolf
01-08-2008, 01:54 PM
Yep I'm getting the same error. The ticket is logged in the correct dept, but I get the error.

pipe.php is chmod 764
I have the forward setup to "|/usr/bin/php -q /home/wvsr/public_html/ost2/api/pipe.php"

If I remove the -q I get this error, but the ticket is logged correctly:
PHP Fatal error: Call to undefined function: getdeptid() in /home/wvsr/public_html/ost2/include/class.ticket.php on line 1009
X-Powered-By: PHP/4.4.7
Set-Cookie: PHPSESSID=6b81202a63399abb6f9f0f6e1f0d451a; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-type: text/html

gbh1935
01-08-2008, 06:33 PM
same situation here, I guessing there is a php execution error in mid script. The tickets are issued, the alert email goes out, but I get a return email with the error in delivery.

as a side note, vacation is misspelled in the sql statement in

includes/class.ticket.php

$sql='SELECT staff_id FROM '.STAFF_TABLE.' WHERE onvavaion=0 AND dept_id='.db_input($dept->getDeptId());

peter
01-08-2008, 06:56 PM
The error occurs when Dept. members alert is enabled on new tickets!

in include/class.ticket.php line 1009.
Change:
$sql='SELECT staff_id FROM '.STAFF_TABLE.' WHERE onvavaion=0 AND dept_id='.db_input($dept->getDeptId());to:
$sql='SELECT staff_id FROM '.STAFF_TABLE.' WHERE onvacation=0 AND dept_id='.db_input($dept->getId());Thanks everyone.

runewolf
01-08-2008, 08:19 PM
Made that change and now I am still getting part of my error:

PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in /home/wvsr/public_html/ost2/main.inc.php on line 48
PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent in /home/wvsr/public_html/ost2/main.inc.php on line 48

gbh1935
01-09-2008, 12:20 AM
I made the same change to 1009 and still get the error

PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in /home/gbhloop/public_html/support/main.inc.php on line 48
PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent in /home/gbhloop/public_html/support/main.inc.php on line 48
PHP Fatal error: Call to undefined method Dept::getDeptId() in /home/gbhloop/public_html/support/include/class.ticket.php on line 1009

My guess there is a scoping error on the Dept::getDeptId()

gbh1935
01-09-2008, 01:15 AM
ok, found the other change to the getID on that sql statement and made that change. The PHP fatal error is now gone leaving just the warnings.

PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in /home/gbhloop/public_html/support/main.inc.php on line 48
PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent in /home/gbhloop/public_html/support/main.inc.php on line 48

My script does have the -q option on it which surpresses headers if I remember correctly, but I am gessing it is the session start on line 48 of main.inc.php that is killing things.... Is there a way to surpress the sessions???

gbh1935
01-09-2008, 11:29 PM
well... to get rid of the extra error messages and email message, I added an error_reporting(0) before the start_session to kill the warning message. That has eliminated the extra email with the error message and all appears to be working correctly with the emails.

bignose
01-17-2008, 04:47 PM
I'm experienceing this error as well, except it seems to die around line 1009, and therefore department members do not get notified of new tickets.

Anyone else?

bignose
01-17-2008, 04:57 PM
Here is some debuggging code i added

The WEIRD part is, if i send mail from the command line, sometimes I see
11, and sometimes I see both 11 and 12, without changing anything in settings or code. Which only makes me thing fopen or fwrite is foiling me, but that sounds very strange.


$fh = fopen('/tmp/x_jeff', 'w') ; fwrite($fh,"11 - DEBUG\n"); fclose($fh);
//Staff members
if($cfg->alertDeptMembersONNewTicket()) {
$fh = fopen('/tmp/x_jeff', 'w') ; fwrite($fh,"12 - DEBUG\n"); fclose($fh);
$sql='SELECT staff_id FROM '.STAFF_TABLE.' WHERE onvacation=0 AND dept_id='.db_input($dept->getDeptId());
if(($users=db_query($sql)) && db_num_rows($users)) {
while(list($id)=db_fetch_row($users))
$recipients[]= new Staff($id);
}
$fh = fopen('/tmp/x_jeff', 'w') ; fwrite($fh,"14 - DEBUG\n"); fclose($fh);
}
$fh = fopen('/tmp/x_jeff', 'w') ; fwrite($fh,"15 - DEBUG\n"); fclose($fh);

peter
01-17-2008, 05:12 PM
See my previous post on this thread.

$sql='SELECT staff_id FROM '.STAFF_TABLE.' WHERE onvacation=0 AND dept_id='.db_input($dept->getDeptId());

Vs.

$sql='SELECT staff_id FROM '.STAFF_TABLE.' WHERE onvacation=0 AND dept_id='.db_input($dept->getId());

$dept->getDeptId() => $dept->getId()

bignose
01-17-2008, 06:35 PM
thanks. that fixed it.

first time i thought the only change was onvavaion

kidino
06-04-2008, 03:55 AM
You guys have any other thoughts? I checked this thread but nothing is working out. The new reply goes into the DB and gets listed, but it creates a mail delivery reply message to the user.

antara
06-06-2008, 11:37 AM
Anyone?

i also do not receive any autoresponse email for the new ticket.

antara
06-06-2008, 11:45 AM
Fixed the issue with no autoresponders (typo error), but still getting the delivery failed message.