locked
stsadmin error: "Object reference not set to an instance of an object"

    Question

  • Hi,

    I have made a standard single server MOSS installation. Everything appears to be working fine, but I get errors when using stsadm to add solutions. (i.e. the Application Template Core, part of the server admin templates - http://www.microsoft.com/downloads/details.aspx?FamilyId=C1039E13-94DA-4D7D-8CAE-3B96FA5A4045&displaylang=en).

    Running i.e. "stsadm -o addsolution -filename ApplicationTemplateCore.wsp" gives the following error:

    Object reference not set to an instance of an object. ApplicationTemplateCore.wsp: The Solution installation failed.

    I get the excact same error, when I try to deploy Solutions using VSEWSS (November CTP).

    Any ideas to solve this would be greatly appreciated.

     

    Regards,

    Thomas N. Sørensen

    Thursday, February 22, 2007 2:45 PM

Answers

  • Guilherme is close - it is permissions-related. 

     

    But, from what I've discovered this morning, it also has to do with the SQL Admin Content database.  The user executing the STSADM command must have full control access to this DB.  I had this same problem and had my DBA add my user account to this DB w/ full control and reran the scripts with full success. 

     

     

     

    Thursday, February 7, 2008 5:37 PM

All replies

  • I seem to have the exact same issue, did you manage to solve this?
    Tuesday, April 3, 2007 7:22 AM
  • I have the same problem when i try to deploy webparts for moss 2007 in visual studio 2005. I'm making webparts on the same computer for a couple of months but it's only since a couple of day's I get this error with every project I try to deploy (even if there are no files in it).  I would appreciate it very much if anyone knows the solution to this
    Monday, April 16, 2007 7:38 AM
  • I had the same error.  I didn't have permission on the configuration & content database.  After getting permission to the database, the error went away.  I'm not sure if this is what's causing the problem in your case, but it worked for me.
    Tuesday, April 24, 2007 4:07 PM
  • I am having the same problem with Visual Studio.  Here is what I am doing as a work around.  If you look in the bin folder there is a batch file called setup.bat.  It is a pain, but you can remove and deploy the part by opening the command prompt and navigating to the bin folder.  Enter setup /uninstall or setup /install to remove or deploy the solution.  This is not installing the assembly in the GAC so you will still need to do this manually.  As a refresher go to start, then run and type 'assembly'.  Just drag and drop your assembly there.  Or as an alternative you can add some lines to the setup.bat, for example:

    Code Snippet

    @rem----------------------------------------------------------------------
    @rem    LDeploy
    @rem----------------------------------------------------------------------
    :LDeploy
        echo Adding solution %PackageName% to the SharePoint ...
        "%SPAdminTool%" -o addsolution -filename "%PackageFile%"

        echo Deploying solution %PackageName% ...
        "%SPAdminTool%" -o deploysolution -name "%PackageName%" -local -allowGacDeployment -url %TargetWebUrl%

        echo Activating feature WebPart5 ...
        "%SPAdminTool%" -o activatefeature -id 5be720ad-e963-404d-8026-2eecb5c4f6d0 -url %TargetSiteUrl%

        "%programfiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" -if WebPart5.dll

        iisreset

        goto :EOF

     

     

    Tuesday, May 8, 2007 2:39 PM
  •  

    I do also get this error trying install radEditorMOSS.wsp (telerik.com).

     

    I have full permission in the farm but there must be something else that I should have permissions to.

     

    Any help appreciated...

     

    Klaus Kurzawa,

    Sweden

     

    (Updated by Klaus)
    Found a solution of my problem:

    My Computer -> Manage -> Added myself to WSS_RESTRICTED_WPG (Group for the Windows SharePoint Services farm administrator. This group is required for the WSS Administration Service to function.)

    Tuesday, October 16, 2007 12:57 PM

  • I am getting this error while trying to add the solution using stsadm -o addsolution -filename "<drive>:\ApplicationTemplateCore.wsp" command


    Initialization failure

    <drive>:\ApplicationTemplateCore.wsp: The Solution installation failed.


    Any help appreciated.


    Sunil

    Tuesday, October 23, 2007 9:50 AM
  • I am getting the same thing  Sad  Anyone found a soultion yet?

     

     

    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>stsadm -o addsolution -filename d:\applicationtemplatecore.wsp

     

    Object reference not set to an instance of an object.
    d:\applicationtemplatecore.wsp: The Solution installation failed.

    Friday, November 2, 2007 1:09 PM

  • According to this link: http://www.telerik.com/community/forums/thread/b311D-bachea.aspx, the problem is permission. First you have to be part of the Farm Administrator's. If you already part, go to My Computer --> Manage --> and add your user to the group WSS_RESTRICTED_WPG.
    Tuesday, November 6, 2007 1:42 PM
  • Guilherme is close - it is permissions-related. 

     

    But, from what I've discovered this morning, it also has to do with the SQL Admin Content database.  The user executing the STSADM command must have full control access to this DB.  I had this same problem and had my DBA add my user account to this DB w/ full control and reran the scripts with full success. 

     

     

     

    Thursday, February 7, 2008 5:37 PM
  • ksat -

     

    I am having the same problem. Someone else in my company set up SharePoint, and running deploysolution fails for any solution. Two questions -

     

    Which database - SharePoint Central Administration content database (SharePoint_AdminContent_guid)?

     

    Which database role memeberships do you check off to get full control? db_owner?

     

    Thanks

    Brad Cote

    Wednesday, June 11, 2008 9:32 PM
  • I experienced the same problem, I had extracted and coipied the file and had this error.

    Answer:
    Within propertises of the *.wsp file check the security tab. Ensure the 'users' account has full control and re-run. This worked for me you may need to add permissions for a different user though.

    Hope this helps.

    • Proposed as answer by insy09 Tuesday, November 25, 2008 10:28 AM
    Tuesday, November 25, 2008 10:28 AM
  • This is also what you get if SQL Server is not running when you run stsadm.

    Peter


    Peter
    • Proposed as answer by David Lent Monday, March 29, 2010 8:47 PM
    Wednesday, February 24, 2010 1:47 PM
  • You need to run the command prompt in administrator mode.  Right-click the command prompt and choose "Run as administrator."  You may be asked for an administrator password at this point.
    • Proposed as answer by David Lent Monday, March 29, 2010 8:47 PM
    Monday, March 29, 2010 8:47 PM
  • Tried all of the above.  I have 3 servers.  I can addsolution on 2, but the third I can retract and delete the solution from the comand prompt, but I cannot add a solution from the command prompt without getting the error

     

    I am the admin on the server and the site administrator for the site collection.  I have all the rights specified in all the baove posts, but I still get the error on the add

     

    Anyone have any other ideas?  It has to be permissions because no one else has the issue

    Friday, June 11, 2010 8:31 PM
  • I hit this as well and tried much of the above... Mine worked for one account, but another. I was able to make the following work, although not everything may be required:

    1) Make user farm admin

    2) Make user local admin

    3) Add user to WSS_RESTRICTED and WSS_ADMIN and WSS_WPG groups

    4) Add db_admin rights for the user all Sharepoint DBs. Ultimately, it was failing until I grants rights to the WSS Admin DB.

    5) Ran the stsadm command in a command shell which is running 'as administrator'

    -Todd

     

    Thursday, July 8, 2010 11:17 PM
  • Check the Event log. It will describe the problem in more details. My problem was: SQL Database 'SharePoint_AdminContent_30ed1d7c-69d5-459e-bd78-a217165eaaaa' on SQL Server instance 'sqlserver' not found. Additional error information from SQL Server is included below. Cannot open database "SharePoint_AdminContent_30ed1d7c-69d5-459e-bd78-a217165eaaaa" requested by the login. The login failed. Login failed for user 'N/A'. (N/A was the user I am running the stsadm as) The solution here is the permissions to the mentioned database on the database server.
    Thursday, October 28, 2010 12:09 PM
  • You need to run the command prompt in administrator mode.  Right-click the command prompt and choose "Run as administrator."  You may be asked for an administrator password at this point.
    • Proposed As Answer byDavid Lent Monday, March 29, 2010 8:47 PM

    This solution worked for me.

    cheers,

    Thanks David.


    Thanks in advance!!
    Wednesday, November 3, 2010 4:26 PM
  • Hi Team,

    Thanks for your this post. It really help me to resolved my issue 


    Thanks & Regards, Brijesh Shah
    Tuesday, November 15, 2011 6:52 AM
  • Hi,

    I am also facing the same issue and I have complete full permissions on the DB.

    I am also the Farm Administrator.

    I am able to deploy, retract, and remove few of the wsp packages in my project but I am getting same issue "Object reference not set to an instance of an object while retracting and removing the solution from CA,Powershell as well as Visualstudio with other wsp's in the same project.

    Any help would be appreciated.

    Thanks

    Gayatri


    Friday, March 30, 2012 1:31 PM