I found something interesting this morning while working with STSADM.EXE to verify the installation of a web part package on Sharepoint Portal using the -enumwppacks command.
Every time I ran stsadm, I received the following error message:
Cannot connect to the configuration database. For tips on troubleshooting this error, search for article 823287 in the Microsoft Knowledge Base at http://support.microsoft.com.
So, I went and verified that all of the settings as specified in the article, mostly dealing with the application pool user and the database rights for that user. All seemed to be in order so I really couldn't figure out what was happening.
THEN I got to thinking about the fact that MAYBE, the information in the article was correct, but the context was not.
I was logged onto the server as a "development" user which doesn't actually have God-like powers to things. It also didn't have total access to the database either, I found.
So in a nutshell, here is the situation: when using stsadm on the command line, you are running under the security context of the currently logged-on user. That user must have proper access to the database in order for the command-line utilities to function as designed.
This is not a problem when performing administrative functions via the SPS/WSS web interfaces because at that point, you're running under the security context of the web site's Application Pool user.
Anyway, this was an interesting learning experience.
3 Responses
stsadm unable to connect to sharepoint database at Amar Galla’s Blog
12|Jul|2006 1[…] You need to give you current logged user access to the SharePoint databases. I found a very nice explaination about this problem on Mitch Milam's site. Thanks Mitch. […]
SharePoint from an admins view : Cannot connect to the configuration database
30|Aug|2006 2[…] Cannot connect to the configuration database Mitch Milam hat einen interessanten Artikel verfasst, der sich mit der Problematik beschäftigt, dass beim Zugriff via STSADM eine Fehlermeldung erscheint, dass auf die Konfigurationsdatenbank nicht zugegriffen werden kann. Grob zusammengefasst: der Benutzer, der mit STSADM arbeitet braucht Zugriffsrechte auf den SQL Server auf dem die Datenbank(en) liegt. Published Wednesday, August 30, 2006 5:01 PM by odi […]
Malcolm Gin’s SharePoint and .NET Tips » Blog Archive » Web Part Installs on SharePoint 2003 in environments where you don’t control the Database
20|Dec|2006 3[…] Here's a link I found very helpful to help explain/troubleshoot the issue. […]
Leave a reply