all groups > sql server notification services > october 2006 >
You're in the

sql server notification services

group:

NS with Remote DB Server?


NS with Remote DB Server? tarpan
10/16/2006 7:21:01 AM
sql server notification services: Hi everybody,

In good old times with a one server everything worked fine. Now I have 2
servers: web server + DB server. I have deployed NS Instance to the Web
server with DBs created on the DB server. Installs nice and easy.

However, my Subscription management App (ASP.Net based) crashes with message:

Login failed for user ''. The user is not associated with a trusted SQL
Server connection.

[NSException: Notification Services failed to get the metadata for the
specified instance.
Instance Name: NSInstance
SqlServerError:
Source: .Net SqlClient Data Provider
Number: 18452
State: 1
Class: 14
Server: DBSERVER\DB
Message: Login failed for user ''. The user is not associated with a
trusted SQL Server connection.
Procedure:
Line Number: 65536
]


in a line

NS_Instance = New
Microsoft.SqlServer.NotificationServices.NSInstance(NS_InstanceName)


When I register the instance I have provided the SQL user name and password
as :

nscontrol register ... -server SqlServer -sqlusername USERNAME -sqlpassword
PASSWORD

My guess is: the ASP app runs under ASPNET user. When I create object of
NSInstance class, the object trying to access it's database with the
credentials of ASPNET user. The DB server does not know who the ASPNET user
is, so it rejects the connection.

I tried to add user WebServer\ASPNET to the SQL server - unsuccessful. At
this point I don't know what to do.

Whoever has any ideas, please help me. Thank you.



PS. I have tried to deploy the NS to the DB Server and register it on the
web server - got exactly same result.



Re: NS with Remote DB Server? Joe Webb
10/19/2006 12:00:00 AM
Hi Tarpan -

I'm assuming you've installed the NS client tools and have registered
the instance on the web server, right?

See if these links help:
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/f05a7c2b-36b0-4b6e-ac7c-662700081f25.mspx?mfr=true
http://dallas.sark.com/SarkBlog/cboland/archive/2005/11/28/2267.aspx


HTH...
--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On Mon, 16 Oct 2006 07:21:01 -0700, tarpan
[quoted text, click to view]
Re: NS with Remote DB Server? tarpan
10/24/2006 7:40:02 AM
[quoted text, click to view]

Sure.

[quoted text, click to view]

It's very confusing. Do I really have do all that tricks to just access a
database? Is it possible to somehow get access by providing valid SQL user
credentials?

PS. I'm talking about accessing NS DB over NS API, not about just any DB.

Re: NS with Remote DB Server? tarpan
10/24/2006 8:21:02 AM
Joe,

First of all, thank you for the responce. You are the best! :-)

Well, I have read the links you sent. It's wrong. I should not change the
application user just because one page of the application sometimes accesses
another server. If the page needs special access, it should be able to
provide special user credentials. That's it.

It seems like a very standard setup: Web-server and SQL-server are separate
PCs. I don't understand why I can not configure standard SQL Server feature
for the standard setup. %-(


[quoted text, click to view]
Re: NS with Remote DB Server? Joe Webb
11/2/2006 12:00:00 AM
Hi Tarpan -

Okay, let's make sure we're talking the same thing....

As I understand it, you have a server that is running the database
engine; we'll call that SQL1.

You also have a server that is running IIS and hosts your subscription
management interface (SMI); let's call that WEB1.

The SQLNS instance is installed on WEB1, right?

If so this is what is generally referred to as a Remote Database
deployment scenario.

Under this scenario, the SMI doesn't need direct access to the SQL
Server database (unless you are doing things that are outside the
bounds of what SQLNS provides like checking passwords, obtaining lists
of something, etc).

The SQLNS instance does, of course, need access to the remote
database. This is configured when the instance is registered on WEB1.
You can specify that the instance should authenticate using SQL Server
Security or Windows Authentication. If you opt for the former, provide
a SQL Server Login and password.

Next make sure a Login is present in SQL Server on SQL1. If you're
using SQL Server authentication, create a SQL Server login to match
the one defined when the instance was registered. If you're using
Windows Authentication, make sure you map it correctly to the domain
user account.

Finally, make sure the login has access to the SQLNS database and are
members of the appropriate database roles, probably NSRunService is
what you're after.

Make sense?

BTW - if you own a copy of my book, this topic is covered in a bonus
chapter that's available for download from the publisher's site -
http://www.rationalpress.com.

HTH...

--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)



On Tue, 24 Oct 2006 08:21:02 -0700, tarpan
[quoted text, click to view]
Re: NS with Remote DB Server? tarpan
11/2/2006 7:28:02 AM


[quoted text, click to view]

Right

[quoted text, click to view]

Right

[quoted text, click to view]

Stop right here! How????

When I register the instance on WEB1 server I have provided the SQL user
name and password as :

nscontrol register ... -server SQL1 -sqlusername USERNAME -sqlpassword
PASSWORD

I guess it exactly that I suppose to do. However it does not help.




If you opt for the former, provide
[quoted text, click to view]
Re: NS with Remote DB Server? tarpan
11/2/2006 1:38:01 PM
:-)

It is "sa" user already.

The instance registered with "sa" user name and password (the password is
correct - no doubts).



[quoted text, click to view]
Re: NS with Remote DB Server? Joe Webb
11/2/2006 2:47:08 PM

Ok, you're using SQL Server authentication. Have you checked to make
sure there is a Login for the account specified when registering? Have
you granted access to that Login to the NS databases? Have you added
the database user to the NSRunService database role? I'd start with
trying these first.

If you're still having trouble, trying unregistering the instance and
re-registering it providing the sa login and password. Not good for
production, but it'll help you to verify that an account with
sufficient permissions can access the database.

HTH...

Joe



--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)

On Thu, 2 Nov 2006 07:28:02 -0800, tarpan
[quoted text, click to view]
Re: NS with Remote DB Server? Joe Webb
11/2/2006 4:31:25 PM
Ok.....when you registered, you used the -server argument to specify
the SQL Server where the instance database is right?

Are you running 2000 or 2005?

--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)




On Thu, 2 Nov 2006 13:38:01 -0800, tarpan
[quoted text, click to view]
Re: NS with Remote DB Server? tarpan
11/3/2006 8:32:01 PM

[quoted text, click to view]

Well, I guess. But it always worth to check. I'll double check it to make
sure...
Next week when I'll be back from a hiking trip :-))))

[quoted text, click to view]

2005.


[quoted text, click to view]
AddThis Social Bookmark Button