An error occurred while starting the application.

Monday, February 24, 2020 2:36:05 AM
  • Posted: Friday, February 14, 2020 6:53 AM
  • 6

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
  • 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:
    "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 -->
    "AmazonAwsAccessKeyId": "",
    "AmazonAwsSecretAccessKey": "",
    "AmazonBucketName": "",
    "AmazonRegion": "",

    //Redis support (used by web farms, Azure, etc). Find more about it at
    "RedisCachingEnabled": false,
    "RedisCachingConnectionString": "localhost",

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

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

    //For developers - more info you can find at
  • 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
  • Posted: Friday, February 14, 2020 8:38 AM
  • Team
  • 436
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,

GrandNode Team
  • Posted: Friday, February 14, 2020 9:05 AM
  • 6
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

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

dotnet run is not for restart

  • 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
back to top