An error occurred while starting the application.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Hello there. I'm making a new website. But there is a problem on my site. I get this error on the site when I install any plugin "An error occurred while starting the application.
.NET Core 4.6.27414.05 X64 v4.0.0.0 | Microsoft.AspNetCore.Hosting version 2.2.0-rtm-35687 | Microsoft Windows 10.0.14393 | Need help? ".

So I can't improve. Why does it do this? Do you have a solution for this?
3 years ago
Hey kerimakarsu

Which version of nopCommerce?  How hosted? Windows IIS, Azure webapp, Linux etc? Does your website configuration have WRITE permission to the Plugins folder on the file system?

Jon

kerimakarsu wrote:
Hello there. I'm making a new website. But there is a problem on my site. I get this error on the site when I install any plugin "An error occurred while starting the application.
.NET Core 4.6.27414.05 X64 v4.0.0.0 | Microsoft.AspNetCore.Hosting version 2.2.0-rtm-35687 | Microsoft Windows 10.0.14393 | Need help? ".

So I can't improve. Why does it do this? Do you have a solution for this?
3 years ago
JonQuick wrote:
Hey kerimakarsu

Which version of nopCommerce?  How hosted? Windows IIS, Azure webapp, Linux etc? Does your website configuration have WRITE permission to the Plugins folder on the file system?

Jon

Hello there. I'm making a new website. But there is a problem on my site. I get this error on the site when I install any plugin "An error occurred while starting the application.
.NET Core 4.6.27414.05 X64 v4.0.0.0 | Microsoft.AspNetCore.Hosting version 2.2.0-rtm-35687 | Microsoft Windows 10.0.14393 | Need help? ".

So I can't improve. Why does it do this? Do you have a solution for this?



info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
      Entity Framework Core 2.2.4-servicing-10062 initialized 'NopObjectContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: MaxPoolSize=128 using lazy-loading proxies
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (78ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT [t].[Id], [t].[Enabled], [t].[LastEndUtc], [t].[LastStartUtc], [t].[LastSuccessUtc], [t].[Name], [t].[Seconds], [t].[StopOnError], [t].[Type]
      FROM [ScheduleTask] AS [t]
      WHERE [t].[Enabled] = 1
      ORDER BY [t].[Seconds] DESC
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (4ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT [s].[Id], [s].[CompanyAddress], [s].[CompanyName], [s].[CompanyPhoneNumber], [s].[CompanyVat], [s].[DefaultLanguageId], [s].[DisplayOrder], [s].[Hosts], [s].[Name], [s].[SslEnabled], [s].[Url]
      FROM [Store] AS [s]
      ORDER BY [s].[DisplayOrder], [s].[Id]
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (7ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT [s].[Id], [s].[Name], [s].[StoreId], [s].[Value]
      FROM [Setting] AS [s]
      ORDER BY [s].[Name], [s].[StoreId]
info: System.Net.Http.HttpClient.default.LogicalHandler[100]
      Start processing HTTP request POST http://themes.brooklyn2.nop-templates.com/scheduletask/runtask
info: System.Net.Http.HttpClient.default.LogicalHandler[100]
      Start processing HTTP request POST http://themes.brooklyn2.nop-templates.com/scheduletask/runtask
info: System.Net.Http.HttpClient.default.LogicalHandler[100]
      Start processing HTTP request POST http://themes.brooklyn2.nop-templates.com/scheduletask/runtask
info: System.Net.Http.HttpClient.default.LogicalHandler[100]
      Start processing HTTP request POST http://themes.brooklyn2.nop-templates.com/scheduletask/runtask
info: System.Net.Http.HttpClient.default.ClientHandler[100]
      Sending HTTP request POST http://themes.brooklyn2.nop-templates.com/scheduletask/runtask
info: System.Net.Http.HttpClient.default.ClientHandler[100]
      Sending HTTP request POST http://themes.brooklyn2.nop-templates.com/scheduletask/runtask
info: System.Net.Http.HttpClient.default.ClientHandler[100]
      Sending HTTP request POST http://themes.brooklyn2.nop-templates.com/scheduletask/runtask
info: System.Net.Http.HttpClient.default.ClientHandler[100]
      Sending HTTP request POST http://themes.brooklyn2.nop-templates.com/scheduletask/runtask
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (82ms) [Parameters=[@p0='?' (DbType = DateTime2), @p1='?' (DbType = Int32), @p2='?' (Size = 4000), @p3='?' (Size = 200), @p4='?' (DbType = Int32), @p5='?' (Size = 4000), @p6='?' (Size = 4000), @p7='?' (Size = 4000)], CommandType='Text', CommandTimeout='30']
      SET NOCOUNT ON;
      INSERT INTO [Log] ([CreatedOnUtc], [CustomerId], [FullMessage], [IpAddress], [LogLevelId], [PageUrl], [ReferrerUrl], [ShortMessage])
      VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7);
      SELECT [Id]
      FROM [Log]
      WHERE @@ROWCOUNT = 1 AND [Id] = scope_identity();
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (1ms) [Parameters=[@__get_Item_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
      SELECT TOP(1) [e].[Id], [e].[Name], [e].[StoreId], [e].[Value]
      FROM [Setting] AS [e]
      WHERE [e].[Id] = @__get_Item_0
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (1ms) [Parameters=[@p3='?' (DbType = Int32), @p0='?' (Size = 200), @p1='?' (DbType = Int32), @p2='?' (Size = 4000)], CommandType='Text', CommandTimeout='30']
      SET NOCOUNT ON;
      UPDATE [Setting] SET [Name] = @p0, [StoreId] = @p1, [Value] = @p2
      WHERE [Id] = @p3;
      SELECT @@ROWCOUNT;
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (1ms) [Parameters=[@__get_Item_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
      SELECT TOP(1) [e].[Id], [e].[Name], [e].[StoreId], [e].[Value]
      FROM [Setting] AS [e]
      WHERE [e].[Id] = @__get_Item_0
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (0ms) [Parameters=[@p3='?' (DbType = Int32), @p0='?' (Size = 200), @p1='?' (DbType = Int32), @p2='?' (Size = 4000)], CommandType='Text', CommandTimeout='30']
      SET NOCOUNT ON;
      UPDATE [Setting] SET [Name] = @p0, [StoreId] = @p1, [Value] = @p2
      WHERE [Id] = @p3;
      SELECT @@ROWCOUNT;
warn: Microsoft.EntityFrameworkCore.Model.Validation[30000]
      No type was specified for the decimal column 'AdditionalFixedCost' on entity type 'ShippingByWeightByTotalRecord'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accommodate all the values using 'HasColumnType()'.
warn: Microsoft.EntityFrameworkCore.Model.Validation[30000]
      No type was specified for the decimal column 'LowerWeightLimit' on entity type 'ShippingByWeightByTotalRecord'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accommodate all the values using 'HasColumnType()'.
warn: Microsoft.EntityFrameworkCore.Model.Validation[30000]
      No type was specified for the decimal column 'OrderSubtotalFrom' on entity type 'ShippingByWeightByTotalRecord'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accommodate all the values using 'HasColumnType()'.
warn: Microsoft.EntityFrameworkCore.Model.Validation[30000]
      No type was specified for the decimal column 'OrderSubtotalTo' on entity type 'ShippingByWeightByTotalRecord'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accommodate all the values using 'HasColumnType()'.
warn: Microsoft.EntityFrameworkCore.Model.Validation[30000]
      No type was specified for the decimal column 'PercentageRateOfSubtotal' on entity type 'ShippingByWeightByTotalRecord'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accommodate all the values using 'HasColumnType()'.
warn: Microsoft.EntityFrameworkCore.Model.Validation[30000]
      No type was specified for the decimal column 'RatePerWeightUnit' on entity type 'ShippingByWeightByTotalRecord'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accommodate all the values using 'HasColumnType()'.
warn: Microsoft.EntityFrameworkCore.Model.Validation[30000]
      No type was specified for the decimal column 'WeightFrom' on entity type 'ShippingByWeightByTotalRecord'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accommodate all the values using 'HasColumnType()'.
warn: Microsoft.EntityFrameworkCore.Model.Validation[30000]
      No type was specified for the decimal column 'WeightTo' on entity type 'ShippingByWeightByTotalRecord'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accommodate all the values using 'HasColumnType()'.
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
      Entity Framework Core 2.2.4-servicing-10062 initialized 'ShippingByWeightByTotalObjectContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: using lazy-loading proxies
fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
      Failed executing DbCommand (12ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      CREATE TABLE [ShippingByWeightByTotalRecord] (
          [Id] int NOT NULL IDENTITY,
          [StoreId] int NOT NULL,
          [WarehouseId] int NOT NULL,
          [CountryId] int NOT NULL,
          [StateProvinceId] int NOT NULL,
          [Zip] nvarchar(400) NULL,
          [ShippingMethodId] int NOT NULL,
          [WeightFrom] decimal(18,2) NOT NULL,
          [WeightTo] decimal(18,2) NOT NULL,
          [OrderSubtotalFrom] decimal(18,2) NOT NULL,
          [OrderSubtotalTo] decimal(18,2) NOT NULL,
          [AdditionalFixedCost] decimal(18,2) NOT NULL,
          [PercentageRateOfSubtotal] decimal(18,2) NOT NULL,
          [RatePerWeightUnit] decimal(18,2) NOT NULL,
          [LowerWeightLimit] decimal(18,2) NOT NULL,
          CONSTRAINT [PK_ShippingByWeightByTotalRecord] PRIMARY KEY ([Id])
      );
System.Data.SqlClient.SqlException (0x80131904): There is already an object named 'ShippingByWeightByTotalRecord' in the database.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite, String methodName)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
ClientConnectionId:5e6efaa9-31b2-4766-8aa9-b018a1282bd6
Error Number:2714,State:6,Class:16
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (1ms) [Parameters=[@__systemName_0='?' (Size = 400)], CommandType='Text', CommandTimeout='30']
      SELECT TOP(1) [c].[Id], [c].[Active], [c].[AdminComment], [c].[AffiliateId], [c].[BillingAddress_Id], [c].[CannotLoginUntilDateUtc], [c].[CreatedOnUtc], [c].[CustomerGuid], [c].[Deleted], [c].[Email], [c].[EmailToRevalidate], [c].[FailedLoginAttempts], [c].[HasShoppingCartItems], [c].[IsSystemAccount], [c].[IsTaxExempt], [c].[LastActivityDateUtc], [c].[LastIpAddress], [c].[LastLoginDateUtc], [c].[RegisteredInStoreId], [c].[RequireReLogin], [c].[ShippingAddress_Id], [c].[SystemName], [c].[Username], [c].[VendorId]
      FROM [Customer] AS [c]
      WHERE [c].[SystemName] = @__systemName_0
      ORDER BY [c].[Id]
Application startup exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.AspNetCore.Authentication.AuthenticationHttpContextExtensions.AuthenticateAsync(HttpContext context, String scheme)
   at Nop.Services.Authentication.CookieAuthenticationService.GetAuthenticatedCustomer() in C:\andrei\nopcommerce\sources\src\Libraries\Nop.Services\Authentication\CookieAuthenticationService.cs:line 101
   at Nop.Web.Framework.WebWorkContext.get_CurrentCustomer() in C:\andrei\nopcommerce\sources\src\Presentation\Nop.Web.Framework\WebWorkContext.cs:line 210
   at Nop.Web.Framework.WebWorkContext.get_WorkingLanguage() in C:\andrei\nopcommerce\sources\src\Presentation\Nop.Web.Framework\WebWorkContext.cs:line 359
   at Nop.Services.Localization.LocalizationService.GetResource(String resourceKey) in C:\andrei\nopcommerce\sources\src\Libraries\Nop.Services\Localization\LocalizationService.cs:line 311
   at Nop.Services.Plugins.PluginService.InstallPlugins() in C:\andrei\nopcommerce\sources\src\Libraries\Nop.Services\Plugins\PluginService.cs:line 439
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfiguration configuration, IHostingEnvironment hostingEnvironment) in C:\andrei\nopcommerce\sources\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ServiceCollectionExtensions.cs:line 97
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6]
      Application startup exception
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.AspNetCore.Authentication.AuthenticationHttpContextExtensions.AuthenticateAsync(HttpContext context, String scheme)
   at Nop.Services.Authentication.CookieAuthenticationService.GetAuthenticatedCustomer() in C:\andrei\nopcommerce\sources\src\Libraries\Nop.Services\Authentication\CookieAuthenticationService.cs:line 101
   at Nop.Web.Framework.WebWorkContext.get_CurrentCustomer() in C:\andrei\nopcommerce\sources\src\Presentation\Nop.Web.Framework\WebWorkContext.cs:line 210
   at Nop.Web.Framework.WebWorkContext.get_WorkingLanguage() in C:\andrei\nopcommerce\sources\src\Presentation\Nop.Web.Framework\WebWorkContext.cs:line 359
   at Nop.Services.Localization.LocalizationService.GetResource(String resourceKey) in C:\andrei\nopcommerce\sources\src\Libraries\Nop.Services\Localization\LocalizationService.cs:line 311
   at Nop.Services.Plugins.PluginService.InstallPlugins() in C:\andrei\nopcommerce\sources\src\Libraries\Nop.Services\Plugins\PluginService.cs:line 439
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfiguration configuration, IHostingEnvironment hostingEnvironment) in C:\andrei\nopcommerce\sources\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ServiceCollectionExtensions.cs:line 97
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
info: System.Net.Http.HttpClient.default.ClientHandler[101]
      Received HTTP response after 1416.1495ms - NotFound
info: System.Net.Http.HttpClient.default.ClientHandler[101]
      Received HTTP response after 1422.6664ms - NotFound
info: System.Net.Http.HttpClient.default.ClientHandler[101]
      Received HTTP response after 1424.3837ms - NotFound
info: System.Net.Http.HttpClient.default.ClientHandler[101]
      Received HTTP response after 1425.8758ms - NotFound
info: System.Net.Http.HttpClient.default.LogicalHandler[101]
      End processing HTTP request after 1443.4824ms - NotFound
info: System.Net.Http.HttpClient.default.LogicalHandler[101]
      End processing HTTP request after 1443.4573ms - NotFound
info: System.Net.Http.HttpClient.default.LogicalHandler[101]
      End processing HTTP request after 1444.1641ms - NotFound
info: System.Net.Http.HttpClient.default.LogicalHandler[101]
      End processing HTTP request after 1445.2255ms - NotFound
Hosting environment: Production
Content root path: C:\Inetpub\vhosts\cagdasofis.com\httpdocs
Now listening on: http://127.0.0.1:45404
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.cagdasofis.com/  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 178.8936ms 500 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://www.cagdasofis.com/favicon.ico  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.4048ms 500 text/html; charset=utf-8

this is log file
3 years ago
Which version of nopCommerce?
Did you Install OK and get the website to run ?

kerimakarsu wrote:

System.Data.SqlClient.SqlException (0x80131904): There is already an object named 'ShippingByWeightByTotalRecord' in the database.


Looks like you tried to install Shipping.FixedByWeightByTotal Plugin and the table was already installed in the Database.
3 years ago
Yidna wrote:
Which version of nopCommerce?
Did you Install OK and get the website to run ?


System.Data.SqlClient.SqlException (0x80131904): There is already an object named 'ShippingByWeightByTotalRecord' in the database.

Looks like you tried to install Shipping.FixedByWeightByTotal Plugin and the table was already installed in the Database.


4.20 version. I literally loaded the site. Not just for this plugin. Valid for all other plugins. It does not accept any plugins. It keeps giving the same error.
3 years ago
Can you examine the file \App_Data\plugins.json

in the "PluginNamesToInstall": [] section is Shipping.FixedByWeightByTotal listed to Install on restart? If so, remove the entry (being very careful to keep the correct structure of the Json)



kerimakarsu wrote:
Which version of nopCommerce?
Did you Install OK and get the website to run ?


System.Data.SqlClient.SqlException (0x80131904): There is already an object named 'ShippingByWeightByTotalRecord' in the database.

Looks like you tried to install Shipping.FixedByWeightByTotal Plugin and the table was already installed in the Database.

4.20 version. I literally loaded the site. Not just for this plugin. Valid for all other plugins. It does not accept any plugins. It keeps giving the same error.
3 years ago
JonQuick wrote:
Can you examine the file \App_Data\plugins.json

in the "PluginNamesToInstall": [] section is Shipping.FixedByWeightByTotal listed to Install on restart? If so, remove the entry (being very careful to keep the correct structure of the Json)



Which version of nopCommerce?
Did you Install OK and get the website to run ?


System.Data.SqlClient.SqlException (0x80131904): There is already an object named 'ShippingByWeightByTotalRecord' in the database.

Looks like you tried to install Shipping.FixedByWeightByTotal Plugin and the table was already installed in the Database.

4.20 version. I literally loaded the site. Not just for this plugin. Valid for all other plugins. It does not accept any plugins. It keeps giving the same error.


I'm just editing a site. I have no information about the software. Have you ever had this problem before? Can you give me a direct or instructive document about this? Because I don't understand this much more than they say.
3 years ago
Hi kerimakarsu

It looks like something strange has happened with the Shipping.FixedByWeightByTotal plugin - so when the application starts, plugin  is trying to install (and create it's db table), and this has already been done (the DB table already exists).

The only way to correct this situation is to either:

1) edit the App_Data/plugins.json file  (as previously mentioned) to stop plugin trying to install

or 2)  

BACKUP YOUR DATABASE, then

Manually delete the dbo.ShippingByWeightByTotalRecord table from the database ######## ONLY DO THIS IF YOUR HAVE NOT CONFIGURED SHIPPING PREVIOUS.. I am assuming this is a clean install and you are starting from scratch ################

with option 2: the plugin should then install correctly and re-create the dbo.ShippingByWeightByTotalRecord  table automatically.

Once you are passed this issue, the store should function as normal and allow install of additional plugins from the front-end

kerimakarsu wrote:

I'm just editing a site. I have no information about the software. Have you ever had this problem before? Can you give me a direct or instructive document about this? Because I don't understand this much more than they say.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.