March 7, 2007 at 8:56 am
Hi,
After four days of trying i'm losing the will to live...
I'm using windows authentication for both servers with sql server running under the same domain account on both boxes.
My initiator sends and my target says that: This message could not be delivered because the user with ID 0 in database ID 9 does not have permission to send to the service.
As i understand it ID o is the sa account. I've checked that the servicename is the correct one in the right case. I just can't see why sa is involved.
Can anyone help me?
Thank you.
March 7, 2007 at 10:25 am
Running:
GRANT
CONTROL ON SERVICE ::ErrorLoggerReceiverService TO Public
On the target fixed this error.
Any ideas why i it works ok on two boxes but not on two instances on the same box? I am using different ports.
Thanks in advance.
March 8, 2007 at 7:40 am
March 8, 2007 at 7:42 am
March 8, 2007 at 8:23 am
I have trustworthy on both instances.
On my initiator i get the error: an error occurred while receiving data: (error not found).
On my target i get the error: Connection handshake failed. An OS call found (error not found) state 67.
Both services run under the same account which is an administrator on the box and sa on each instance.
Any ideas anyone...?
Thanks.
March 8, 2007 at 8:45 am
Did you try this as well?
GRANT CONTROL ON SERVICE ::ErrorLoggerReceiverService TO SELF
Instead of using public?
Also, It is pretty frustrating trying to get your Service Broker up and running the first time, but once you get it, the light bulb comes on and you wonder why it wasn't so clear cut in the documentation.
Is there anyway you can post more of the code you used to set up the broker service on both instances?
March 9, 2007 at 7:49 am
Yes tried that but still get the same.
remember that both instances run as cc\agr-admin and is an administrator on the box and the code runs fine if on different boxes.
Here is the initiator code:
use
master
IF EXISTS (SELECT name FROM sys.databases WHERE name = N'SourceDB') DROP DATABASE [SourceDB]
Create
Database SourceDB
use SourceDB
ALTER AUTHORIZATION ON DATABASE::[SourceDB] TO [sa];
ALTER
DATABASE SourceDB SET TRUSTWORTHY ON;
ALTER
DATABASE SourceDB SET ENABLE_BROKER;
CREATE MESSAGE TYPE ErrorLoggerMessage VALIDATION = NONE;
CREATE
CONTRACT ErrorLoggerContract (ErrorLoggerMessage SENT BY INITIATOR);
CREATE
QUEUE ErrorLoggerSendQueue WITH status = ON;
CREATE
SERVICE ErrorLoggerSendService ON QUEUE ErrorLoggerSendQueue (ErrorLoggerContract);
CREATE
ROUTE ErrorLoggerSendRoute WITH SERVICE_NAME = 'ErrorLoggerReceiverService',
BROKER_INSTANCE
= '42665FF5-FE45-4CC5-BE74-AC91DD043D4C',
ADDRESS
= 'TCP://5.0.8.195:4024';
IF
EXISTS (SELECT name from sys.service_broker_endpoints where name = N'ServiceBrokerEndpoint') DROP endpoint ServiceBrokerEndpoint
CREATE
ENDPOINT ServiceBrokerEndPoint STATE=STARTED AS TCP (LISTENER_PORT = 4022) FOR SERVICE_BROKER
(
AUTHENTICATION
= WINDOWS ,
ENCRYPTION
= DISABLED
);
use
master;
GRANT CONNECT ON ENDPOINT::ServiceBrokerEndPoint To [cc\agr-admin];
_______________________________________________________________
Here is the target code:
use
master;
IF EXISTS (SELECT name FROM sys.databases WHERE name = N'TargetDB') DROP DATABASE [TargetDB]
create
database TargetDB;
use
TargetDB;
ALTER DATABASE TargetDB SET TRUSTWORTHY ON;
ALTER
DATABASE TargetDB SET ENABLE_BROKER;
CREATE MESSAGE TYPE ErrorLoggerMessage VALIDATION = NONE;
CREATE
CONTRACT ErrorLoggerContract (ErrorLoggerMessage SENT BY INITIATOR);
CREATE
QUEUE ErrorLoggerReceiverQueue WITH status = ON;
CREATE
SERVICE ErrorLoggerReceiverService ON QUEUE ErrorLoggerReceiverQueue (ErrorLoggerContract);
IF
EXISTS (SELECT name from sys.service_broker_endpoints where name = N'ServiceBrokerEndpoint') DROP endpoint ServiceBrokerEndpoint
CREATE
ENDPOINT ServiceBrokerEndPoint STATE=STARTED AS TCP (LISTENER_PORT = 4024) FOR SERVICE_BROKER
(
AUTHENTICATION
= WINDOWS,
ENCRYPTION
= DISABLED
);
GRANT
SEND ON SERVICE::ErrorLoggerReceiverService To [cc\agr-admin];
GRANT
CONTROL ON SERVICE ::ErrorLoggerReceiverService TO Public
use
master;
GRANT
CONNECT ON ENDPOINT::ServiceBrokerEndPoint To [cc\agr-admin];
SELECT
CONVERT(NVARCHAR(max), message_body) AS message FROM ErrorLoggerReceiverQueue;
RECEIVE
CONVERT(NVARCHAR(max), message_body) AS message FROM ErrorLoggerReceiverQueue;
____________________________________________________________
Here is the send message code:
use
sourcedb
go
declare
@ConversationHandle uniqueidentifier
begin
transaction
begin
dialog @ConversationHandle
from
service ErrorLoggerSendService
to
service 'ErrorLoggerReceiverService','42665FF5-FE45-4CC5-BE74-AC91DD043D4C'
on
contract ErrorLoggerContract with encryption = off;
send
on conversation @ConversationHandle
message type ErrorLoggerMessage ('test')
commit
_____________________________________________________
On the initiator i get: An error occurred while receiving data: '10054(error not found)'.
On the target i get: Connection handshake failed. An OS call failed: (8009030c) 0x8009030c(error not found). State 67.
Thanks for trying to help me ....
March 15, 2007 at 10:43 am
Any more ideas anyone?
Thanks
March 15, 2007 at 1:33 pm
March 16, 2007 at 2:58 am
Hi Christopher,
I haven't applied the service pack so will do that.
Yes, it works across two boxes but not on two instances on the same box.
Thanks.
March 16, 2007 at 12:10 pm
March 19, 2007 at 3:44 am
Hi,
Yes the service is running under local system.
March 19, 2007 at 5:49 am
- did you check the Troubleshooting Service Broker (SSB) script ?
- did you check the sqlserver errorlog ?
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
March 19, 2007 at 10:34 am
Yes I have checked the script and the errorlog - which just lists the error message as i have previously posted.
Remember that the message has been sent and is hitting the target as both display error messages.
March 19, 2007 at 11:53 am
did you try
GRANT SEND ON SERVICE ::ErrorLoggerReceiverService TO Public
in both db's !!
When only setting up transport security , you need to grant send authority to public for the local SSB-service in the userdatabases
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic. Login to reply