An error occurred while starting the application.

Sunday, December 29, 2024 1:45:25 AM
  • Posted: Friday, February 14, 2020 6:53 AM
  • 6
Hi,

there is an error when trying to access the web, suddenly cannot access the web app

An error occurred while starting the application.
.NET Core 4.6.27817.03 X64 v4.0.0.0    |   Microsoft.AspNetCore.Hosting version 2.2.0-rtm-35687    |    Linux 4.15.0-76-generic #86-Ubuntu SMP Fri Jan 17 17:24:28 UTC 2020    |   Need help?

How do I figure out what the issue is?
/var/aspnetcore/GrandNode/logs/stdout      shows nothing about the error

Thank you
0
  • Posted: Friday, February 14, 2020 8:24 AM
  • 6
nothing seems wrong in appsetings.json file too

{
  "Hosting": {
    //Set to "true" the settings below if your hosting uses a load balancer. It'll be used to determine whether the current request is HTTPS
    "UseHttpClusterHttps": true,
    "UseHttpXForwardedProto": true,

    //Use the setting below if your hosting doesn't use "X-FORWARDED-FOR" header to determine IP address.
    //In some cases server use other HTTP header. You can specify a custom HTTP header here. For example, CF-Connecting-IP, X-FORWARDED-PROTO, etc
    "ForwardedHttpHeader": "",

    //Use a reverse proxy server - more information you can find at: https://docs.microsoft.com/en-US/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-2.1
    "UseForwardedHeaders": true
  },

  "Grand": {
    //Enable if you want to see the full error in production environment. It's ignored (always enabled) in development environment
    "DisplayFullErrorStack": false,

    //Value of "Cache-Control" header value for static content
    "StaticFilesCacheControl": "public,max-age=604800",

    //Indicates whether to compress response (gzip by default)
    //You may want to disable it, for example, If you have an active IIS Dynamic Compression Module configured at the server level
    "UseResponseCompression": false,

    //This settings adds the following headers to all responses that pass
    //X-Content-Type-Options: nosniff
    //Strict-Transport-Security: max-age=31536000; includeSubDomains
    //X-Frame-Options: Deny
    //X-XSS-Protection: 1; mode=block
    //Referrer-Policy: strict-origin-when-cross-origin
    //Content-Security-Policy: object-src 'none'; form-action 'self'; frame-ancestors 'none'
    "UseDefaultSecurityHeaders": true,

    //Flag for whether to enable html minification
    "UseHtmlMinification": false,

    //Load url rewrite rules from external file AppData/UrlRewrite.xml
    "UseUrlRewrite": false,
    "UrlRewriteHttpsOptions": false,
    "UrlRewriteHttpsOptionsStatusCode": 303,
    "UrlRewriteHttpsOptionsPort": 443,
    "UrlRedirectToHttpsPermanent": false,

    //HTTP Strict Transport Security Protocol
    "UseHsts": false,

    //We recommend all ASP.NET Core web apps call HTTPS Redirection Middleware to redirect all HTTP requests to HTTPS
    "UseHttpsRedirection": false,
    "HttpsRedirectionRedirect": 308,
    "HttpsRedirectionHttpsPort": 443,

    //Enable the session-based TempData provider
    "UseSessionStateTempDataProvider": false,

    //Web farm support.
    //Enable "MultipleInstancesEnabled" if you run multiple instances.
    //Enable "RunOnAzureWebApps" if you run on Windows Azure Web Apps (not cloud services)
    "MultipleInstancesEnabled": false,
    "RunOnAzureWebApps": false,

    //Windows Azure BLOB storage.
    //Specify your connection string, container name, end point for BLOB storage here
    "AzureBlobStorageConnectionString": "",
    "AzureBlobStorageContainerName": "",
    "AzureBlobStorageEndPoint": "",

    //Amazon Blob storage
    //<!--Available Region System Names can be found here http://docs.aws.amazon.com/general/latest/gr/rande.html#apigateway_region -->
    "AmazonAwsAccessKeyId": "",
    "AmazonAwsSecretAccessKey": "",
    "AmazonBucketName": "",
    "AmazonRegion": "",

    //Redis support (used by web farms, Azure, etc). Find more about it at https://azure.microsoft.com/en-us/documentation/articles/cache-dotnet-how-to-use-azure-redis-cache/
    "RedisCachingEnabled": false,
    "RedisCachingConnectionString": "localhost",

    //You can get the latest version of user agent strings at http://browscap.org/
    "UserAgentStringsPath": "~/App_Data/browscap.xml",

    //Do not edit this element. For advanced users only
    "PluginsIgnoredDuringInstallation": "",

    //For developers - more info you can find at https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/
    //https://github.com/dotnet/roslyn/wiki/Roslyn-
0
  • Posted: Friday, February 14, 2020 8:26 AM
  • 6
///Enable minimal Progressive Web App.
    "EnableProgressiveWebApp": true,
    //CacheFirst = 0,
    //CacheFirstSafe = 1,
    //CacheFingerprinted = 2,
    Minimal = 3,
    //NetworkFirst = 4
    "ServiceWorkerStrategy": 3,

    //Use my request localization culture
    "UseRequestLocalization": false,
    "DefaultRequestCulture": "en-US",
    //sample list
    "SupportedCultures": [ "en-US", "pl" ],

    //Indicates whether to ignore startup tasks
    "IgnoreStartupTasks": false,

    //Enable if you want to clear /Plugins/bin directory on application startup
    "ClearPluginShadowDirectoryOnStartup": true,

    //Allow to recompiling views on file change
    "AllowRecompilingViewsOnFileChange": false,

    //Indicates whether to ignore InstallUrlMiddleware
    "IgnoreInstallUrlMiddleware": false,
    //Indicates whether to ignore UsePoweredByMiddleware
    "IgnoreUsePoweredByMiddleware": false
  },
  "Api": {
    "Enabled": false,
    "SecretKey": "your private secret key",
    "ValidateIssuer": false,
    "ValidIssuer": "",
    "ValidateAudience": false,
    "ValidAudience": "",
    "ValidateLifetime": true,
    "ValidateIssuerSigningKey": true,
    "ExpiryInMinutes": 1440,
    //generate system model
    "SystemModel":  true
  }
}
0
  • Posted: Friday, February 14, 2020 8:38 AM
  • 953
The part of config related with PWA contains error. You can't uncomment the possible configuration lines, just change the number for ServiceWorkerStrategy.
Best regards,
Patryk

GrandNode Team
0
  • Posted: Friday, February 14, 2020 9:05 AM
  • 6
great,
Done debugging the file and reload nginx

However, the browser still showing 'An error occurred while starting the application'

tried to start the application through puTTY
but dotnet run  command doesn't  work

0
  • Posted: Friday, February 14, 2020 10:15 AM
  • 6
typo above, the wrong command used

dotnet run is not for restart

0
  • Posted: Friday, February 14, 2020 9:04 PM
  • 6
problem solved

issue: mongo db is not found at connection time
solution: settle the mongo db config file and stop nginx and restart the whole server
0
  • Posted: Tuesday, June 2, 2020 2:28 PM
  • 5
hallo,
i have after update 4.70 error (An error occurred while starting the application.

.NET Core 4.6.28207.03 X64 v4.0.0.0    |   Microsoft.AspNetCore.Hosting version 2.2.7-servicing-10089    |    Linux 4.15.0 #1 SMP Mon Mar 16 15:39:59 MSK 2020    |  )

what is here problem?
0
  • Posted: Wednesday, June 3, 2020 5:24 AM
  • 953
What do you mean by the update? Have you replaced the 4.60 files with files coming from 4.70 version and go to yourstore.com/upgrade? What steps have you done before this error?
Best regards,
Patryk

GrandNode Team
0
  • Posted: Wednesday, June 3, 2020 7:53 AM
  • 5
After update come this error!
0
back to top
Filters