Still Uncaught Error of type [swift_connection_exception]
Moderators: Chris Corbyn, General Moderators
-
Panospheric
- Forum Newbie
- Posts: 5
- Joined: Wed May 16, 2007 6:26 am
Still Uncaught Error of type [swift_connection_exception]
Hi,
I am connecting via SMTP.
I have upgraded to version 3.2.6 PHP4 since I was receiving an error message that others had experienced as well and it had been fixed in the latest version. Even though, I am still receiving the same error message.
Uncaught Error of type [swift_connection_exception] with message [There was a problem reading line 1 of an SMTP response. The response so far was:[]. It appears the connection has died without saying goodbye to us! Too many emails in one go perhaps? (fsockopen: #0) ]
...
in /home/username/public_html/_PRIVATE/Classes/SwiftMailer/Swift/Errors.php on line 99
Most likely the problem occurs when using file attachments. The file attached was only 1K in size so it's an easy task. The weird thing is, that even though the class fails with this error message, all the emails have been actually sent including the attachments.
I would really appreciate any help with this matter.
Despite the error message I receive, Swift mailer rocks.
Thanks.
I am connecting via SMTP.
I have upgraded to version 3.2.6 PHP4 since I was receiving an error message that others had experienced as well and it had been fixed in the latest version. Even though, I am still receiving the same error message.
Uncaught Error of type [swift_connection_exception] with message [There was a problem reading line 1 of an SMTP response. The response so far was:[]. It appears the connection has died without saying goodbye to us! Too many emails in one go perhaps? (fsockopen: #0) ]
...
in /home/username/public_html/_PRIVATE/Classes/SwiftMailer/Swift/Errors.php on line 99
Most likely the problem occurs when using file attachments. The file attached was only 1K in size so it's an easy task. The weird thing is, that even though the class fails with this error message, all the emails have been actually sent including the attachments.
I would really appreciate any help with this matter.
Despite the error message I receive, Swift mailer rocks.
Thanks.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
What does the log reveal?
Code: Select all
$swift =& new Swift( ... );
$swift->log->enable();
// ... snip ...
//Send messages etc...
// ... snip ...
echo "<pre>" . $swift->log->dump() . "</pre>";-
Panospheric
- Forum Newbie
- Posts: 5
- Joined: Wed May 16, 2007 6:26 am
Thank you very much for your response.
I have raised the SMTP timeout with $smtp->setTimeout(30); and since then have not received any error message yet. But like I said it comes randomly. I have also added the Swift log dump and will keep testing to see if I still get this message. I will get back as soon as I have more info after thorough testing.
Thank you
I have raised the SMTP timeout with $smtp->setTimeout(30); and since then have not received any error message yet. But like I said it comes randomly. I have also added the Swift log dump and will keep testing to see if I still get this message. I will get back as soon as I have more info after thorough testing.
Thank you
-
Panospheric
- Forum Newbie
- Posts: 5
- Joined: Wed May 16, 2007 6:26 am
Hi,
I still have received the same error message several times after thorough testing.
I did not get any $swift->log->dump() output at this time though since it ended with the uncaught error message and would not get to the part where I output the log-dump, right after $swift->send().
Uncaught Error of type [swift_connection_exception] with message [There was a problem reading line 1 of an SMTP response. The response so far was:[]. It appears the connection has died without saying goodbye to us! Too many emails in one go perhaps? (fsockopen: #0) ]
...
in /home/username/public_html/_PRIVATE/Classes/SwiftMailer/Swift/Errors.php on line 99
Is there another place I could output the log-dump and the error message at the same time?
I have this on a live site and am worried about clients receiving this error message.
Thank you very much for your support on that.
Chris
I still have received the same error message several times after thorough testing.
I did not get any $swift->log->dump() output at this time though since it ended with the uncaught error message and would not get to the part where I output the log-dump, right after $swift->send().
Uncaught Error of type [swift_connection_exception] with message [There was a problem reading line 1 of an SMTP response. The response so far was:[]. It appears the connection has died without saying goodbye to us! Too many emails in one go perhaps? (fsockopen: #0) ]
...
in /home/username/public_html/_PRIVATE/Classes/SwiftMailer/Swift/Errors.php on line 99
Is there another place I could output the log-dump and the error message at the same time?
I have this on a live site and am worried about clients receiving this error message.
Thank you very much for your support on that.
Chris
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Ok, there is a way to output the log after the error is thrown by using set_error_handler() but I'll first try to establish why you're getting this error. Could you answer the following:
1. Does this happen every time consistently?
2. How many emails are you trying to send, roughly? Are talking more than 100?
3. How fast is your network?
4. What load is your server running at? (Load evergae/CPU usage)
5. If you ping the SMTP server is there any packet loss?
6. Does this error happen at the very end of execution? i.e. do all the emails send before the error is produced?
Cheers,
Chris
1. Does this happen every time consistently?
2. How many emails are you trying to send, roughly? Are talking more than 100?
3. How fast is your network?
4. What load is your server running at? (Load evergae/CPU usage)
5. If you ping the SMTP server is there any packet loss?
6. Does this error happen at the very end of execution? i.e. do all the emails send before the error is produced?
Cheers,
Chris
-
Panospheric
- Forum Newbie
- Posts: 5
- Joined: Wed May 16, 2007 6:26 am
Hi,
1. This happens randomly.
2. We are only sending out several emails including auto-responder messages, way under a 100, so an easy task.
3. We are running dual chip AMD 246 on a VPS, plenty CPU power.
4. Bandwidth usage is not very much: 600 Meg
5. I pinged the server several times without any package loss but since the problem occurs randomly there could be package loss.
6. The error happens at the end of execution after all e-mails have been sent.
I am currently talking to my web host about the SMTP issue. I am awaiting their response. It seems to me rather a problem with the web host's SMTP server. We have another web host and I will install the script on that server to see if it is the SMTP server itself that's causing the problem.
I wonder if there is a way for my script to access this swift error before it's output and deal with it in a more settle way?
Thank you very much for your help.
Chris
1. This happens randomly.
2. We are only sending out several emails including auto-responder messages, way under a 100, so an easy task.
3. We are running dual chip AMD 246 on a VPS, plenty CPU power.
4. Bandwidth usage is not very much: 600 Meg
5. I pinged the server several times without any package loss but since the problem occurs randomly there could be package loss.
6. The error happens at the end of execution after all e-mails have been sent.
I am currently talking to my web host about the SMTP issue. I am awaiting their response. It seems to me rather a problem with the web host's SMTP server. We have another web host and I will install the script on that server to see if it is the SMTP server itself that's causing the problem.
I wonder if there is a way for my script to access this swift error before it's output and deal with it in a more settle way?
Thank you very much for your help.
Chris
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Sounds almost as if the SMTP server is closing the connection when Swift sends the QUIT command. What *should* happen is that the SMTP first replies with the SMTP equivalent of "Ok, bye then" before closing the connection. I have followed RFCs but your wouldn't be the first STP server to do this... Since it's not technically fatal, I'll make that check leniant and simply log it if the server doesn't respond as expected rather than throwing an error.
-
Panospheric
- Forum Newbie
- Posts: 5
- Joined: Wed May 16, 2007 6:26 am
First of all thank you very much for your great support in this matter.
I have checked my server logs and every time I get this error it shows a lost connection. I talked to my web host and that's what they are telling me:
I have raised the swift->timout() to 60 sec. and I haven't received an error yet.
Like you said, since it is not technically fatal, I would very much appreciate if you could log the error rather than actually throwing the error.
I must say one thing. Your mail class rocks and puts every other mail class on the Internet in the dark. As soon as our new business has taken off and created some income, I will definitely show my appreciation by donation to your fund so you can go to Australia - great place to go. I have much respect for people like you that put out so much with little in return. I want to encourage other people as well to help you out with this great project.
Thank you so very much for your expertise and kind, hard work.
Chris
Technical Director
Panospheric Virtual Imaging
I have checked my server logs and every time I get this error it shows a lost connection. I talked to my web host and that's what they are telling me:
That might be true on a busy server but in our case we are talking about very light traffic. I have tried Swift Mailer on another server where we have a shared hosting account and it worked fine. Most servers are sharing resources with other accounts unless you can afford to have only one account per dedicated server."You are on a VPS, so I believe what is happening is the server is hanging due to sharing system resources with other accounts. (this is very common with VPS accounts) when the system hangs the mail-script times out which drops the connection to the mail-server. If you can increase the timeout to say 60 seconds I think this would resolve your issue.
This is typical for VPS accounts.. it happens on all Virtuozzo servers.. the server will appear to lockup briefly for 10-20 seconds in addition to loads
and memory resources being used by other accounts."
I have raised the swift->timout() to 60 sec. and I haven't received an error yet.
Like you said, since it is not technically fatal, I would very much appreciate if you could log the error rather than actually throwing the error.
I must say one thing. Your mail class rocks and puts every other mail class on the Internet in the dark. As soon as our new business has taken off and created some income, I will definitely show my appreciation by donation to your fund so you can go to Australia - great place to go. I have much respect for people like you that put out so much with little in return. I want to encourage other people as well to help you out with this great project.
Thank you so very much for your expertise and kind, hard work.
Chris
Technical Director
Panospheric Virtual Imaging