Poison Message. The Conversation Endpoint Is Not In A Valid State For SEND.
Aug 1, 2007
Hi all, i searched everywhere but couldn't find any info on the following error that i'm currently receiving:
"The conversation endpoint is not in a valid state for SEND. The current endpoint state is 'DI'."
I understand that this is due to some problem in my send/receive protocol but how do i fix this problem so that i can continue with my testing? Right now i'm forced to drop my entire test database and reinstall everytime this message shows up because i can't send/receive any messages at that point. Is there anyway to get rid of it?
I already had a thread for same problem but didn't recieved any response in last 4-5 months so I created a new thread for this
I am using service broker in between two database servers. following is the way i am sending and receiving messages
Send
BEGIN TRAN BEGIN DIALOG CONVERSATION @handle FROM SERVICE @SendService TO SERVICE @ReceiveService ON CONTRACT @Contract WITH LIFETIME = @lifetime;
SEND ON CONVERSATION @handle MESSAGE TYPE @xmlMessageType(@xmlMessage); COMMIT
Receive
BEGIN TRAN; RECEIVE TOP(1) @xmlMessage = message_body, @handle = conversation_handle, @message_type = message_type_name FROM TransactionQueue;
---------------------------------------------------------------------------------------------------- -- Check to make sure a message was returned to process. In theory this should never happen. ---------------------------------------------------------------------------------------------------- IF @@rowcount = 1 BEGIN
IF @message_type = 'http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog' BEGIN END CONVERSATION @handle; COMMIT RETURN 0 END
IF @message_type = N'http://schemas.microsoft.com/SQL/ServiceBroker/Error' BEGIN RAISERROR(N'Received error %s from service [Target]', 10, 1) END CONVERSATION @handle; COMMIT RETURN 0 END
SET @sql = 'EXEC '+@message_processor_name+' @xml'
BEGIN TRAN EXEC sp_executesql @sql, N'@xml XML', @xml=@xmlMessage COMMIT TRAN END CONVERSATION @handle; END COMMIT
I see Messages are delivered to the target every thing working fine other than following errors which i am seeing in profiler.
1) "This message could not be delivered because the conversation endpoint has already been closed." I see this error on initiator end. Is it like ending conversation on initiator end when i get "EndDialog" send an acknowledgement, which cannot be recieved by target as it has already ended conversation.
2) "An error occurred while receiving data: '64(The specified network name is no longer available.)'." I don't have much idea about the reason for this error. But in profiler i see value for GUID is different for this error and the real message.
I am ending conversations properly for a dialog, the end conversation at the target properly marks the conversation as closed in sys.conversation_endpoints and sends the EndDialog message to the initiator.
The initiator get the EndDialog message from the target and ends the conversation and it clears out of sys.conversation_endpoints.
I know that to avoid reply attacks that the conversation at the target will only clear out in 30 minutes.
However it has been a day now and the conversation is still sitting in sys.conversation_endpoints as CLOSED at the target.
How do i troubleshoot this ? Why is the conversation not clearing?
Hallo, I have some problems to handle the poison messages.
Messages are exchanged between 2 databases on the same SQL Server instance. I created a Trigger on the insert , that call the sp that begin the conversation(10 minutes Timeout) and send the message to the target queue.
On the target queue I activated a SP and the main code is:
BEGIN TRANSACTION
WAIT FOR (Receive (1) ..) timeout 5000
IF (@ErrorSave <> 0)
BEGIN
INSERT INTO [TestSender].[dbo].[tblErrorXMLMessages] VALUES ();
END
ELSE
if (@messagetypeName = N'Message')
BEGIN
exec [dbo].[sp_ProcessMessage] @message_body
END
ELSE IF (@messagetypeName = N'EndOfStream')
BEGIN
END CONVERSATION @dialog
END
COMMIT TRANSACTION
My communication has a strange behaviour:
if I type
Begin
insert into TriggerTable values(XMLMessage)
insert into TriggerTable values(XMLMessage)
....
insert into TriggerTable values(XMLMessage)
end
Everything work fine but If I write an insert of 1000 message coming from an another table and I use the
cursor login after I while the transmission stop because the Target queue become inactive. I can see my messages stuck in the Initiator transmission_queue so I think that there is some Poison message that cause 5 rollback and disable the receiver queue.
First I would like to isolate the wrong message and carry on with the insert, my application doesn't have to stop the conversation or return any error, but If I use the Sql server Debugger I'm not able to debug the Target queue's stored procedure.
I suppose that some error happens on the Target queue's stored procedure but how can I first at all find it out?
Maybe it has something to do with the transition wrapped around the RECEIVE command?
I know I have to build in some ability to deal with a posion message. I was thinking that (sort of mentioned in the article http://msdn2.microsoft.com/en-us/library/ms166137.aspx) I would write a special stored procedure that would handle this situation. I don't know how I could activate this. I don't want to poll of course in a waitfor.
Hi! I have crl stored procedure with distributed transaction in it. I really need such transaction. When a poison message occurs 5 time my queue is turned off. I've read about handling poison messages in msdn (save transaction and rollback part of it), but it works only with local transaction. What should I do? An important point is that messages shoold be processed in right order, I can't receive message and put it to the end of queue. I want to try process poison message constantly. I doesn't want to stop receiving messages in that queue. Thanks.
I'm using the Service Broker to parallize my processes (I know that the Service Broker was not designed for that purpose), however it's working quite well.
I use the broker procedure to start procedures which all process all a part of the workload. When the procedure fails because of a lock timeout (or for that concern, for whatever reason), I rollback the transaction (which also roll back my message received on the queue so that it can be retried at a later time.). And this is where my problem lies, if there are 5 sequential rollbacks of messages then the poison message detection kicks in and disables the queue, stopping all the processing. :(
Is there a way to disable poison message detection? I have implemented my own stop-mechanism through a counter system on a per sub-task system so if I could disable poison message detection that would be ideal.
If this is not possible is there a way to turn the queue back on automatically so that it will continue processing the messages on the queue?
I am getting the following Error and I can't find it in the Manual.
Failure to send an event notification instance of type 'BROKER_QUEUE_DISABLED' on conversation handle '{5D273374-E84F-DB11-B3BC-0004239AB15C}'. Error Code = '8429'.
I have checked the service name for the notification and it appears to be okay.
I have a SQL 2012 Enterprise edition HADR cluster with 2 nodes and my event log on the second node (current primary for the AG) is being filled with these messages
The Service Broker endpoint is in disabled or stopped state
I wasn't able to find too much on the issue. I did find this one open Microsoft connect bug report from back in April 2013 [URL] .....
O/S: Windows 2012 SQL Server 2012 v11.0.3412 Currently 1 AG with 1 DB
We are trying to queue a xml serialized object to a servive broker queue on a conversation.
The object is a simple .net c# class with few properties mostly string, which we serialize for queing and de/serialize after de-queing. Everything works as expected. Except that when the object contains language characters such as Æ Å Ø, the SEND ON CONVERSATION seems to fail. We are using UTF-8 encoding.
Below is part of the code.
public override bool QueueMessage(EmailMessage message)
{
if (message != null)
{
string xml = "";
using (MemoryStream stream = new MemoryStream())
{
System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(message.GetType());
When examining the "conversation_handle" column value in the Queue (from: "select * from ProcessQueue"), I find the value of the conversation_handle appears to be different from the "conversation handle" ("SEND ON CONVERSATION @conversationHandle...") on which the message was sent.
I'm trying to gather all messages for a given Dialog conversation, but am not able to do this because the conversation_handle doesn't appear consistent between messages in the Dialog.
note: the conversation_handle of "BEGIN CONVERSATION TIMER (@conversationHandle)..." message does appear to be correct in the Queue.
Thoughts on why the conversation_handle listed in the Queue might be different than that of the "SEND ON CONVERSATION @conversationHandle..." command that sends the message?
-- Begin Dialog from Service1 to Service2 on Contract BEGIN DIALOG @conversationHandle FROM SERVICE ExecuteProcess TO SERVICE 'ExecuteProcess' ON CONTRACT Process;
--- --- FROM DEBUGGER: @conversationHandle has value of AC8DF4E0-9F38-DB11-96A2-000CF1D46448 ---
-- Set Message value DECLARE @requestDocument xml SET @requestDocument = N'<ProcessRequestMessage/>';
-- Start Converstation time BEGIN CONVERSATION TIMER (@conversationHandle) TIMEOUT = @queueSeconds;
-- Send Message SEND ON CONVERSATION @conversationHandle MESSAGE TYPE ProcessRequest (@requestDocument);
I received this error when I tried to change the Authentication mode from windows to windows and sql server. a window popped for sa password and i put my password and the error pops. im using sql server 2005.can help?
I have created a very simple report that works correctly when in Report Designer Preview mode. When I deploy to the report server it reports that deployment was successful. When I log into Report Manager the report is visible, but when I click on it I end up at an error page.
The error that I get is: Operation is not valid due to the current state of the object.
I've got a situation where I want to put request message on a queue. Because starting a conversation is the only way to put messages on a queue I have to start a conversation with myself. So my Begin Dialog Statement looks something like this:
DECLARE @conversation_handle UNIQUEIDENTIFIER;
BEGIN DIALOG CONVERSATION @conversation_handle
FROM SERVICE [ServiceName1]
TO SERVICE 'ServiceName1'
ON CONTRACT [ContractName1]
WITH ENCRYPTION = OFF;
SELECT @conversation_handle AS ConversationHandle
I haven't noticed any problems with doing this but I wanted to know if there was anything wrong with it. Does someone know what problems this might cause?
when ever I send my message thru Service Broker I am getting an error message like this "
"Dialog security is not available for this conversation because there is no remote service binding for the target service. Create a remote service binding, or specify ENCRYPTION = OFF in the BEGIN DIALOG statement."
I then try to run the same app from the client computer, it gives me:
Login failed for user 'LAPTOPGuest'.
After looking up the web for solution, I found that I can test the connection from the HOST computer in this way:
C:Documents and Settingskit>sqlcmd -E -S laptopsqlexpress 1> 2>
The test is successful
Now I run the same command on the CLIENT computer
C:Documents and SettingsKit>sqlcmd -E -S laptopsqlexpress Msg 18456, Level 14, State 1, Server LAPTOPSQLEXPRESS, Line 1 Login failed for user 'LAPTOPGuest'.
Now I can sure that from the client computer it cannot make a connection to it, then I look at the errorLog from my host computer
2006-08-13 21:41:00.34 Logon Error: 18456, Severity: 14, State: 11. 2006-08-13 21:41:00.34 Logon Login failed for user 'LAPTOPGuest'. [CLIENT: 192.168.0.5] 2006-08-13 21:45:10.64 Logon Error: 18456, Severity: 14, State: 11. 2006-08-13 21:45:10.64 Logon Login failed for user 'LAPTOPGuest'. [CLIENT: 192.168.0.5] 2006-08-13 21:48:41.80 Logon Error: 18456, Severity: 14, State: 11. 2006-08-13 21:48:41.80 Logon Login failed for user 'LAPTOPGuest'. [CLIENT: 192.168.0.5]
Now I know it is actually Error: 18456, Severity: 14, State: 11.
From this site : http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx
11 and 12
Valid login but server access failure
It tells the connection string and SQL Express seem to be set up properly but the server access failed the remote connection
I have previously had SQL Server 2000 installed. I uninstalled SQL 2000 before I install SQL express but somehow the SQL Server Service Manager is still running at startup, and C:Program FilesMicrosoft SQL Server80 and its files are still exist after uninstallation..... Could this be a problem?
The Knowledge base suggestion on "enabling remote connection" is very simple and I do not understand why it is so difficult to me just to make a remote connection test work..... please, I need your help.
Recently, one of my clients began receiving this error. My team gave them sysadmin permissions, but this is terrible practice. I have read into disablying simple file sharing, but I don't even think I have the option to do it. I look in mycomputer > tools > view and don't see any option for this. Besides, the problem just started occuring recently, within the last week. The server is a cluster with veritas clustering and the edition is sql server 2000. Has anybody ever had a problem like this and have a good fix? Thanks for any help in advance... -Kyle
hi we have a link server....andthe user credentials are not being trasfered to link server.....anythoughts??we get the following error messageServer message 18542 level 16 state 1--Posted using the http://www.dbforumz.com interface, at author's requestArticles individually checked for conformance to usenet standardsTopic URL: http://www.dbforumz.com/error-messa...pict266240.htmlVisit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=915273
I know that is possible to programmatically send an e-mail with the command xp_sendmail, but i want to know if it's possible to programmatically send a Net Send message.
I'm trying to figure out how the SQL Agent sends email through jobs using the notification option for operators. I have had little success using SQL mail so I want to use an alternate such as blat. I have not been able to find where the SQL jobs are actually sending the mail. Can someone help please. OI have checked the system stored procedures without suscess. I'm using SQL2000.
I am having a problem getting informational type messages to display for my end users.
I have a SQL2000 db with a Delfi front end. When I issue either the raiserror or print nothing is displayed inside the app. With raiserror I can get it to display if I make the severity higher than 10. The problem with this is that it stops the app from processing the transaction. This is ok in one case but not with just informational type stuff. Any suggestions? Thanks.
Say i want to send a blob in a message from queue A to queue B. These locations can be geographically different. How can i implement this ?
Also anything which i want to send as a message should be stored in the database. and then I should store it in a variable. this can be used as the message body. am I right ?
I understand that SQL Service Broker will RECEIVE messages in the same order of SEND, so long as the messages are on the same conversation.
I would like to accomplish queue-level ordering instead of (or in addition to) conversation-level ordering.
There is a significant business case for this level of ordering. Consider an order processing system which is specified to fulfill orders in the sequence they are received. The reason for the ordering is as follows. Suppose the process(es) that RECEIVEs from the queue is down for several hours and the messages back up in the queue. Various customers place orders throughout this period of time. If more orders are placed than there are quantity for an item, the customers who placed their orders earliest in the day ought to be the ones that receive the merchandise and the later orders should be placed on backorder.
Limited experimentation showed that SQL Server totally disregards the order in which the messages were sent (on different conversations to the same queue).
The potential solution to use the same conversation has some drawbacks:
1. Difficult to do error handling because of the way error handling works in conversations.
2. It is not possible to RECEIVE using multiple threads. (Yes, RECEIVEing on multiple threads also would reorder the messages, but the reorderings would be localized in time so this would be tolerable by a lot of applications. In other words, orders from 1:00 AM would not be mixed with orders from 9:00 AM.)
Can anyone see a good solution to this in the current version?
If there are no good solutions, it would be great if Microsoft considers adding a feature where you can declare an ordering requirement when you CREATE QUEUE. Even support for an "approximate" ordering (messages can rearrange +/- several seconds) would be helpful, but the current way which seems to totally randomize the message order is not good for certain kinds of significant applications.
I am stuck in this strange issue since the last two days. I have followed the tutorial to configure the 2 databases to send and receive messages which works. I added my own objects in the DB's also but when I try to send a message to the service I added I get a message:
"Dialog security is unavailable for this conversation because there is no security certificate bound to the database principal (Id: 1). Either create a certificate for the principal, or specify ENCRYPTION = OFF when beginning the conversation."
Security is setup in the same way for my objects as the security specified in the tutorial. The service binding on the initiator and target use the same account as specified in the tutorial. Please help.
I used onError event to send email in case ssis pckage fails
but it send multiple email with errordescription. for ex below are the errordescription of four diferent emails i received.
Thread "WorkThread0" has exited with error code 0xC0047039. An error occurred with the following error message: "The connection "{01AF859A-CF97-4F6C-9C78-1AA4B1C9C27B}" is not found. This error is thrown by Connections collection when the specific connection element is not found.". Thread "SourceThread0" has exited with error code 0xC0047038. The PrimeOutput method on component "Flat File Source - Read from source file" (1) returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.
Can anyone suggest if we can combine all this error description and send this as one email.
Hi All, I want to send notification to SSRS on change in database for that I am using SSB to send message to SQL Server Reporting Services. Can I use SSB and if yes, how? Please guide me I am new to this.