Showing posts with label service. Show all posts
Showing posts with label service. Show all posts

Tuesday, March 27, 2012

Cluster Service remain on starting state after quorum log corrupti

Hi
I have a 2 node windows 2000 Cluster with a problem. I think the quorum log
became corrupted and now on both nodes the cluster service cannot start.
Without the cluster service running i cannot access any of the resources. On
the event viewer i have some error messages indicating that the quorum log is
corrupted, is there a way of getting the cluster service to start?
I already tried starting the service with the -noquerylogging parameter, the
service started and i could clear the old log from the quorum disk, but after
that i'm trying to restart the service and he just stays on starting state
indefinetly. Is there anything i can do to save my neck...because i noticed a
few minutes ago that bmy backups were not running properly.
Please help me out, i have to start cluster on the next 8 hours!!!!
Thanks a lot
My messenger is f_batista69@.hotmail.com
Hi
Look at
"To recover from a corrupted quorum log or quorum disk"
http://www.microsoft.com/windows2000...luad_pr_70.htm
and
http://support.microsoft.com/default...b;en-us;872970
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"francisco - Portugal" <francisco - Portugal@.discussions.microsoft.com>
wrote in message news:48441502-D241-488E-A26F-CB9E6C1F5FC3@.microsoft.com...
> Hi
> I have a 2 node windows 2000 Cluster with a problem. I think the quorum
> log
> became corrupted and now on both nodes the cluster service cannot start.
> Without the cluster service running i cannot access any of the resources.
> On
> the event viewer i have some error messages indicating that the quorum log
> is
> corrupted, is there a way of getting the cluster service to start?
> I already tried starting the service with the -noquerylogging parameter,
> the
> service started and i could clear the old log from the quorum disk, but
> after
> that i'm trying to restart the service and he just stays on starting state
> indefinetly. Is there anything i can do to save my neck...because i
> noticed a
> few minutes ago that bmy backups were not running properly.
> Please help me out, i have to start cluster on the next 8 hours!!!!
> Thanks a lot
> My messenger is f_batista69@.hotmail.com
>
|||Francisco
Have you tried this.
Power off one of the nodes.
On the remaining NODE start cluster service with -noquorumlogging
Delete Everything inside of the MSCS directory on the Quroum drive (I know
you stated you deleted the quolog.log file previously).
Stop the cluster service and then start it with the -resetquorumlog
If this works then stop the cluster service and start it normally. I have
seen quorum logs become so corrupt that resetquorumlog does not work this
usually fixes it. If this does not work I would recommend the following:
Reboot the only node that is powered up with the cluster service set to
manual.
Go to the command promp c:\Windows\Cluster\clussvc -debug >c:\debug.txt
cut and paste the output into the news groups.
Regards
CT
"francisco - Portugal" wrote:

> Hi
> I have a 2 node windows 2000 Cluster with a problem. I think the quorum log
> became corrupted and now on both nodes the cluster service cannot start.
> Without the cluster service running i cannot access any of the resources. On
> the event viewer i have some error messages indicating that the quorum log is
> corrupted, is there a way of getting the cluster service to start?
> I already tried starting the service with the -noquerylogging parameter, the
> service started and i could clear the old log from the quorum disk, but after
> that i'm trying to restart the service and he just stays on starting state
> indefinetly. Is there anything i can do to save my neck...because i noticed a
> few minutes ago that bmy backups were not running properly.
> Please help me out, i have to start cluster on the next 8 hours!!!!
> Thanks a lot
> My messenger is f_batista69@.hotmail.com
>
sqlsql

Cluster service fails

I'm not able to start the cluster service on the 2nd node of our cluster.
O/S is 2003, with SQL 2000. The 2nd node is passive, and appears to join the
cluster but then it terminates unexpectedly.
We've tried using the Administrator account to start the server, but with
the same results.
The cluster service is fine on node 1.
What can I try to do in order to get the service to start?
Thanks,
Chris
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:7FE6F3AD-B838-414C-B216-D0CC84AE28F0@.microsoft.com...
> I'm not able to start the cluster service on the 2nd node of our cluster.
> O/S is 2003, with SQL 2000. The 2nd node is passive, and appears to join
the
> cluster but then it terminates unexpectedly.
>
My guess is it's having trouble seeing the Quorum resource. Make sure it
can view all the resources.

> We've tried using the Administrator account to start the server, but with
> the same results.
> The cluster service is fine on node 1.
> What can I try to do in order to get the service to start?
> Thanks,
> Chris

Cluster service error

On Mar 7, 5:25 pm, "Steen Schlter Persson (DK)"
<steen@.REMOVE_THIS_asavaenget.dk> wrote:
> Hi,
> I'm not quite sure whichserviceyou try to start, but the SQL server
> services will not be runnning on the passive node of thecluster. when
> you move your ressources to that node, the services will be started ( -
> and will be stopped on the node that now is the passive ).
> Theclusterservicewill be running on both servers though.
> --
> Regards
> Steen Schlter Persson
> Database Administrator / System Administrator
>
> get2raj...@.gmail.com wrote:
>
> - Show quoted text -
Hi Steen
The cluster server is not starting on the node-1. when i try to start
the service it says cluster service does not exist as an installed
service. As I tried to start the service from C:\WINDOWS\Cluster still
it is not starting is there a way to install these service which i am
not able to see on NODE-1 but it is present on NODE-2 which is active
but all drives are offline expect.
1)cluster IP Address
2)Cluster name
3)Disk Q (Quram)
4)MSDDTC
I think if the service starts on NODE-1 the cluster will be up.
Thanks,
Rajesh
<get2rajesh@.gmail.com> wrote in message
news:1173271137.650631.212640@.v33g2000cwv.googlegr oups.com...
On Mar 7, 5:25 pm, "Steen Schlter Persson (DK)"
<steen@.REMOVE_THIS_asavaenget.dk> wrote:
> Hi,
> I'm not quite sure whichserviceyou try to start, but the SQL server
> services will not be runnning on the passive node of thecluster. when
> you move your ressources to that node, the services will be started ( -
> and will be stopped on the node that now is the passive ).
> Theclusterservicewill be running on both servers though.
> --
> Regards
> Steen Schlter Persson
> Database Administrator / System Administrator
>
> get2raj...@.gmail.com wrote:
>
> - Show quoted text -
Are you sure NODE-1 is setup to be part of the SQL Cluster.
(keep in mind clustering SQL is two steps, creating nodes as a window
cluster and then defining/creating the SQL cluster.
For example, you could have 3 nodes in a windows cluster, A, B, C. A,B
could be setup as a SQL cluster and B,C as an exchange cluster.)
And all services should start on any valid cluster, there is no preferred
cluster.
Hi Steen
The cluster server is not starting on the node-1. when i try to start
the service it says cluster service does not exist as an installed
service. As I tried to start the service from C:\WINDOWS\Cluster still
it is not starting is there a way to install these service which i am
not able to see on NODE-1 but it is present on NODE-2 which is active
but all drives are offline expect.
1)cluster IP Address
2)Cluster name
3)Disk Q (Quram)
4)MSDDTC
I think if the service starts on NODE-1 the cluster will be up.
Thanks,
Rajesh
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com

Cluster service error

I had a Windows Server 2003 (Enterprise ed) cluster with 2 nodes
running.
When I try to start the service through Cluster Administrator, which
is
installed on the local machine, I get "Error 1060: The specified
service does
not exist as an installed service"
The cluster service does not appear to be installed.but the same is
installed in other node .
Shouldn't this service be installed along with the OS and if so what
do you
suggest'
Any help on this would be appreciated as I cannot find any info on
this
problem anywhere......Hi,
I'm not quite sure which service you try to start, but the SQL server
services will not be runnning on the passive node of the cluster. when
you move your ressources to that node, the services will be started ( -
and will be stopped on the node that now is the passive ).
The cluster service will be running on both servers though.
Regards
Steen Schlter Persson
Database Administrator / System Administrator
get2rajesh@.gmail.com wrote:
> I had a Windows Server 2003 (Enterprise ed) cluster with 2 nodes
> running.
> When I try to start the service through Cluster Administrator, which
> is
> installed on the local machine, I get "Error 1060: The specified
> service does
> not exist as an installed service"
> The cluster service does not appear to be installed.but the same is
> installed in other node .
> Shouldn't this service be installed along with the OS and if so what
> do you
> suggest'
> Any help on this would be appreciated as I cannot find any info on
> this
> problem anywhere......
>|||On Mar 7, 5:25 pm, "Steen Schl=FCter Persson (DK)"
<steen@.REMOVE_THIS_asavaenget.dk> wrote:
> Hi,
> I'm not quite sure whichserviceyou try to start, but the SQL server
> services will not be runnning on the passive node of thecluster. when
> you move your ressources to that node, the services will be started ( -
> and will be stopped on the node that now is the passive ).
> Theclusterservicewill be running on both servers though.
> --
> Regards
> Steen Schl=FCter Persson
> Database Administrator / System Administrator
>
> get2raj...@.gmail.com wrote:
>
> - Show quoted text -
Hi Steen
The cluster server is not starting on the node-1. when i try to start
the service it says cluster service does not exist as an installed
service. As I tried to start the service from C:\WINDOWS\Cluster still
it is not starting is there a way to install these service which i am
not able to see on NODE-1 but it is present on NODE-2 which is active
but all drives are offline expect.
1)cluster IP Address
2)Cluster name
3)Disk Q (Quram)
4)MSDDTC
I think if the service starts on NODE-1 the cluster will be up.
Thanks,
Rajesh|||<get2rajesh@.gmail.com> wrote in message
news:1173271137.650631.212640@.v33g2000cwv.googlegroups.com...
On Mar 7, 5:25 pm, "Steen Schlter Persson (DK)"
<steen@.REMOVE_THIS_asavaenget.dk> wrote:
> Hi,
> I'm not quite sure whichserviceyou try to start, but the SQL server
> services will not be runnning on the passive node of thecluster. when
> you move your ressources to that node, the services will be started ( -
> and will be stopped on the node that now is the passive ).
> Theclusterservicewill be running on both servers though.
> --
> Regards
> Steen Schlter Persson
> Database Administrator / System Administrator
>
> get2raj...@.gmail.com wrote:
>
> - Show quoted text -
Are you sure NODE-1 is setup to be part of the SQL Cluster.
(keep in mind clustering SQL is two steps, creating nodes as a window
cluster and then defining/creating the SQL cluster.
For example, you could have 3 nodes in a windows cluster, A, B, C. A,B
could be setup as a SQL cluster and B,C as an exchange cluster.)
And all services should start on any valid cluster, there is no preferred
cluster.
Hi Steen
The cluster server is not starting on the node-1. when i try to start
the service it says cluster service does not exist as an installed
service. As I tried to start the service from C:\WINDOWS\Cluster still
it is not starting is there a way to install these service which i am
not able to see on NODE-1 but it is present on NODE-2 which is active
but all drives are offline expect.
1)cluster IP Address
2)Cluster name
3)Disk Q (Quram)
4)MSDDTC
I think if the service starts on NODE-1 the cluster will be up.
Thanks,
Rajesh
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com

Cluster service error

I had a Windows Server 2003 (Enterprise ed) cluster with 2 nodes
running.
When I try to start the service through Cluster Administrator, which
is
installed on the local machine, I get "Error 1060: The specified
service does
not exist as an installed service"
The cluster service does not appear to be installed.but the same is
installed in other node .
Shouldn't this service be installed along with the OS and if so what
do you
suggest'
Any help on this would be appreciated as I cannot find any info on
this
problem anywhere......Hi,
I'm not quite sure which service you try to start, but the SQL server
services will not be runnning on the passive node of the cluster. when
you move your ressources to that node, the services will be started ( -
and will be stopped on the node that now is the passive ).
The cluster service will be running on both servers though.
--
Regards
Steen Schlüter Persson
Database Administrator / System Administrator
get2rajesh@.gmail.com wrote:
> I had a Windows Server 2003 (Enterprise ed) cluster with 2 nodes
> running.
> When I try to start the service through Cluster Administrator, which
> is
> installed on the local machine, I get "Error 1060: The specified
> service does
> not exist as an installed service"
> The cluster service does not appear to be installed.but the same is
> installed in other node .
> Shouldn't this service be installed along with the OS and if so what
> do you
> suggest'
> Any help on this would be appreciated as I cannot find any info on
> this
> problem anywhere......
>|||On Mar 7, 5:25 pm, "Steen Schl=FCter Persson (DK)"
<steen@.REMOVE_THIS_asavaenget.dk> wrote:
> Hi,
> I'm not quite sure whichserviceyou try to start, but the SQL server
> services will not be runnning on the passive node of thecluster. when
> you move your ressources to that node, the services will be started ( -
> and will be stopped on the node that now is the passive ).
> Theclusterservicewill be running on both servers though.
> --
> Regards
> Steen Schl=FCter Persson
> Database Administrator / System Administrator
>
> get2raj...@.gmail.com wrote:
> > I had a Windows Server 2003 (Enterprise ed)clusterwith 2 nodes
> > running.
> > When I try to start theservicethroughClusterAdministrator, which
> > is
> > installed on the local machine, I get "Error1060: The specified
> >servicedoes
> > not exist as an installedservice"
> > Theclusterservicedoes not appear to be installed.but the same is
> > installed in other node .
> > Shouldn't thisservicebe installed along with the OS and if so what
> > do you
> > suggest'
> > Any help on this would be appreciated as I cannot find any info on
> > this
> > problem anywhere......- Hide quoted text -
> - Show quoted text -
Hi Steen
The cluster server is not starting on the node-1. when i try to start
the service it says cluster service does not exist as an installed
service. As I tried to start the service from C:\WINDOWS\Cluster still
it is not starting is there a way to install these service which i am
not able to see on NODE-1 but it is present on NODE-2 which is active
but all drives are offline expect.
1)cluster IP Address
2)Cluster name
3)Disk Q (Quram)
4)MSDDTC
I think if the service starts on NODE-1 the cluster will be up.
Thanks,
Rajesh|||<get2rajesh@.gmail.com> wrote in message
news:1173271137.650631.212640@.v33g2000cwv.googlegroups.com...
On Mar 7, 5:25 pm, "Steen Schlüter Persson (DK)"
<steen@.REMOVE_THIS_asavaenget.dk> wrote:
> Hi,
> I'm not quite sure whichserviceyou try to start, but the SQL server
> services will not be runnning on the passive node of thecluster. when
> you move your ressources to that node, the services will be started ( -
> and will be stopped on the node that now is the passive ).
> Theclusterservicewill be running on both servers though.
> --
> Regards
> Steen Schlüter Persson
> Database Administrator / System Administrator
>
> get2raj...@.gmail.com wrote:
> > I had a Windows Server 2003 (Enterprise ed)clusterwith 2 nodes
> > running.
> > When I try to start theservicethroughClusterAdministrator, which
> > is
> > installed on the local machine, I get "Error1060: The specified
> >servicedoes
> > not exist as an installedservice"
> > Theclusterservicedoes not appear to be installed.but the same is
> > installed in other node .
> > Shouldn't thisservicebe installed along with the OS and if so what
> > do you
> > suggest'
> > Any help on this would be appreciated as I cannot find any info on
> > this
> > problem anywhere......- Hide quoted text -
> - Show quoted text -
Are you sure NODE-1 is setup to be part of the SQL Cluster.
(keep in mind clustering SQL is two steps, creating nodes as a window
cluster and then defining/creating the SQL cluster.
For example, you could have 3 nodes in a windows cluster, A, B, C. A,B
could be setup as a SQL cluster and B,C as an exchange cluster.)
And all services should start on any valid cluster, there is no preferred
cluster.
Hi Steen
The cluster server is not starting on the node-1. when i try to start
the service it says cluster service does not exist as an installed
service. As I tried to start the service from C:\WINDOWS\Cluster still
it is not starting is there a way to install these service which i am
not able to see on NODE-1 but it is present on NODE-2 which is active
but all drives are offline expect.
1)cluster IP Address
2)Cluster name
3)Disk Q (Quram)
4)MSDDTC
I think if the service starts on NODE-1 the cluster will be up.
Thanks,
Rajesh
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com

Cluster Service

For a particular node, I stopped the cluster service. When I tried to start the service, I received an error stating that the cluster could not start due to logon failure.
Can I be pointed in the direction to resolve this?
That's because the password for the SQL Server service account does not
match the Windows password.
Mike
Principal Mentor
Solid Quality Learning
"More than just Training"
SQL Server MVP
http://www.solidqualitylearning.com
http://www.mssqlserver.com
|||This would indicate that the password for the account that the cluster
service starts under has been changed. Go to Administrative Tools -
Services and enter the correct password for the account that the cluster
service is starting under.
Rand
This posting is provided "as is" with no warranties and confers no rights.
sqlsql

Sunday, March 11, 2012

CLR Trigger -> Send Insert/Update/Delete Message to Windows Service

Hi,

I have an c# windows service, which is running on the same machine where my mssql server is installed. This service must be informed for each insert/update/delete event on one specific table.

My idea was to create an CLR Trigger for this table which can communicate with this service via .NET remoting. But the problem is, that the system.runtime.remoting assembly is not integrated within the mssql clr enviroment => i can't use remoting.

Are there any other idea's how can i solve this?

Best regards,
Thomas

Hi,

what about using Query Notification ?

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||I had the same problem as you and I have used two different tecniques: both of them uses CLR stored procs.

1. An OS event set by SqlServer: useful when to have to notify that an event occurred without any param. Each different event must be attached to a different event name.

[SqlProcedure]
public static void SetOsEvent(SqlString eventName) {
try {
EventWaitHandle.OpenExisting((string)eventName).Set();
}
catch (WaitHandleCannotBeOpenedException) {
}
}

2. An UDP Message. Useful for non-reliable and fast messaging system, such as broadcasting the internal net that an event has occurred.

[SqlProcedure]
public static void UdpSend(SqlString address, SqlInt32 port, SqlString message) {
try {
System.Net.Sockets.UdpClient client = new System.Net.Sockets.UdpClient();
byte[] datagram = message.GetUnicodeBytes();
client.Send(datagram, datagram.Length, (string)address, (int)port);
}
catch{
}
}

[SqlProcedure]
public static void UdpBroadcast(SqlInt32 port, SqlString message) {
try {
System.Net.Sockets.UdpClient client = new System.Net.Sockets.UdpClient();
byte[] datagram = message.GetUnicodeBytes();
System.Net.IPEndPoint ep = new System.Net.IPEndPoint(System.Net.IPAddress.Broadcast, (int)port);
client.Send(datagram, datagram.Length, ep);
}
catch {
}
}

Hope that helps.

CLR Security Permissions on a sql 2005 server, service broker

A made a brokermethod just like in the helloworld_clr example in de service
broker example dir in sql 2005. The brokermethod receives a message and trie
s
to deserialize the message body which is a list of customer objects.
But when I try to deserialize I get the following exception.
It’s about something with permissions on an assembly. But I don’t have a
ny
experience with that.
Could someone tell me what I’m doing wrong?
Any help would be greatly appreciated.
CustomerMessage exception:
System.Security.SecurityException:
Request for the permission of type
'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0,
Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.CheckSecurity(Pa
rseRecord pr)
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(Pars
eRecord pr)
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecor
d
pr)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWith
MapTyped(BinaryObjectWithMapTyped record)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWith
MapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(Head
erHandler
handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain,
IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(S
tream
serializationStream, HeaderHandler handler, Boolean fCheck, Boolean
isCrossAppDomain, IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(S
tream serializationStream)
at testservice.services.CustomerService.CustomerMessage(Message msgReceived,
SqlConnection connection, SqlTransaction transaction)
The action that failed was: Demand
The type of the first permission that failed was:
System.Security.Permissions.SecurityPermission
The Zone of the assembly that failed was: MyComputerIs the broker method activated (WITH ACTIVATION (...) on the queue) or are
you invoking it from a user connection?
Activation has certain security restrictions because of the EXECUTE AS
context, see this blog
http://blogs.msdn.com/remusrusanu/a.../12/512085.aspx
Also, what kind of serialization are you using? Inside SQL Server there are
certain restrictions as the ordinary Xml serialization cannot be used, see
this blog http://blogs.msdn.com/sqlclr/archiv.../25/Vineet.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
HTH,
~ Remus Rusanu
SQL Service Broker
http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx
"arn0" <arn0@.discussions.microsoft.com> wrote in message
news:E09E3890-12B6-491E-B990-1BECE84C5F62@.microsoft.com...
>A made a brokermethod just like in the helloworld_clr example in de service
> broker example dir in sql 2005. The brokermethod receives a message and
> tries
> to deserialize the message body which is a list of customer objects.
> But when I try to deserialize I get the following exception.
> It's about something with permissions on an assembly. But I don't have any
> experience with that.
> Could someone tell me what I'm doing wrong?
> Any help would be greatly appreciated.
> CustomerMessage exception:
> System.Security.SecurityException:
> Request for the permission of type
> 'System.Security.Permissions.SecurityPermission, mscorlib,
> Version=2.0.0.0,
> Culture=neutral,
> PublicKeyToken=b77a5c561934e089' failed.
> at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.CheckSecurity(
ParseRecord
> pr)
> at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(Pa
rseRecord
> pr)
> at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRec
ord
> pr)
> at
> System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWi
thMapTyped(BinaryObjectWithMapTyped
> record)
> at
> System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWi
thMapTyped(BinaryHeaderEnum
> binaryHeaderEnum)
> at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
> at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(He
aderHandler
> handler, __BinaryParser serParser, Boolean fCheck, Boolean
> isCrossAppDomain,
> IMethodCallMessage methodCallMessage)
> at
> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize
(Stream
> serializationStream, HeaderHandler handler, Boolean fCheck, Boolean
> isCrossAppDomain, IMethodCallMessage methodCallMessage)
> at
> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize
(Stream
> serializationStream)
> at testservice.services.CustomerService.CustomerMessage(Message
> msgReceived,
> SqlConnection connection, SqlTransaction transaction)
> The action that failed was: Demand
> The type of the first permission that failed was:
> System.Security.Permissions.SecurityPermission
> The Zone of the assembly that failed was: MyComputer|||Hello arn0,

> A made a brokermethod just like in the helloworld_clr example in de
> service broker example dir in sql 2005. The brokermethod receives a
> message and tries to deserialize the message body which is a list of
> customer objects.
> But when I try to deserialize I get the following exception.
> It’s about something with permissions on an assembly. But I don’t have
> any
> experience with that.
> Could someone tell me what I’m doing wrong?
> Any help would be greatly appreciated.
> CustomerMessage exception: System.Security.SecurityException: Request
> for the permission of type
> 'System.Security.Permissions.SecurityPermission, mscorlib,
> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
> failed.
[SNIP]
> testservice.services.CustomerService.CustomerMessage(Message
> msgReceived, SqlConnection connection, SqlTransaction transaction)
> The action that failed was: Demand The type of the first permission
> that failed was: System.Security.Permissions.SecurityPermission The
> Zone of the assembly that failed was: MyComputer
Adding this to the .CLR and .ServiceBroker newsgroups as folks in those grou
ps
might be able to add more.
The example in question doesn't deserialize an object graph, at least from
what I can today. So unless you can post the code in question, we're probabl
y
not going to be help you much. I've done some work with simple serialization
of objects with SQLCLR and haven't run into this yet. Chances are this isn't
an object with the permissions of the assembly. You can change the permissio
n
level of an assembly when you catalog it by adding "with permission_set =
" and one of SAFE, EXTERNAL_ACCESS or UNSAFE. Try unsafe first here, but
I doubt its going to get your much as I'm guessing you're doing something
with CAS that SQLCLR doesn't like.
Oh BTW, are you trying to load the base objects from the GAC?
PS: send messages, not object graphics -- just had to get that out of my
system... :)
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||the customer object comes from a assambly I registered this assembly in the
db with this command
create ASSEMBLY CustomerAssembly
FROM 'd:\development\Customer.dll'
with PERMISSION_SET = unsafe
GO
this is the brokermethod code
<BrokerMethod("CustomerMessage")> _
Public Sub CustomerMessage(ByVal msgReceived As Message, ByVal
connection As SqlConnection, ByVal transaction As SqlTransaction)
writeToLog("CustomerMessage start", connection, transaction)
Try
Dim customerArray As List(Of Customer)
Dim bfmt As BinaryFormatter = New BinaryFormatter()
Dim cmd As SqlCommand
msgReceived.Body.Position = 0
customerArray = bfmt.Deserialize(msgReceived.Body)
cmd = connection.CreateCommand
cmd.Transaction = transaction
cmd.CommandText = "INSERT INTO [arnotest].[dbo].[customer]
([name],[lastname]) VALUES(@.name,@.lastname)"
Dim name As IDataParameter = cmd.Parameters.Add("@.name",
SqlDbType.NVarChar)
Dim lastname As IDataParameter = cmd.Parameters.Add("@.name",
SqlDbType.NVarChar)
For Each Item As Customer In customerArray
name.Value = Item.name
lastname.Value = Item.lastname
cmd.ExecuteNonQuery()
Next
Catch ex As Exception
writeToLog(String.Concat("CustomerMessage exception: ",
ex.ToString), connection, transaction)
End Try
End Sub|||Hello arn0,

> the customer object comes from a assambly I registered this assembly
> in the db with this command
> create ASSEMBLY CustomerAssembly
> FROM 'd:\development\Customer.dll'
> with PERMISSION_SET = unsafe
> GO
> this is the brokermethod code
> <BrokerMethod("CustomerMessage")> _
> Public Sub CustomerMessage(ByVal msgReceived As Message, ByVal
> connection As SqlConnection, ByVal transaction As SqlTransaction)
> writeToLog("CustomerMessage start", connection, transaction)
> Try
> Dim customerArray As List(Of Customer)
> Dim bfmt As BinaryFormatter = New BinaryFormatter()
> Dim cmd As SqlCommand
> msgReceived.Body.Position = 0
> customerArray = bfmt.Deserialize(msgReceived.Body)
> cmd = connection.CreateCommand
> cmd.Transaction = transaction
> cmd.CommandText = "INSERT INTO [arnotest].[dbo].[customer]
> ([name],[lastname]) VALUES(@.name,@.lastname)"
> Dim name As IDataParameter = cmd.Parameters.Add("@.name",
> SqlDbType.NVarChar)
> Dim lastname As IDataParameter =
> cmd.Parameters.Add("@.name",
> SqlDbType.NVarChar)
> For Each Item As Customer In customerArray
> name.Value = Item.name
> lastname.Value = Item.lastname
> cmd.ExecuteNonQuery()
> Next
> Catch ex As Exception
> writeToLog(String.Concat("CustomerMessage exception: ",
> ex.ToString), connection, transaction)
> End Try
> End Sub
Okay, so this is very similar (on the surface) to my lightweight example
except that I'm using XML rather than binary serialization. See: [0].
What does the Customer Class look like?
[0]: http://www.sqljunkies.com/WebLog/kt...serialized.aspx
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||Hi arn0,
Sounds like you may be running into "SQL Server doesn't allow dynamic
serializer assemblies" behavior. If you're using "add web reference" you
need to pregenerate the serializer DLL (using sgen.exe) and catalog it
separately. The serializer needs to match the class its "serializing for"
WRT version.
Cheers,
Bob Beauchemin
http://www.SQLskills.com/blogs/bobb
"arn0" <arn0@.discussions.microsoft.com> wrote in message
news:D5AE8A90-EA04-4484-A5E2-EABD04584CFA@.microsoft.com...
> the customer object comes from a assambly I registered this assembly in
> the
> db with this command
> create ASSEMBLY CustomerAssembly
> FROM 'd:\development\Customer.dll'
> with PERMISSION_SET = unsafe
> GO
> this is the brokermethod code
> <BrokerMethod("CustomerMessage")> _
> Public Sub CustomerMessage(ByVal msgReceived As Message, ByVal
> connection As SqlConnection, ByVal transaction As SqlTransaction)
> writeToLog("CustomerMessage start", connection, transaction)
> Try
> Dim customerArray As List(Of Customer)
> Dim bfmt As BinaryFormatter = New BinaryFormatter()
> Dim cmd As SqlCommand
> msgReceived.Body.Position = 0
> customerArray = bfmt.Deserialize(msgReceived.Body)
> cmd = connection.CreateCommand
> cmd.Transaction = transaction
> cmd.CommandText = "INSERT INTO [arnotest].[dbo].[customer]
> ([name],[lastname]) VALUES(@.name,@.lastname)"
> Dim name As IDataParameter = cmd.Parameters.Add("@.name",
> SqlDbType.NVarChar)
> Dim lastname As IDataParameter = cmd.Parameters.Add("@.name",
> SqlDbType.NVarChar)
> For Each Item As Customer In customerArray
> name.Value = Item.name
> lastname.Value = Item.lastname
> cmd.ExecuteNonQuery()
> Next
> Catch ex As Exception
> writeToLog(String.Concat("CustomerMessage exception: ",
> ex.ToString), connection, transaction)
> End Try
> End Sub|||Hello Bob,

> Sounds like you may be running into "SQL Server doesn't allow dynamic
> serializer assemblies" behavior. If you're using "add web reference"
> you need to pregenerate the serializer DLL (using sgen.exe) and
> catalog it separately. The serializer needs to match the class its
> "serializing for" WRT version.
Nope, its not a Web Reference -- first thing I checked. As you can see from
the code provided, he using BinaryFormatter on the instance. But, is SGEN
only XML Serialization specific? If not, this is proably worth doing.
My current thought is that there's a CAS setting in the class (or something
that the class inherits) has a prohibited behavior.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/

Wednesday, March 7, 2012

Closing a conversation later on and Microsoft Service Broker Interface (sample)

In a messaging application, a client sends a message to the server. The server uses Service Broker Interface, and is CLR based. On the server, the message has a life cycle - going throughout multiple transitions until is final (Pending, In Transit, Delivered, TimedOut, Undeliverable). As the server receives the message, it sends back to the client a reply status message of In Transit. It does so using the same message’s conversation. It also saves – along with the message – its conversation handle. The dialog is not closed. After a while, the server may decide that the message has gotten to a final state (Delivered or TimedOut). I would like at that time to send a reply status message (Final State) back to the client and also close the conversation. The conversation handle has been saved by both, client and server. Having the conversation handle available - how do I get back to the client later on?

Thanks,

I don't understand what you mean by 'get back to the client later on'. Do you want to send a message using the conversation handle which was saved earlier? That's simple, you only have to execute the SEND statement with the saved conversation handle (or call Conversation.Send(...) in the ServiceBrokerInterface sample). Note that you cannot send after the conversation has been closed at your endpoint.|||

Yes, indeed, I would like to send a message using the conversation handle thant was saved earlier. This will be done by a different thread. All I have saved is the conversation hanlde and I am thinking to create a Conversation object based on the handle only. Can it be done?

Thanks,

|||I'll have to look it up if the Conversation class has a public constructor. If not, the ServiceBrokerInterface library is free for you to modify :-)|||That's right :). I am thinking about this way: (new Service(server service parameters)).GetConversation (mySavedConversationHandle). Thanks for following up.

Closed conversation endpoints not being purged

We have been having a problem with service broker for quite a while now and searching on these forums and more generally on the web has not yielded any kind of answer...

Our application utilises service broker within a single database (there is no cross database, cross instance or cross server communication). There are approximately 12 queues which are used to varying degrees. A few of the queues have a throughput rate in the order of up to 100s per minute at peak periods.

In some scenarios we are able to make use of persistent conversations but the majority of messages are sent on their own conversation or in small batches on their own conversation.

Some time ago we found that the database was growing in size more than expected due to a build up of data in the service broker meta data internal tables, exposed via the sys.conversation_endpoints system view.

We identified a problem in the application that was preventing some conversations from being closed and have now fixed this.

However, we are still experiencing a build up in the service broker tables and sys.conversation_endpoints shows this is now due to a very large number of conversations in the "CLOSED" state.

I know that conversations are kept around to prevent replay attacks but thought they were supposed to be cleared after about 30 minutes. This is certainly not happening as we currently have conversations that were opened on the 18th September, a full week ago. We currently have about 350,000 closed conversations and this figure is increasing!

We have tried restarting the SQL Server instance with no effect.

I have been using a script to loop through all closed conversations and get rid of them using the "WITH CLEANUP" clause but I'm loath to create a scheduled task that does this in the background when service broker should be doing the job itself.

Has anybody experience this problem and, even better, have any idea how to solve it?

Daniel

Hi Daniel!

Sounds very interesting. Do you close the conversation on both ends of the dialog with an END CONVERSATION statement?
Normally the conversations should go away from sys.conversation_endpoints within 30 minutes as you have wrote...

Thanks

Klaus Aschenbrenner
www.sqljunkies.com/weblog/klaus.aschenbrenner
www.csharp.at

|||

Hi Daniel!

Sounds very interesting. Do you close the conversation on both ends of the dialog with an END CONVERSATION statement?
Normally the conversations should go away from sys.conversation_endpoints within 30 minutes as you have wrote...

Thanks

Klaus Aschenbrenner
www.sqljunkies.com/weblog/klaus.aschenbrenner
www.csharp.at

|||Yes, we should be closing at both ends. However, I've not yet confirmed this 100%. I was working on the assumption that if the endpoint was in the "closed" state, we must have closed it at both ends (which is what the documentation suggests). Given that SB doesn't seem to be working as expected, perhaps the endpoint state is also suspect? I'll profile the system and see if I can trace the end conversations.|||

The endpoint states meaning is described here: http://msdn2.microsoft.com/en-us/library/ms176082.aspx. CLOSED indeed means both endpoints had issued END CONVERSATION.

What is you message exchange pattern? Who is issuing END CONVERSATION first, the initiator or the target? Is the target ever sending any replies back to the initiator?

Thanks,
~ Remus

|||

Thanks for considering this Remus. I'm a little busy and haven't yet had a chance to look into this to keep comprehensive answers; maybe I can spend more time on this later today.

We have a mixture of message exchange patterns. Most are fire and forget (no response from target to initiator) and in these situations the initiator starts a conversation sends a message and ends its side of the conversation with no delay; the target then picks up the message at some point in the future, processes it and then ends the other side of the conversation. We also have a few request/response conversations; generally we have seperate processes responsible for sending requests and processing responses; there are no pseudo-synchronous conversations.

I may have some more detailed information once I've analysed a trace of service broker activity in this database.

|||

Here are some examples of the service broker activity:

546BC38E-B300-40BC-9A54-2C6F281E928D 2006-09-27 09:35:50.920 Initiator DISCONNECTED_OUTBOUND
546BC38E-B300-40BC-9A54-2C6F281E928D 2006-09-27 09:35:50.920 Target DISCONNECTED_INBOUND
546BC38E-B300-40BC-9A54-2C6F281E928D 2006-09-27 09:35:50.920 Initiator CLOSED

221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.083 Initiator STARTED_OUTBOUND
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.100 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.100 Target STARTED_INBOUND
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.100 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.113 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.113 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.113 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.113 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.130 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.130 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.130 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.130 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.130 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.147 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.147 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.147 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.147 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.147 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.160 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.160 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.177 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.177 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.177 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.177 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.193 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.193 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.207 Initiator DISCONNECTED_OUTBOUND
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.207 Target DISCONNECTED_INBOUND
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.207 Initiator CLOSED
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:58:38.330 Target CLOSED

C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:38:12.977 Initiator STARTED_OUTBOUND
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:38:12.993 Initiator CONVERSING
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:38:12.993 Target STARTED_INBOUND
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:38:12.993 Target CONVERSING
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:38:13.180 Initiator CONVERSING
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:38:13.180 Target CONVERSING
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:54:17.837 Initiator DISCONNECTED_OUTBOUND
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:54:17.837 Target DISCONNECTED_INBOUND
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:54:17.853 Initiator CLOSED

I'm not sure this tells us much but I am suprised about the location of the DISCONNECTED_OUTBOUND messages as I thought our code typcically ended the conversation immediately after sending the message(s) without waiting for a response. Is this because I traced the service broker activity events rather than the actuall T-SQL statements issuing the service broker commands ("END CONVERSATION" etc)?

Daniel

|||

The pattern that leaves target endpoints stranded is the one where the target never sends any message (including EndDialog message). So try not to do fire and forget patterns, they have other faults too. If you don't want/can't change this, then you should set up a task to periodically clean them up (using ENd CONVERSATION ... WITH CLEANUP). The criteria is conversation endpoints that are CLOSED and last activity is more than 30 minutes in the past.

HTH,
~ Remus

|||

Daniel Renshaw wrote:

I'm not sure this tells us much but I am suprised about the location of the DISCONNECTED_OUTBOUND messages as I thought our code typcically ended the conversation immediately after sending the message(s) without waiting for a response. Is this because I traced the service broker activity events rather than the actuall T-SQL statements issuing the service broker commands ("END CONVERSATION" etc)?

I hop I'll g et this right, I'm doing it from memory:

The transition CONVERSING->DISCONNECTED_OUTBOUND is when the initiator issues END CONVERSATION.
The transition CONVERSING->DISCONNECTED_INBOUND is when the EndDialog message sent by initiator arrives at the target
The transition DISCONNECTED_OUTBOUND->CLOSED is when the acknowledgement for the initiators EndDialog message comes back to it.
The transition DISCONNECTED_INBOUND->CLOSED is when the target issues END CONVERSATION in response to the EndDialog message received from initiator.

The pattern shown here is one of the pattern that leaves the target endpoint stranded. Because it never sent any message to the initiator, it never received an acknowledgement. An ack from the initiator sent back to the target serves as positive proof that the initiator will not retry to send message 0. W/o this proof the target cannot delete itself, it has to stay around indefinetly to prevent a replay of message 0, resulting in a stranded target endpoint. That's another reason why the fire-and-forget pattern is ... unrecommended.

BTW, you should also add the EventSubclass column to the profiler view, it details what kind of conversation event we're seeing.

HTH,
~ Remus

|||

Thanks Remus, I'll implement the background cleanup for now. We may be revisting our core principles at some point in the future based on the lessons learnt over the past few months. We've found that tables may have been a more appropriate solution than the many queues we've ended up with.

For example, a message arrives and we put a record in a table as an audit/status information. This continues through the system, each message/step typically generates further records being inserted/updated in regular tables so that we can keep track of what's going on. This has caused tremendous bloating/duplication of data and massive transaction logs so we're now asking ourselves: why not put the message in that same table and forget the queues.

When we come to reconsider all that, we'll ensure fire-and-forget is removed from any service broker elements that remain.

Daniel

|||This saved me from pulling my hair out... I've added it to my blog.

http://www.nootz.net/index.php/notification-services-conversation-cleanup.html

Thanks,
Garick

Closed conversation endpoints not being purged

We have been having a problem with service broker for quite a while now and searching on these forums and more generally on the web has not yielded any kind of answer...

Our application utilises service broker within a single database (there is no cross database, cross instance or cross server communication). There are approximately 12 queues which are used to varying degrees. A few of the queues have a throughput rate in the order of up to 100s per minute at peak periods.

In some scenarios we are able to make use of persistent conversations but the majority of messages are sent on their own conversation or in small batches on their own conversation.

Some time ago we found that the database was growing in size more than expected due to a build up of data in the service broker meta data internal tables, exposed via the sys.conversation_endpoints system view.

We identified a problem in the application that was preventing some conversations from being closed and have now fixed this.

However, we are still experiencing a build up in the service broker tables and sys.conversation_endpoints shows this is now due to a very large number of conversations in the "CLOSED" state.

I know that conversations are kept around to prevent replay attacks but thought they were supposed to be cleared after about 30 minutes. This is certainly not happening as we currently have conversations that were opened on the 18th September, a full week ago. We currently have about 350,000 closed conversations and this figure is increasing!

We have tried restarting the SQL Server instance with no effect.

I have been using a script to loop through all closed conversations and get rid of them using the "WITH CLEANUP" clause but I'm loath to create a scheduled task that does this in the background when service broker should be doing the job itself.

Has anybody experience this problem and, even better, have any idea how to solve it?

Daniel

Hi Daniel!

Sounds very interesting. Do you close the conversation on both ends of the dialog with an END CONVERSATION statement?
Normally the conversations should go away from sys.conversation_endpoints within 30 minutes as you have wrote...

Thanks

Klaus Aschenbrenner
www.sqljunkies.com/weblog/klaus.aschenbrenner
www.csharp.at

|||

Hi Daniel!

Sounds very interesting. Do you close the conversation on both ends of the dialog with an END CONVERSATION statement?
Normally the conversations should go away from sys.conversation_endpoints within 30 minutes as you have wrote...

Thanks

Klaus Aschenbrenner
www.sqljunkies.com/weblog/klaus.aschenbrenner
www.csharp.at

|||Yes, we should be closing at both ends. However, I've not yet confirmed this 100%. I was working on the assumption that if the endpoint was in the "closed" state, we must have closed it at both ends (which is what the documentation suggests). Given that SB doesn't seem to be working as expected, perhaps the endpoint state is also suspect? I'll profile the system and see if I can trace the end conversations.|||

The endpoint states meaning is described here: http://msdn2.microsoft.com/en-us/library/ms176082.aspx. CLOSED indeed means both endpoints had issued END CONVERSATION.

What is you message exchange pattern? Who is issuing END CONVERSATION first, the initiator or the target? Is the target ever sending any replies back to the initiator?

Thanks,
~ Remus

|||

Thanks for considering this Remus. I'm a little busy and haven't yet had a chance to look into this to keep comprehensive answers; maybe I can spend more time on this later today.

We have a mixture of message exchange patterns. Most are fire and forget (no response from target to initiator) and in these situations the initiator starts a conversation sends a message and ends its side of the conversation with no delay; the target then picks up the message at some point in the future, processes it and then ends the other side of the conversation. We also have a few request/response conversations; generally we have seperate processes responsible for sending requests and processing responses; there are no pseudo-synchronous conversations.

I may have some more detailed information once I've analysed a trace of service broker activity in this database.

|||

Here are some examples of the service broker activity:

546BC38E-B300-40BC-9A54-2C6F281E928D 2006-09-27 09:35:50.920 Initiator DISCONNECTED_OUTBOUND
546BC38E-B300-40BC-9A54-2C6F281E928D 2006-09-27 09:35:50.920 Target DISCONNECTED_INBOUND
546BC38E-B300-40BC-9A54-2C6F281E928D 2006-09-27 09:35:50.920 Initiator CLOSED

221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.083 Initiator STARTED_OUTBOUND
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.100 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.100 Target STARTED_INBOUND
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.100 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.113 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.113 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.113 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.113 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.130 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.130 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.130 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.130 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.130 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.147 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.147 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.147 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.147 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.147 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.160 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.160 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.177 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.177 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.177 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.177 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.193 Initiator CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.193 Target CONVERSING
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.207 Initiator DISCONNECTED_OUTBOUND
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.207 Target DISCONNECTED_INBOUND
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:48:22.207 Initiator CLOSED
221E2875-FEFD-41B2-B6EF-2C75F5885E32 2006-09-27 09:58:38.330 Target CLOSED

C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:38:12.977 Initiator STARTED_OUTBOUND
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:38:12.993 Initiator CONVERSING
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:38:12.993 Target STARTED_INBOUND
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:38:12.993 Target CONVERSING
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:38:13.180 Initiator CONVERSING
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:38:13.180 Target CONVERSING
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:54:17.837 Initiator DISCONNECTED_OUTBOUND
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:54:17.837 Target DISCONNECTED_INBOUND
C1E9F3C6-B10C-4605-8E6A-2CB03D95EE2C 2006-09-27 09:54:17.853 Initiator CLOSED

I'm not sure this tells us much but I am suprised about the location of the DISCONNECTED_OUTBOUND messages as I thought our code typcically ended the conversation immediately after sending the message(s) without waiting for a response. Is this because I traced the service broker activity events rather than the actuall T-SQL statements issuing the service broker commands ("END CONVERSATION" etc)?

Daniel

|||

The pattern that leaves target endpoints stranded is the one where the target never sends any message (including EndDialog message). So try not to do fire and forget patterns, they have other faults too. If you don't want/can't change this, then you should set up a task to periodically clean them up (using ENd CONVERSATION ... WITH CLEANUP). The criteria is conversation endpoints that are CLOSED and last activity is more than 30 minutes in the past.

HTH,
~ Remus

|||

Daniel Renshaw wrote:

I'm not sure this tells us much but I am suprised about the location of the DISCONNECTED_OUTBOUND messages as I thought our code typcically ended the conversation immediately after sending the message(s) without waiting for a response. Is this because I traced the service broker activity events rather than the actuall T-SQL statements issuing the service broker commands ("END CONVERSATION" etc)?

I hop I'll g et this right, I'm doing it from memory:

The transition CONVERSING->DISCONNECTED_OUTBOUND is when the initiator issues END CONVERSATION.
The transition CONVERSING->DISCONNECTED_INBOUND is when the EndDialog message sent by initiator arrives at the target
The transition DISCONNECTED_OUTBOUND->CLOSED is when the acknowledgement for the initiators EndDialog message comes back to it.
The transition DISCONNECTED_INBOUND->CLOSED is when the target issues END CONVERSATION in response to the EndDialog message received from initiator.

The pattern shown here is one of the pattern that leaves the target endpoint stranded. Because it never sent any message to the initiator, it never received an acknowledgement. An ack from the initiator sent back to the target serves as positive proof that the initiator will not retry to send message 0. W/o this proof the target cannot delete itself, it has to stay around indefinetly to prevent a replay of message 0, resulting in a stranded target endpoint. That's another reason why the fire-and-forget pattern is ... unrecommended.

BTW, you should also add the EventSubclass column to the profiler view, it details what kind of conversation event we're seeing.

HTH,
~ Remus

|||

Thanks Remus, I'll implement the background cleanup for now. We may be revisting our core principles at some point in the future based on the lessons learnt over the past few months. We've found that tables may have been a more appropriate solution than the many queues we've ended up with.

For example, a message arrives and we put a record in a table as an audit/status information. This continues through the system, each message/step typically generates further records being inserted/updated in regular tables so that we can keep track of what's going on. This has caused tremendous bloating/duplication of data and massive transaction logs so we're now asking ourselves: why not put the message in that same table and forget the queues.

When we come to reconsider all that, we'll ensure fire-and-forget is removed from any service broker elements that remain.

Daniel

|||This saved me from pulling my hair out... I've added it to my blog.

http://www.nootz.net/index.php/notification-services-conversation-cleanup.html

Thanks,
Garick

Sunday, February 19, 2012

client side print button not visible even in SQL Server 2005 Express SP 2.0

Hi All!

i installed SQL Server 2005 express edition Service Pack 2.0, SQL server Advance Services, and Toolkit . Still Print button in client side report is not visible in web form.

please help me.

thanks in advance.

rkraju:

Hi All!

i installed SQL Server 2005 express edition Service Pack 2.0, SQL server Advance Services, and Toolkit . Still Print button in client side report is not visible in web form.

please help me.

thanks in advance.

Wel I guess we cannot do that...printing is not available on client SSRS...Too bad...And just to let you know, if you need to send query parameters to the report forget the client SSRS again...it sucks...you have to install the report on the Web server and that way yes you can print and send query parameters and so long...other way no solution...

Read here...I'm feeling frustrated on this...

http://blogs.msdn.com/mohamed_sharafs_blog/archive/2005/12/20/LocalReportCustomCode.aspx

However if you've found another solution please let me know!!!Thanks a lot!

Thursday, February 16, 2012

Client Printing Hangs

We are accessing SSRS reports using web service. We call the Render the reports using http://<server>/ReportServer/Pages/ReportViewer.aspx?reportName&rs:Command=Render

All reports render fine. However for one particular report when we click the print button on the report viewer in IE, Active-x pops up a message "Printing Now" and hangs eternally.

The error occurs even when I am logged in with Admin privileges to the machine and Active-X client works fine for other reports except this one.

Work-around tried: If I call the same report from Report Manager it works fine. Even on the server I have been able to print the report fine.

The report is just 1 page and the data loaded is also not very heavy. Any idea why client side report printing hangs?

hello... have you solved it yet? I got the same issue too.|||

Hi quantum,

Have you tried unstinstalling and reinstalling the Print Control?

You can set a registry key to on the client machine that will start client print logging. It creates a log file in your temp folder. Here is the key.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\80\Reporting Services]
"LogRSClientPrintInfo"=dword:00000001

You can send me the log file and I can take a look to see if I know what the issue is. Remove the online in my email address.

|||

We are also experiencing the problem from all client PCs. The problem only occurs on one report that contains a subreport. Besides the IE browser, it also hangs when trying to print from Studio 2005.

Has anyone solved this problem yet?

|||We have the same problem. Except that the problem occurs on a report containing a matrix control and no subreports. It started happening with a new version of a report. When I deployed an old version of the same report (that printed nicely earlier), it also hangs during printing.

We have RS 2000 with SP2.|||

Folks, we've seen a similar issue in our testing but were not able to reproduce the scenario for it. Without a stable repro, it makes it close to impossible to identify and fix the issue.

Would it be possible for one/some of you to follow the instructions that Brad provided earlier in this thread and then post a bug with that information, the RDL you're using, and (if possible) a sample dataset that causes the issue on our product feedback site:

http://lab.msdn.microsoft.com/productfeedback/

Thanks for your help on this,

-Lukasz

|||

the issue seems to a problem the local machine and the rights it has to install exes. My machine our organization stop us from installing any exes from the web etc. I have the same printing issue and the browser hangs.

But when I tried the same page from a machine in the DMZ zone which does not have restrictions, the priting is working fine.

|||

We are having the same issue described above, however it only appears to effect the larger reports. The other interesting thing is that we get this error, if the client waits long enough - about 10 min.

INVALID PAGE NUMBER
The requested page does not exist.

Can someone give me some more specifics as to how to run the client logging utiltity mentioned above. I am assuming that the registry edit should be made on the server - not the client? Also, where does the log file go - exactly. If it is in a %temp% directory, is this is the directory for the user under which reporting services runs, or the IIS user, or the local user or what?

We are running:
Windows Server 2003, SP2, 64bit
SQL Server 2000, SP4, clustered, 64bit
IIS 6.0 on Windows Server 2003

|||

Hi Brad,

I couldn't find the registry keys on my machine. We are using SQL Server 2005 and Reporting Services 2005. Reports are being rendered via browser using ReportViewer.aspx with various query string parameters.

I am thinking that this is not a stable approach to render reports from Report Server. Do you know if directly accessing reports from client browser using ReportViewer.aspx is not a recommended approach?

Thanks

Uday Hegde

|||

I am having the same issue, started yesterday. All of a sudden, the report wouldn't print.

here is the data from the printlog

CRSClientPrint:Stick out tonguerint - Starting Function.
reportServerUrl = /ReportServer
reportPath = %2fAR%2fAR0006(b)+Statement+of+Accounts+-+Known+as+Name&rsTongue TiedessionID=wkawsv3n2prf1gv2hnili455
reportName = AR0006(b) Statement of Accounts - Known as Name
CResourceManager:Tongue TiedetLocaleInfo - Starting Function.
SetUICulture - Starting Function.
Attempted UI LCID = 9
Using UI LCID = 1033
SetUICulture - Ending Function.
CResourceManager::LoadResourceDLL - Starting Function.
CResourceManager::LoadResourceDLL - Ending Function: 0x00000000.
CResourceManager::CanUseCurrentLocale - Starting Function.
CResourceManager::CanUseCurrentLocale - Ending Function.
CResourceManager::LoadGDIPlus - Starting Function.
CResourceManager::LoadGDIPlus - Ending Function: 0x00000000.
Attempted culture = 1033
Using culture = 1033
Culture name = English_United States.1252
CResourceManager:Tongue TiedetLocaleInfo - Ending Function: 0x00000000.
CPrintDlg:Stick out tonguerint - Starting Function.
CPrintDlg::InitializePrintDlg - Starting Function.
CPrintDlg::GetDefaultPrinterName - Starting Function.
CPrintDlg::GetDefaultPrinterName - Ending Function: 0x00000000.
CPrintDlg:Tongue TiedetPrinterPaperSize - Starting Function.
CPrintDlg::GetDefaultPaperSetting - Starting Function.
CPrintDlg::GetDefaultPaperSetting - Ending Function: 0x00000000.
CPrintDlg:Tongue TiedetPrinterPaperSize - Ending Function: 0x00000000.
CPrintDlg::InitializePrintDlg - Ending Function: 0x00000000.
CReport:Tongue TiedetReportName - Starting Function.
CReport:Tongue TiedetReportName - Ending Function: 0x00000000.
CReport::Fetch - Starting Function.
CReport::ComparePrintInfo - Starting Function.
Value of diff = 2
CReport::ComparePrintInfo - Ending Function.
CReport::ClearPages - Starting Function.
CReport::ClearFetchedPages - Starting Function.
CReport::ClearFetchedPages - Ending Function.
CReport::ClearPages - Ending Function.
CReport::ResetNextFetch - Starting Function.
Next Fetch set to 1
CReport::ResetNextFetch - Ending Function.
CReport:Tongue TiedtartFetchThread - Starting Function.
CReport::GetPageToFetch - Starting Function.
Page to fetch = 1
CReport::GetPageToFetch - Ending Function.
CReport:Tongue TiedtartFetchThread - Ending Function: 0x00000000.
CReport::Fetch - Ending Function: 0x00000000.
CPrintPreviewDlg::CreatePreviewDialog - Starting Function.
CReport::GetPage - Starting Function.
Page = 1
CReport::FetchThreadMain - Starting Function.
CReport::GetPageWrapper - Starting Function.
Page wrapper = 0x00000000
CReport::GetPageWrapper - Ending Function.
CReport::GetPageToFetch - Starting Function.
Page to fetch = 1
CReport::GetPageToFetch - Ending Function.
CReport::FetchAllPages - Starting Function.
CReport:Stick out tongueerformFetch - Starting Function.
CReport::GetPaperSize - Starting Function.
Height = 11000, Width = 8500 IsMM = 0
CReport::GetPaperSize - Ending Function.
CResourceManager:Tongue TiedetInvariantCulture - Starting Function.
CResourceManager:Tongue TiedetInvariantCulture - Ending Function: 0x00000000.
CResourceManager::ResetCulture - Starting Function.
CResourceManager::ResetCulture - Ending Function: 0x00000000.
Url = http://10.1.1.130/ReportServer?%2fAR%2fAR0006(b)+Statement+of+Accounts+-+Known+as+Name&rsTongue TiedessionID=wkawsv3n2prf1gv2hnili455&rs:Command=Render&rs:format=IMAGE&rcSurpriseutputFormat=emfplus&rcTongue TiedtartPage=1&rc:EndPage=65535&rcStick out tongueageWidth=8.5in&rcStick out tongueageHeight=11.0in&rc:MarginTop=3.048mm&rc:MarginBottom=3.048mm&rc:MarginLeft=3.048mm&rc:MarginRight=3.048mm&rsStick out tongueersistStreams=True
CPage::CreateEnhMetaFile - Starting Function.
CPage::CreateEnhMetaFile - Ending Function.
CReport:Stick out tongueerformFetch - Ending Function.
CReport::FetchAllPages - Ending Function.
CReport::GetPageWrapper - Starting Function.
Page wrapper = 0x05E76D00
CReport::GetPageWrapper - Ending Function.
CReport::GetPageToFetch - Starting Function.
Page to fetch = 2
CReport::GetPageToFetch - Ending Function.
CReport::GetPage - Ending Function: 0x00000000.
CReport::FetchPage - Starting Function.
CReport:Stick out tongueerformFetch - Starting Function.
CReport::GetPaperSize - Starting Function.
Height = 11000, Width = 8500 IsMM = 0
CReport::GetPaperSize - Ending Function.
CResourceManager:Tongue TiedetInvariantCulture - Starting Function.
CResourceManager:Tongue TiedetInvariantCulture - Ending Function: 0x00000000.
CResourceManager::ResetCulture - Starting Function.
CResourceManager::ResetCulture - Ending Function: 0x00000000.
Url = http://10.1.1.130/ReportServer?%2fAR%2fAR0006(b)+Statement+of+Accounts+-+Known+as+Name&rsTongue TiedessionID=wkawsv3n2prf1gv2hnili455&rs:Command=Render&rs:format=IMAGE&rcSurpriseutputFormat=emfplus&rcTongue TiedtartPage=2&rc:EndPage=2&rcStick out tongueageWidth=8.5in&rcStick out tongueageHeight=11.0in&rc:MarginTop=3.048mm&rc:MarginBottom=3.048mm&rc:MarginLeft=3.048mm&rc:MarginRight=3.048mm&rs:GetNextStream=True
CReport::GetPaperSize - Starting Function.
Height = 11000, Width = 8500 IsMM = 0
CReport::GetPaperSize - Ending Function.
CReport::GetPage - Starting Function.
Page = 1
CReport::GetPageWrapper - Starting Function.
Page wrapper = 0x05E76D00
CReport::GetPageWrapper - Ending Function.
CReport::GetPage - Ending Function: 0x00000000.
CPrintDlg:Big SmilerawFile - Starting Function.
CPrintDlg:Big SmilerawFile - Ending Function: 0x00000000.
CReport::GetPaperSize - Starting Function.
Height = 11000, Width = 8500 IsMM = 0
CReport::GetPaperSize - Ending Function.
CReport::GetPage - Starting Function.
Page = 2
CReport::GetPageWrapper - Starting Function.
Page wrapper = 0x00000000
CReport::GetPageWrapper - Ending Function.
CPage::CreateEnhMetaFile - Starting Function.
CPage::CreateEnhMetaFile - Ending Function.
CReport:Stick out tongueerformFetch - Ending Function.
CReport::FetchPage - Ending Function.
CReport::GetPageWrapper - Starting Function.
Page wrapper = 0x05EA5908
CReport::GetPageWrapper - Ending Function.
CReport::GetPageToFetch - Starting Function.
Page to fetch = 3
CReport::GetPageToFetch - Ending Function.
CReport::GetPage - Ending Function: 0x00000000.
CPrintDlg:Big SmilerawFile - Starting Function.
CReport::FetchPage - Starting Function.
CReport:Stick out tongueerformFetch - Starting Function.
CReport::GetPaperSize - Starting Function.
Height = 11000, Width = 8500 IsMM = 0
CReport::GetPaperSize - Ending Function.
CResourceManager:Tongue TiedetInvariantCulture - Starting Function.
CResourceManager:Tongue TiedetInvariantCulture - Ending Function: 0x00000000.
CResourceManager::ResetCulture - Starting Function.
CResourceManager::ResetCulture - Ending Function: 0x00000000.
Url = http://10.1.1.130/ReportServer?%2fAR%2fAR0006(b)+Statement+of+Accounts+-+Known+as+Name&rsTongue TiedessionID=wkawsv3n2prf1gv2hnili455&rs:Command=Render&rs:format=IMAGE&rcSurpriseutputFormat=emfplus&rcTongue TiedtartPage=3&rc:EndPage=3&rcStick out tongueageWidth=8.5in&rcStick out tongueageHeight=11.0in&rc:MarginTop=3.048mm&rc:MarginBottom=3.048mm&rc:MarginLeft=3.048mm&rc:MarginRight=3.048mm&rs:GetNextStream=True
CPrintDlg:Big SmilerawFile - Ending Function: 0x00000000.
CReport::GetPaperSize - Starting Function.
Height = 11000, Width = 8500 IsMM = 0
CReport::GetPaperSize - Ending Function.
CReport::GetPage - Starting Function.
Page = 3
CReport::GetPageWrapper - Starting Function.
Page wrapper = 0x00000000
CReport::GetPageWrapper - Ending Function.
CPage::CreateEnhMetaFile - Starting Function.
CPage::CreateEnhMetaFile - Ending Function.
CReport:Stick out tongueerformFetch - Ending Function.
CReport::FetchPage - Ending Function.
CReport::GetPageWrapper - Starting Function.
Page wrapper = 0x05ED4798
CReport::GetPageWrapper - Ending Function.
CReport::GetPage - Ending Function: 0x00000000.
CReport::GetPageToFetch - Starting Function.
Page to fetch = 4
CReport::GetPageToFetch - Ending Function.
CPrintDlg:Big SmilerawFile - Starting Function.
CReport::FetchPage - Starting Function.
CReport:Stick out tongueerformFetch - Starting Function.
CReport::GetPaperSize - Starting Function.
Height = 11000, Width = 8500 IsMM = 0
CReport::GetPaperSize - Ending Function.
CResourceManager:Tongue TiedetInvariantCulture - Starting Function.
CResourceManager:Tongue TiedetInvariantCulture - Ending Function: 0x00000000.
CResourceManager::ResetCulture - Starting Function.
CResourceManager::ResetCulture - Ending Function: 0x00000000.
Url = http://10.1.1.130/ReportServer?%2fAR%2fAR0006(b)+Statement+of+Accounts+-+Known+as+Name&rsTongue TiedessionID=wkawsv3n2prf1gv2hnili455&rs:Command=Render&rs:format=IMAGE&rcSurpriseutputFormat=emfplus&rcTongue TiedtartPage=4&rc:EndPage=4&rcStick out tongueageWidth=8.5in&rcStick out tongueageHeight=11.0in&rc:MarginTop=3.048mm&rc:MarginBottom=3.048mm&rc:MarginLeft=3.048mm&rc:MarginRight=3.048mm&rs:GetNextStream=True
CPrintDlg:Big SmilerawFile - Ending Function: 0x00000000.
CReport::GetPaperSize - Starting Function.
Height = 11000, Width = 8500 IsMM = 0
CReport::GetPaperSize - Ending Function.
CReport::GetPage - Starting Function.
Page = 4
CReport::GetPageWrapper - Starting Function.
Page wrapper = 0x00000000
CReport::GetPageWrapper - Ending Function.