YAFLogo

johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
9 years ago
Download the latest version from github and install it.

When I click on "Admin" link on top of page, I get this server error:


Server Error in '/' Application.

Invalid object name 'sysfiles'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'sysfiles'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SqlException (0x80131904): Invalid object name 'sysfiles'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +1753986
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5296058
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +558
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +1682
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +59
System.Data.SqlClient.SqlDataReader.get_MetaData() +90
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +365
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite) +1379
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +175
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +53
System.Data.SqlClient.SqlCommand.ExecuteScalar() +149
YAF.Types.Interfaces.Data.IDbAccessExtensions.b__4(IDbCommand c) in d:\YAFNET-master\yafsrc\YAF.Types\Interfaces\Data\IDbAccessExtensions.cs:168
YAF.Core.Data.DbAccessBase.Execute(Func`2 execFunc, IDbCommand cmd, IDbTransaction dbTransaction) in d:\YAFNET-master\yafsrc\YAF.Core\Data\DbAccessBase.cs:133
YAF.Types.Interfaces.Data.IDbAccessExtensions.ExecuteScalar(IDbAccess dbAccess, IDbCommand cmd, IDbTransaction dbTransaction) in d:\YAFNET-master\yafsrc\YAF.Types\Interfaces\Data\IDbAccessExtensions.cs:168
YAF.Data.MsSql.Functions.MsSqlSpecificFunctions.DBSize(IDbAccess dbAccess) in d:\YAFNET-master\yafsrc\YAF.Data.MsSql\Functions\MsSqlSpecificFunctions.cs:18

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +92
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +108
YAF.Data.MsSql.BaseReflectedSpecificFunctions.RunOperation(SqlConnection sqlConnection, IDbTransaction dbTransaction, DbFunctionType dbfunctionType, String operationName, IEnumerable`1 parameters, Object& result) in d:\YAFNET-master\yafsrc\YAF.Data.MsSql\Functions\BaseReflectedSpecificFunctions.cs:114
YAF.Data.MsSql.BaseMsSqlFunction.Execute(DbFunctionType dbfunctionType, String operationName, IEnumerable`1 parameters, Object& result, IDbTransaction transaction) in d:\YAFNET-master\yafsrc\YAF.Data.MsSql\BaseMsSqlFunction.cs:141
YAF.Core.Data.DynamicDbFunction.DbFunctionExecute(DbFunctionType functionType, InvokeMemberBinder binder, IList`1 parameters, Func`2 executeDb, Object& result) in d:\YAFNET-master\yafsrc\YAF.Core\Data\DynamicDbFunction.cs:318
YAF.Core.Data.DynamicDbFunction.InvokeScalar(InvokeMemberBinder binder, Object[] args, Object& result) in d:\YAFNET-master\yafsrc\YAF.Core\Data\DynamicDbFunction.cs:468
YAF.Core.Data.TryInvokeMemberProxy.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result) in d:\YAFNET-master\yafsrc\YAF.Core\Data\TryInvokeMemberProxy.cs:89
CallSite.Target(Closure , CallSite , Object ) +148
YAF.Core.Helpers.DbFunctionHelper.b__3(Object s) in d:\YAFNET-master\yafsrc\YAF.Core\Helpers\DbFunctionHelpers.cs:45
CallSite.Target(Closure , CallSite , Func`2 , Object ) +81
YAF.Types.Interfaces.Data.IDbFunctionExtensions.GetScalar(IDbFunction dbFunction, Func`2 function) in d:\YAFNET-master\yafsrc\YAF.Types\Interfaces\Data\IDbFunctionExtensions.cs:129
YAF.Core.Helpers.DbFunctionHelper.b__2(IDbFunction f) in d:\YAFNET-master\yafsrc\YAF.Core\Helpers\DbFunctionHelpers.cs:45
YAF.Core.Helpers.DbFunctionHelper.ValidateAndExecute(IDbFunction dbFunction, String operationName, Func`2 func) in d:\YAFNET-master\yafsrc\YAF.Core\Helpers\DbFunctionHelpers.cs:38
YAF.Core.Helpers.DbFunctionHelper.GetDBSize(IDbFunction dbFunction) in d:\YAFNET-master\yafsrc\YAF.Core\Helpers\DbFunctionHelpers.cs:45
YAF.Pages.Admin.admin.BindData() +1406
YAF.Pages.Admin.admin.Page_Load(Object sender, EventArgs e) +233
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +92
System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.19064


This is for Azure. BTW, earlier YAF version was working fine.

Also "Host" link is working fine.
Sponsor

bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
9 years ago
Should be sys.sysfiles instead of sysfiles in MsSqlSpecificFunctions.cs.
johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
9 years ago
I updated the .cs file, built it. When I clicked on Admin link, I got similar error message


Server Error in '/' Application.

Invalid object name 'sys.sysfiles'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'sys.sysfiles'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SqlException (0x80131904): Invalid object name 'sys.sysfiles'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +1753986
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5296058
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +558
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +1682
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +59
System.Data.SqlClient.SqlDataReader.get_MetaData() +90
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +365
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite) +1379
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +175
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +53
System.Data.SqlClient.SqlCommand.ExecuteScalar() +149
YAF.Types.Interfaces.Data.IDbAccessExtensions.b__4(IDbCommand c) in d:\YAFNET-master\yafsrc\YAF.Types\Interfaces\Data\IDbAccessExtensions.cs:168
YAF.Core.Data.DbAccessBase.Execute(Func`2 execFunc, IDbCommand cmd, IDbTransaction dbTransaction) in d:\YAFNET-master\yafsrc\YAF.Core\Data\DbAccessBase.cs:133
YAF.Types.Interfaces.Data.IDbAccessExtensions.ExecuteScalar(IDbAccess dbAccess, IDbCommand cmd, IDbTransaction dbTransaction) in d:\YAFNET-master\yafsrc\YAF.Types\Interfaces\Data\IDbAccessExtensions.cs:168
YAF.Data.MsSql.Functions.MsSqlSpecificFunctions.DBSize(IDbAccess dbAccess) in d:\YAFNET-master\yafsrc\YAF.Data.MsSql\Functions\MsSqlSpecificFunctions.cs:18

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +92
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +108
YAF.Data.MsSql.BaseReflectedSpecificFunctions.RunOperation(SqlConnection sqlConnection, IDbTransaction dbTransaction, DbFunctionType dbfunctionType, String operationName, IEnumerable`1 parameters, Object& result) in d:\YAFNET-master\yafsrc\YAF.Data.MsSql\Functions\BaseReflectedSpecificFunctions.cs:114
YAF.Data.MsSql.BaseMsSqlFunction.Execute(DbFunctionType dbfunctionType, String operationName, IEnumerable`1 parameters, Object& result, IDbTransaction transaction) in d:\YAFNET-master\yafsrc\YAF.Data.MsSql\BaseMsSqlFunction.cs:141
YAF.Core.Data.DynamicDbFunction.DbFunctionExecute(DbFunctionType functionType, InvokeMemberBinder binder, IList`1 parameters, Func`2 executeDb, Object& result) in d:\YAFNET-master\yafsrc\YAF.Core\Data\DynamicDbFunction.cs:318
YAF.Core.Data.DynamicDbFunction.InvokeScalar(InvokeMemberBinder binder, Object[] args, Object& result) in d:\YAFNET-master\yafsrc\YAF.Core\Data\DynamicDbFunction.cs:468
YAF.Core.Data.TryInvokeMemberProxy.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result) in d:\YAFNET-master\yafsrc\YAF.Core\Data\TryInvokeMemberProxy.cs:89
CallSite.Target(Closure , CallSite , Object ) +148
System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +432
YAF.Core.Helpers.DbFunctionHelper.b__3(Object s) in d:\YAFNET-master\yafsrc\YAF.Core\Helpers\DbFunctionHelpers.cs:45
CallSite.Target(Closure , CallSite , Func`2 , Object ) +81
System.Dynamic.UpdateDelegates.UpdateAndExecute2(CallSite site, T0 arg0, T1 arg1) +685
YAF.Types.Interfaces.Data.IDbFunctionExtensions.GetScalar(IDbFunction dbFunction, Func`2 function) in d:\YAFNET-master\yafsrc\YAF.Types\Interfaces\Data\IDbFunctionExtensions.cs:129
YAF.Core.Helpers.DbFunctionHelper.b__2(IDbFunction f) in d:\YAFNET-master\yafsrc\YAF.Core\Helpers\DbFunctionHelpers.cs:45
YAF.Core.Helpers.DbFunctionHelper.ValidateAndExecute(IDbFunction dbFunction, String operationName, Func`2 func) in d:\YAFNET-master\yafsrc\YAF.Core\Helpers\DbFunctionHelpers.cs:38
YAF.Core.Helpers.DbFunctionHelper.GetDBSize(IDbFunction dbFunction) in d:\YAFNET-master\yafsrc\YAF.Core\Helpers\DbFunctionHelpers.cs:45
YAF.Pages.Admin.admin.BindData() +1401
YAF.Pages.Admin.admin.Page_Load(Object sender, EventArgs e) +231
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +92
System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.19064


BTW, It seems sys.sysfiles is deprecated.

http://technet.microsoft.com/en-us/library/ms178009.aspx 
johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
9 years ago
I just noticed the function calculated DB size. I forgot to mention, in SQL azure, previously it always said "unable to get DB size".

http://tracker.phpbb.com/browse/PHPBB3-10796 
johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
9 years ago
http://stackoverflow.com/questions/13296150/calculate-size-of-sql-azure-database 

I changed the code in MsSqlSpecificFunctions.cs to:

SELECT (SUM(cast(reserved_page_count as integer)) * 8192) / 1024 / 1024 FROM sys.dm_db_partition_stats

Now it is showing database size as 21MB in Admin panel. However in Azure website panel, it shows DB size as 10.25 MB. I am not sure why there is a big difference (nearly twice size). Any idea?
bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
9 years ago
Originally Posted by: johnk 


Any idea?


This is normal because it looks at various things. Try this.

select sum(cast(size as integer))/128 from sys.dm_db_partition_stats
sys.database_files.

I don't think it matters in the case how db engine estimates it:wink: . If you have 20Mb and 200Mb - this matters.
johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
9 years ago
Quote:

This is normal because it looks at various things. Try this.



I am guessing it includes logs too.

Quote:

select sum(cast(size as integer))/128 from sys.dm_db_partition_stats



Error: Invalid column name 'size'.

Quote:

select sum(cast(size as integer))/128 from sys.database_files.



Error: Invalid object name 'sys.database_files'.

Quote:

I don't think it matters in the case how db engine estimates it:wink: . If you have 20Mb and 200Mb - this matters.



Could you add the code (I wrote in previous post) in the master branch. Else azure users will get server error when they click on the admin link. For some reason try and catch is not working.
bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
9 years ago
Originally Posted by: johnk 


sys.dm_db_partition_stats should be visible to Azure. Check permisions.
I can't apply it because ti should be tested for all cases. YAF doesn't support Azure oficially, but I already changed almost everything possible to simplify Azure usage.


johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
9 years ago

Quote:

sys.dm_db_partition_stats should be visible to Azure. Check permisions.



According to official document, size is not a valid column.

http://technet.microsoft.com/en-us/library/ms187737.aspx 

Quote:

I already changed almost everything possible to simplify Azure usage.


Thank you for that. I was able to upgrade to RC1 only after you made everything work for azure. :)
bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
9 years ago
Here we are
SELECT (SUM(reserved_page_count)*8192)/1024000 AS [MB]
FROM sys.dm_db_partition_stats

This should work fine for SQL Server 2005 and more + Azure
The pagesize is unchageable 8192 and we are having a good estimate.
I don't know Azure page size but I guess it can be 16К and you can see a 2 times more value.
johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
9 years ago
Originally Posted by: bbobb 

Here we are
SELECT (SUM(reserved_page_count)*8192)/1024000 AS [MB]
FROM sys.dm_db_partition_stats



LOL, that is the exact SQL code I write in blog post above:
http://forum.yetanotherforum.net/yaf_postsm61198_-SQL-Error--Unable-to-load-admin-control-panel.aspx#post61198 

I had to leave out the alias (as MB); else it gives a "unable to fetch DB size" error. The code I posted above was the only thing that would work.

Quote:

This should work fine for SQL Server 2005 and more + Azure
The pagesize is unchageable 8192 and we are having a good estimate.
I don't know Azure page size but I guess it can be 16К and you can see a 2 times more value.



http://blogs.msdn.com/b/wayneb/archive/2012/10/23/understanding-windows-azure-sql-database-size.aspx 

The azure page size is 8192 bytes per page. It also explains the overheads. :)

YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button