Error occurred in deployment step ‘Activate Features’ Sharepoint 2010

This error cause by Visual Studio’s default deployment step configuration because it use the -local option when deploying…. thats why it dont create timer job to deploy on other server…

You can fix it by creating your own deployment step or use stsadm command and creating a batch file like me.

For more info for creating your own deployment steps:
http://msdn.microsoft.com/en-us/library/ee256698.aspx

You should consider fallowing advices:

1) As farm deployment to multiple servers requires a timer job you will need to pause the deployment steps and wait for the timer job to complete (which will no doubt require a constant poll of the timer job status to check whether it has completed or not)

2) Make sure you account for the timer job completing but the solution failing it’s deployment – replying solely on the timer job status will not be a sure fire way of determining whether the solution has actually deployed succesfully

3) Ensure that the account performing the VS Deloyment has enough rights to create the timer job and deploy cross farm
Resources:
http://www.go4answers.com/Example/error-occurred-deployment-step-32423.aspx

Here is an example deployment cmd

@echo Deploying NSF2010 solution
 
@set PATH=C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN;%PATH%
 
@if "%1"=="" (goto invalidParameters) 
 
stsadm -o deactivatefeature -name NSFBase_NSFBase -url %1 -force
stsadm -o deactivatefeature -name NSFBase_NSFErrorModuleFeature -url %1 -force
 
stsadm -o uninstallfeature -name NSFBase_NSFBase -force
stsadm -o uninstallfeature -name NSFBase_NSFErrorModuleFeature -force
 
stsadm -o retractsolution -name NSFBase.wsp -immediate -url %1
stsadm -o execadmsvcjobs
stsadm -o deletesolution -name NSFBase.wsp -override
 
stsadm -o addsolution -filename NSFBase.wsp
stsadm -o deploysolution -name NSFBase.wsp -immediate -allowgacdeployment -force -url %1
stsadm -o execadmsvcjobs
 
stsadm -o installfeature -name NSFBase_NSFBase -force
stsadm -o installfeature -name NSFBase_NSFErrorModuleFeature -force
 
stsadm -o activatefeature -name NSFBase_NSFBase -url %1
stsadm -o activatefeature -name NSFBase_NSFErrorModuleFeature -url %1
 
@goto endOfBatch
 
:invalidParameters
	@echo Please call with the correct parameters.
	@echo The correct syntax of this command is:
	@echo Deploy [siteurl]	
 
:endOfBatch

Usage:

run cmd  with administrative rights then type

deploy [http://your site url:port]

 

Happy Codding.

Advertisements

Administrative service for this server is not enabled when deploy

Full error is:

The timer job for this operation has been created, but it will fail because the administrative service for this server is not enabled. If the timer job is scheduled to run at a later time, you can run the jobs all at once using stsadm.exe -o execadmsvcjobs. To avoid this problem in the future, enable the Windows SharePoint Services administrative service, or run your operation through the STSADM.exe command line utility.

Here is the solution :

Go to Start > Run and Type services.msc

Now in Services window select “SharePoint 2010 Administration”Right click and start

Thats it.

Sharepoint 2010 Access Denied when modifing web.config with ApplyWebConfigModifications()

Ok i accept this problem is one of my favorite. After 3 hours finally i found a solution .Let me describe the error first. I have a feature receiver class which makes web.config modifications but SPWebApplication.ApplyWebConfigModifications() method cause an access denied error in activation process.Here is my code :

public override void FeatureActivated(SPFeatureReceiverProperties properties)

{

bool bApplyChanges = ApplyWebConfigMods(properties);

SPSite currentSite = properties.Feature.Parent as SPSite;

if (bApplyChanges)

{

SPWebApplication currentWebApp = currentSite.WebApplication;

string sClassName = typeof(NSF.Modules.ErrorModule).FullName;

SPWebConfigModification moduleEntry = addHttpModule(“NFSErrorModule”,

“NFSErrorModule”, PreConditions.integratedMode, sClassName, 1);

currentWebApp.WebConfigModifications.Add(moduleEntry);

//currentWebApp.WebService.ApplyWebConfigModifications();

SPFarm.Local.Services.GetValue<SPWebService>().ApplyWebConfigModifications();

currentWebApp.Update();

}

}

First i changed currentWebApp.WebService.ApplyWebConfigModifications()  to SPFarm.Local.Services.GetValue<SPWebService>().ApplyWebConfigModifications();

Secondly i gave permission read/write Network Service user which is my apppool identity for wss folder where web.config in it.

Third I ran powershell commadlet that change RemoteAdministratorAccessDenied propterty to false . i found it in below url
http://unclepaul84.blogspot.com/2010/06/sppersistedobject-xxxxxxxxxxx-could-not.html

function Set-RemoteAdministratorAccessDenied-False(){ # load sharepoint api libs [System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”) > $null [System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint.Administration”) > $null
# get content web service $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService  # turn off remote administration security $contentService.RemoteAdministratorAccessDenied = $false  # update the web service $contentService.Update()  }

For more info:
http://stefvanhooijdonk.com/2010/08/02/custom-spjobdefinition-and-access-denied-error/
http://blogs.msdn.com/b/navdeepm/archive/2010/09/15/sharepoint-2010-adding-nested-web-config-entries-using-the-spwebconfigmodification.aspx

and now its ok.

by the way default value of RemoteAdministratorAccessDenied property is totally sucking idea.And so shouldnt be someone code it with throwing explanatory exception ?

Have a nice codding…

Sharepoint 2007 & 2010 Execution Timeout

Sometimes your code needs  time to execute and sharepoint throw an error about Timeout .  here is the solution:

Add this config line to your web.config.

<httpRuntime maxRequestLength=”51200″ executionTimeout=”1200″/>

MSDN say for executionTimeout : Optional Int32 attribute.Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.

This time-out applies only if the debug attribute in the compilation element is False. If the debug attribute is True, to help avoiding application shut-down while you are debugging, do not set this time-out to a large value.

The default is 110 seconds. If you set executionTimeout 1200 means 20 minutes.

Here’s the complete syntax for this tag:

<httpRuntime executionTimeout=”seconds”
maxRequestLength=”kbytes”
minFreeThreads=”numberOfThreads”
minLocalRequestFreeThreads=”numberOfThreads”
appRequestQueueLimit=”numberOfRequests”
useFullyQualifiedRedirectUrl=”true|false”  />

This time-out applies only if the debug attribute in the compilation element is False. when set to “debug=true” mode, the runtime will ignore the timeout setting.

Important note: If you are working with application pages in Layouts folder you should change web.config of this folder not your application folder.

If you want to use this attribute for one page your config should be like this

<location path=”MyPages/TestPage.aspx”>
<system.web>
<httpRuntime
executionTimeout=”1200″
maxRequestLength=”51200″ />
</system.web>
</location>

Happy tips..

HTTP 500 – Internal server error page Sharepoint 2007

You can get more detailed error open debug functionality in web config

  • In the <system.web> tag, locate the <customErrors mode=”On”> tag and change it to <customErrors mode=”Off”> to see the ASP.NET exception when an error occurs instead of being redirected to the error page.
  • In the <SharePoint> tag, locate the <SafeMode MaxControls=”50″ CallStack=”false”/> tag and change it to <SafeMode MaxControls=”50″ CallStack=”true”/>. This causes the ASP.NET error message to display with stack trace information
  • In my case error caused by Language pack . You should check your server version and service packs also .

    See :

    http://blog.bugrapostaci.com/2010/10/21/sharepoint-2007-language-pack-service-pack-order/

    See you now.

    Sharepoint 2007 Language Pack & service pack order

    Language packs enable site owners and site collection administrators to create SharePoint sites and site collections in multiple languages without requiring separate installations of Microsoft Office SharePoint Server 2007

    You must install the Windows SharePoint Services 3.0 language packs before you install the Office SharePoint Server 2007 language packs.
    You must install the language packs in the correct order. The correct order is as follows:

    1.Windows SharePoint Services 3.0 language pack
    2.Windows SharePoint Services 3.0 SP1 or SP2 language pack
    3.Office SharePoint Server 2007 language pack
    4.Office SharePoint Server 2007 SP1 or SP2 language pack

     

    Important Notes:

    • You must be a member of the Administrators group on the front-end Web server to install these language files. After the language files are installed, the languages are available to all users of the computer.
    • If you are uninstalling a Microsoft Office Server product, you must uninstall all language packs before you uninstall the product.
    • If you are running Service Pack 2 (SP2) of Office SharePoint Server 2007 you only have to download the SP2 language packs. The SP2 language packs include all materials that are in the SP1 language packs.
    • You must download both the Windows SharePoint Services 3.0 language packs and the Office SharePoint Server 2007 language packs.

    For each Service Pack do the following :

    1. Disconnect users from the server farm by stopping the World Wide Web Publishing service (w3svc) on all Web servers.

    2. Begin the software installation on the server hosting the central admin web site

    3. At the end of the software update installation, the SharePoint Products and Technologies Configuration Wizard start Note:  If the wizard does not start automatically, click Start, point to All Programs, point to Administrative Tools, and then click SharePoint Products and Technologies Configuration Wizard.

    4. On the SharePoint Products and Technologies Configuration Wizard Welcome page, click Next.

    5. In the dialog box that notifies you that some services might need to be restarted during configuration, click Yes.

    6. On the Completing the SharePoint Products and Technologies Configuration Wizard page, click Next.

    7. When the dialog box about installation in a server farm appears, do not click OK. Instead, leave each server with the following dialog box displayed: – THIS IS CRITICAL TO THE SUCCESSFUL INSTALL.
    You must run Setup to install new binary files for every server in your server farm. If you have multiple servers in your server farm, run Setup and the configuration wizard on the other servers now, and then return to this server and click OK to continue.

    8. When the dialog box from the previous step is displayed on all Web servers in the server farm, use one Web server that hosts the Central Administration Web site to finalize the installation.

    9. On the server you selected in the previous step (Step 2), click OK.

    10. On the Configuration Successful page, click Finish. 11. Continue updating the remaining computers in the server farm, one at a time, by clicking OK in the dialog box.

     

     

     

    For  More Information and Resources:
    http://technet.microsoft.com/en-us/library/cc262108(office.12).aspx
    http://sharepoint.microsoft.com/Blogs/fromthefield/Lists/Posts/Post.aspx?ID=50

    Sharepoint 2010 and various Sql Server versions but which service pack ?

    SharePoint 2010 is 64-bit only. It requires Windows Server 2008 SP2 or Windows Server 2008 R2. It will not run on a Server Core installation.It requires one of these versions of x64 SQL Server:

    SQL Server 2005 Editions

    SQL Server 2005 Enterprise Edition SP3 CU3 (Build 4220) or greater
    SQL Server 2005 Standart Edition SP3 CU3 (Build 4220) or greater
    SQL Server 2005 Express Edition

    (Note: SQL Server 2005 goes out of mainstream support in April 2011)

    SQL Server 2008 Editions
    SQL Server 2008 Enterprise Edition SP1 CU2 (Build 2714) required , CU5 or later recommended (CU3 & CU4 not recommended)
    SQL Server 2008 Standart Edition SP1 CU2 (Build 2714) required , CU5 or later recommended (CU3 & CU4 not recommended)
    SQL Server 2008 Express Edition

    SQL Server 2008 R2 Enterprise & Standart & Express editions.

    How to check version of SQL Server

    -- Method 1: Retrieve complete version info, parse results in C#
    SELECT @@VERSION AS [SQLVersionInfo];
    -- Method 2: Detecting the edition and version of SQL Server from T-SQL
    IF SERVERPROPERTY('EngineEdition') = 3
        BEGIN
            PRINT 'Enterprise Edition'
            IF CONVERT(INT, CONVERT(FLOAT,
    CONVERT(VARCHAR(3), SERVERPROPERTY('productversion')))) > 9
                BEGIN
                    PRINT 'SQL Server 2008 or greater';
                    -- Do something like use data compression on an index
                END
            ELSE
                BEGIN
                    PRINT 'SQL Server 2005 or lower';
                    -- Do something like create an index in online mode
                END
        END
    ELSE
        BEGIN
            PRINT 'Standard Edition';
            -- Create an index in offline mode
        END