recurrent inability to connect to SQL after reboot

recurrent inability to connect to SQL after reboot

Post by Eachu » Sun, 25 May 2003 06:02:54



I have a web application that connects to SQL Server
without problems most of the time. However, every time the
web server is rebooted, after it comes back up the
connection to the database stops working for an
unpredictable amount of time.

The web server and SQL Server are on separate machines.
Other web servers are able to connect to SQL Server
without problems, using the same application with the same
login, password, connection string, and code.

The error occurs when I call the connection.open method.
The error message is "Access is denied".
Exception type is System.UnauthorizedAccessException.

I'm using SQL Server authentication to connect.

Are there any known bugs that could be causing this? Are
there any workarounds?

 
 
 

recurrent inability to connect to SQL after reboot

Post by Kevin Sun [M » Tue, 27 May 2003 17:18:15


Hi,

As you described, this problem occurs when rebooting the web server.
Therefore, how did you make it works most of time. Please check the
following information to see if it helps you:

=================

There are two causes for this error. Both errors are permission-related
issues
and involve a database that is either on a different computer from the Web
server, or the database is possibly being referenced using a UNC path
(\\Server\Share). Even if the database is on the same computer as the Web
server, UNC paths make the database appear to the Web server to be on a
different computer on the network.

 - The following is true if the .asp page is accessed by an anonymous user:

   IIS will use (by default) a Windows NT account called:

   USR_<machinename>.

   This account is local to the Web server and is essentially unknown to any
   other computers on the network. When IIS, operating under the security
   context of the IUSR account, tries to access any resources on a remote
   computer, the remote computer tries to validate the account being used.
   Because the IUSR account is a local account that is unknown to the remote
   computer, access is denied.

   There are two solutions when anonymous access causes this problem:

    - In the Internet Service Manager tool, under Web Properties, change the
      anonymous logon account from the default local account to a valid
      domain-based account. In the UserName field, enter the domain account
to
      use as 'domain\userid'. This way, the remote computer can check with
the
      domain controller to validate the security credentials passed to it by
      IIS.

   -or-

    - Duplicate the

      IUSR_<machineaccount>

      account on the remote computer that contains the resource you want to
      access. If an account is created on the remote computer that has the
exact
      same name and password, Windows NT treats them as equivalent accounts.

-or-

 - If the .asp page only allows authenticated access, please refer to the
   following:

   If the page does not allow anonymous access, IIS tries to authenticate
the
   user making the request, and uses their security credentials for all
   activities such as database accesses. The two primary causes for a
failure in
   this scenario are described below.

    - By default, IIS is configured to use Windows NT Challenge/Response as
the
      authentication method. Because of limitations in the Windows NT 4.0
(and
      prior versions) security model, a user that has been authenticated
using
      Windows NT Challenge/Response cannot access resources on remote
computers.
      This is commonly referred to as a delegation problem. To verify if
this is
      the case, in the Internet Services Manager tool, under Web properties,
      select the Basic (Clear Text) check box and CLEAR the Windows NT
      Challenge/Response. If this solves the problem, then this is a clear
      delegation issue.

   -or-

    - If problems persist, it is likely that the User account being used
does
      not have rights to the SQL Windows NT computer. Try using an account
that
      has known access to the SQL computer.

   For more information concerning delegation, how IIS uses authentication
to
   secure a Web site, and problems such as this, please see the article "IIS
   Authentication and Security for Internet Developers" located at this Web
   address:

   http://www.microsoft.com/workshop/server/feature/security.asp
=====================

Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| Content-Class: urn:content-classes:message


| Subject: recurrent inability to connect to SQL after reboot
| Date: Fri, 23 May 2003 14:02:54 -0700
| Lines: 19

| MIME-Version: 1.0

| Content-Type: text/plain;
|       charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcMhbq3jIi1X9UAOSGWFwtbkVMFEOA==
| Newsgroups: microsoft.public.data.ado
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.data.ado:60193
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.data.ado
|
| I have a web application that connects to SQL Server
| without problems most of the time. However, every time the
| web server is rebooted, after it comes back up the
| connection to the database stops working for an
| unpredictable amount of time.
|
| The web server and SQL Server are on separate machines.
| Other web servers are able to connect to SQL Server
| without problems, using the same application with the same
| login, password, connection string, and code.
|
| The error occurs when I call the connection.open method.
| The error message is "Access is denied".
| Exception type is System.UnauthorizedAccessException.
|
| I'm using SQL Server authentication to connect.
|
| Are there any known bugs that could be causing this? Are
| there any workarounds?
|

 
 
 

recurrent inability to connect to SQL after reboot

Post by eachu » Thu, 29 May 2003 07:55:02


The ado.net connection stops working for an unpredictable
amount of time. Then it starts working again, generally
within an hour. I don't change anything to fix it, and
it's not apparent that any specific action causes the
problem to resolve.

The most frequent action that precedes it resuming correct
operation is that I access the site: our QA person reports
that she can't access the site, I log it to it, and
suddenly it starts working again for both of us. I'm
rather skeptical that there is a cause-and-effect
relationship there.

In one case the connection stopped working without even a
reboot, and the network admin resolved the problem by
resetting the password on the SQL Server account to the
password specified in the code. Since the code had not
changed since the previous day, when the app had been
working, and everyone denied having changed the password,
it's unclear why a password change was necessary. We put
in place some security to monitor for unexpected password
changes.

Sometimes changing the web.config file and restarting the
app also causes the problem to clear up. This resolves the
problem even in copies of the app for which the config
file has not changed, and undoing the changes to the
config file does not cause it to stop working.

Thanks for the suggestions. However, they all relate to
permissions settings, and I would expect that if it were a
permissions problem, the connection would fail all of the
time, rather than part of the time. Got any other
suggestions?

Quote:>-----Original Message-----
...
>As you described, this problem occurs when rebooting the
web server.
>Therefore, how did you make it works most of time. Please
check the
>following information to see if it helps you:

...
 
 
 

recurrent inability to connect to SQL after reboot

Post by Kevin Sun [M » Thu, 29 May 2003 19:17:50


This problem occurs in a complex environment. We need to perform a serial
troubleshooting steps to narrow down this problem on the web server.

297954.KB.EN-US HOW TO: Troubleshoot the Web Server in Windows 2000
http://support.microsoft.com/default.aspx?scid=KB;EN-US;297954

In addition, I suggest to request a Micrsoft support incident to get
further assistance on this type of problem.

Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| Content-Class: urn:content-classes:message




| Subject: RE: recurrent inability to connect to SQL after reboot
| Date: Tue, 27 May 2003 15:55:02 -0700
| Lines: 44

| MIME-Version: 1.0
| Content-Type: text/plain;
|       charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcMkowHYgjYrZaL2RBKvlFS1fvhBxw==
| Newsgroups: microsoft.public.data.ado
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.data.ado:60283
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.data.ado
|
| The ado.net connection stops working for an unpredictable
| amount of time. Then it starts working again, generally
| within an hour. I don't change anything to fix it, and
| it's not apparent that any specific action causes the
| problem to resolve.
|
| The most frequent action that precedes it resuming correct
| operation is that I access the site: our QA person reports
| that she can't access the site, I log it to it, and
| suddenly it starts working again for both of us. I'm
| rather skeptical that there is a cause-and-effect
| relationship there.
|
| In one case the connection stopped working without even a
| reboot, and the network admin resolved the problem by
| resetting the password on the SQL Server account to the
| password specified in the code. Since the code had not
| changed since the previous day, when the app had been
| working, and everyone denied having changed the password,
| it's unclear why a password change was necessary. We put
| in place some security to monitor for unexpected password
| changes.
|
| Sometimes changing the web.config file and restarting the
| app also causes the problem to clear up. This resolves the
| problem even in copies of the app for which the config
| file has not changed, and undoing the changes to the
| config file does not cause it to stop working.
|
|
| Thanks for the suggestions. However, they all relate to
| permissions settings, and I would expect that if it were a
| permissions problem, the connection would fail all of the
| time, rather than part of the time. Got any other
| suggestions?
|

Quote:| >-----Original Message-----
| ...
| >As you described, this problem occurs when rebooting the
| web server.
| >Therefore, how did you make it works most of time. Please
| check the
| >following information to see if it helps you:
| ...
|

 
 
 

recurrent inability to connect to SQL after reboot

Post by eachu » Fri, 30 May 2003 03:24:19


Yes, I may need to open a MS support incident.

I have a question about the article you posted part of
earlier, that starts, "There are two causes for this
error. Both errors are permission-related issues...." The
article doesn't say whether it pertains to connections via
NT logins or SQL Server logins or both. It sounds to me
like it only applies to NT logins. Is that true, or does
it apply to both?

Quote:>-----Original Message-----
>This problem occurs in a complex environment. We need to
perform a serial
>troubleshooting steps to narrow down this problem on the
web server.

>297954.KB.EN-US HOW TO: Troubleshoot the Web Server in
Windows 2000
>http://support.microsoft.com/default.aspx?scid=KB;EN-
US;297954

>In addition, I suggest to request a Micrsoft support
incident to get
>further assistance on this type of problem.

 
 
 

recurrent inability to connect to SQL after reboot

Post by Kevin Sun [M » Fri, 30 May 2003 12:35:20


This article addresses the accounts on the web server, instead of the SQL
side (including NT login and SQL Server login), you can use both of the
login accounts when connecting to the SQL server.

The following are some troubleshooting steps for your reference:

1. Does the same problem occur when connecting to another SQL server? If
not, it is related to the configuration on the SQL server.

2. Does the same problem occur if using the SQL login account in the ADO
connection string?

3. Build a small test application connecting to the SQL server. When this
problem occur, can you use the small test application to connect the SQL
server successfully? If it works, it indicate this problem is related to
the web server configuration.

Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| Content-Class: urn:content-classes:message






| Subject: RE: recurrent inability to connect to SQL after reboot
| Date: Wed, 28 May 2003 11:24:19 -0700
| Lines: 26

| MIME-Version: 1.0
| Content-Type: text/plain;
|       charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcMlRlqilHxuQD+kQWmbTZ3u5Po9Aw==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.data.ado
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.data.ado:60328
| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.public.data.ado
|
| Yes, I may need to open a MS support incident.
|
| I have a question about the article you posted part of
| earlier, that starts, "There are two causes for this
| error. Both errors are permission-related issues...." The
| article doesn't say whether it pertains to connections via
| NT logins or SQL Server logins or both. It sounds to me
| like it only applies to NT logins. Is that true, or does
| it apply to both?
|

Quote:| >-----Original Message-----
| >This problem occurs in a complex environment. We need to
| perform a serial
| >troubleshooting steps to narrow down this problem on the
| web server.
| >
| >297954.KB.EN-US HOW TO: Troubleshoot the Web Server in
| Windows 2000
| >http://support.microsoft.com/default.aspx?scid=KB;EN-
| US;297954
| >
| >In addition, I suggest to request a Micrsoft support
| incident to get
| >further assistance on this type of problem.
| >
|
|

 
 
 

1. Configure boo boo caused inability to connect

I accidently put in one more zero than I needed while in the Configure
window adding
number of locks, and ever since I get the message:

"A connection could not be established to (SQL Server) There is
insufficient system memory to run this query"

I can't get back in to configure, and I get the same message
when I try to sp_Configure from Isql.

Is there some way around this problem?

(remove nospam and the next period from my address to email me)

2. DTS Q04 - Load multiple destination tables from a single source file

3. Kernel errors and inability to connect to Sybase

4. FILE MAKER Pro Compatibility with MS ACCESS, MS EXCEL

5. SQL Cluster Reboot or No Reboot?

6. Systems Analyst-Oracle-$70k+ Medical Info. System Play the LEAD ROLE!

7. DTS Management and recurrent tasks

8. How to create a non-failed branches in DTS

9. need help with recurrent select

10. Recurrent problem with ora-error 1575

11. SQL2000 server's inability to recognize vpn ip

12. Inability to run inline packages

13. psql inability to select a socket