Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Suggested answer

System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'OrganizationLifecycle'

Posted on by 70

Hello Everyone,

After the last hotfix update 9.1.4 , this error always occures in Event Viewer logs.

Does anyone knows this entity or table? Or the solution?

Thank You

  • Suggested answer
    stoker Profile Picture
    stoker 50 on at
    RE: System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'OrganizationLifecycle'

    Yes, I'm pretty sure they are keeping a close eye on the community forum..

    9.1.5 removed the errors from the event viewer but query was still being sent to database. 9.1.6 removed the query from being sent to database (which improved the performance)

    9.1.6 is still not back to 9.0 response times but much better

  • PhilipK Profile Picture
    PhilipK 602 on at
    RE: System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'OrganizationLifecycle'

    Haven't got the time to install it yet but the last Service Update 1.5 for 9.1 on-prem seems to address both the Index job along with the "visual" errors surrounding ScaleGroup and OrginzationLifecycle "error".

    Might be an indication that issue's we post in this community forum actually reaches into the Dynamics team responsible for the on-premise package.

  • stoker Profile Picture
    stoker 50 on at
    RE: System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'OrganizationLifecycle'

    Thanks for the reply PhilipK .. yes we have a meeting with MS support this week. We will wait to make any unsupported changes. And yes we run a Index maintenance job separately already so this is more than likely not an issue for us either. Our CPU/Memory load on our CRM and DB servers seem to be the same as 9.0. It's our ASP.NET SOAP Web service layer that calls Dynamics CRM through the organization service proxy where the performance issue is seems to be, responses can be twice as slow..

  • PhilipK Profile Picture
    PhilipK 602 on at
    RE: System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'OrganizationLifecycle'

    stoker  Remember it's not officially supported, to edit Dynamics DB's directly without them explictly saying so(via case, technote e.g.), so you do this at your own risk.
    In SQL Management Studio, go to the Org_MSCRM db and edit the Stored Procedur p.ReindexAll and remove the following section at the beginning:

    	if (@StatsMaintenanceinBG=1)
    	begin
    		Print 'starting statistics maintenance';
    	    retry:
    		declare @avg_cpu_percent int
    		declare @avg_data_io_percent int
    		declare @avg_log_write_percent  int
    		declare @starttime datetime
    		select @starttime = getdate()
    		select top 1 @avg_cpu_percent=avg_cpu_percent,@avg_data_io_percent=avg_data_io_percent,@avg_log_write_percent=avg_log_write_percent from sys.dm_db_resource_stats 
    		order by end_time desc
    		while (@avg_cpu_percent 500 (rows/100.00)*25 or modification_counter >sqrt (700 * rows )  ) and type='U'
    			order by sp.rows asc 
    			if (@@rowcount>0)
    			begin
    				SET @Statement = 'UPDATE STATISTICS '   '['   @Schema   '].'   '['   @tableName   ']'   '['   @StatName   ']'  ' WITH FULLSCAN'
    				PRINT @Statement
    				begin TRY    
    					exec sp_executesql @Statement
    				End try
    				begin catch   
    					declare @error int
    					-- Save the @@error values in local variable before it is cleared. 
    					SET @error = @@error
    					--PRINT 'There is exception moving further ';  -- add error details
    					PRINT @error
    					if (@error=601)
    						begin
    							SET @Statement = 'UPDATE STATISTICS '   '['   @Schema   '].'   '['   @tableName   ']'   '['   @StatName   ']' 
    							exec sp_executesql @Statement
    						end
    				End catch; 
    			
    				print '--done'
    			end
    			else
    			begin
    				Print 'No stats need update waiting for 2  minutes'
    				WAITFOR DELAY '00:02'; 
    			end
    			 
    
    			select top 1 @avg_cpu_percent=avg_cpu_percent,@avg_data_io_percent=avg_data_io_percent,@avg_log_write_percent=avg_log_write_percent from sys.dm_db_resource_stats 
    			order by end_time desc
    		end
    		print @avg_cpu_percent 
    		print @avg_data_io_percent 
    		print @avg_log_write_percent
    		Print 'Resource usage is high so waiting for 2 minutes before retrying'
    		WAITFOR DELAY '00:02'; 
    		if (datediff(hh,@starttime,getdate())

    You will see an error on 24h basis where the async service fails to run this job calling p.ReindeAll stating that the Table: "sys.dm_db_resource_stats" doesn't exist..
    I compared this to previous versions of Dynamics and p.ReindexAll did not have this.

    But with the above said, It's quite common to run Index/statistics maintenance separately from Dynamics "built-in" job with AsyncService.

    Best regards. /Philip

  • stoker Profile Picture
    stoker 50 on at
    RE: System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'OrganizationLifecycle'

    Correct link: community.dynamics.com/.../dynamics-on-prem-organization-upgrade-to-9-1-3-11-performance-issue

  • stoker Profile Picture
    stoker 50 on at
    RE: System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'OrganizationLifecycle'

    We suspect that the clogging up of the event log is affecting performance a lot, our organisationservice is much slower to respond, we are also getting a sandbox workerprocess error: https://community.dynamics.com/365/f/dynamics-365-general-forum/361790/dynamics-365-9-1-on-premise-update---release-data 

    You mentioned you fixed the ReIndex(p.reindexall) issue. How? 

  • RE: System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'OrganizationLifecycle'

    I am having the same issue.  Also, I can't login with the plugin registration tool, App For Outlook, XRMtoolkit or InsideView.  It throws a HTTP 500 error (Server Error) in Fiddler.  I have had a case open with Microsoft for about two weeks so hopefully I get a solution soon.

  • PhilipK Profile Picture
    PhilipK 602 on at
    RE: System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'OrganizationLifecycle'

    The two variants of these errors: "ScaleGroup" along with "OrganizationLifecycle" came with the upgrade to 9.1.

    My conclusion to those is that they are leftover code from "Online" during their building/packaging for On-prem.

    I cannot see that they are causing ny issues thou more than clogging the Eventlog..

    Another example of functions that hasn't been fully "rewritten" for On-prem is the MS built in ReIndex(p.reindexall) that isn't working with the 9.1 release which also reference a table that doesn't exist in the 9.1 on-prem release... This one was fixable thou but the other two I believe are within the code.

    But tl:dr your not the only one having seeing these errors.

    Best regards. /Philip

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'OrganizationLifecycle'

    Hi,

    Have you tried to update again, if it still does not work, you can roll back to the previous version:

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Frank Gong

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans