Base solution for your next web application
Open Closed

CustomCss Error #6151


User avatar
0
kpmg created

Hi all!

I tried to upload a custom CSS and it looks like the file got uploaded. But during the GET process there is an error

GET https://MYWEBSITE//TenantCustomization/GetCustomCss?id=1e649217-0451-92d8-3d6c-39eacd5d30c9 net::ERR_ABORTED 500 (Internal Server Error)

Does anyone know why this error is shown?

Thanks in advance!


20 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Please share the logs of the backend application.

  • User Avatar
    0
    kpmg created

    I am using the Zero 6.4.0 with Core 2.2 and Angular It's hosted as a App Service on Azure.

    HTTP Error 500.0 - Internal Server Error - The page cannot be displayed because an internal server error has occurred.

    Most likely causes:

    • IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
    • IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
    • IIS was not able to process configuration for the Web site or application.
    • The authenticated user does not have permission to use this DLL.
    • The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.

    Detailed Error Information: Module: AspNetCoreModule Notification: ExecuteRequestHandler Handler: aspNetCore

    Requested URL: https://mywebsite__fa76:80/TenantCustomization/GetCustomCss?id=67c9f746-0aa3-bcdc-241e-39eacd7efde6 Physical Path:D:\home\site\wwwroot\TenantCustomization\GetCustomCss Logon Method: Anonymous Logon User:Anonymous

    The thing is, I am logged into the backend as administrator. I can't find the physical path on the FTP.

  • User Avatar
    0
    kpmg created

    In the URL is no "api/serives"? Might this be the problem?

    Should it be https://mywebsite__fa76:80/api/services/TenantCustomization/GetCustomCss?id=67c9f746-0aa3-bcdc-241e-39eacd7efde6)?

  • User Avatar
    0
    maliming created
    Support Team

    Please check the App_Data/Logs/Logs.txt log file (default log configuration)

  • User Avatar
    0
    kpmg created

    Here are the logs. They say I wouldn't be logged in, but I am (logged out and back in to the tenant three times).

    I have a host and one tenant, both in one database. I want to change the custom css in the tenant application.

    INFO 2018-12-17 10:20:53,134 [6 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://mywebsite-dev.azurewebsites.net/TenantCustomization/GetCustomCss?id=2230994b-89bc-e00d-0adb-39eacda4b09b
    INFO 2018-12-17 10:20:53,150 [6 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "GetCustomCss", controller = "TenantCustomization", area = ""}. Executing action mywebsiteDemo.Web.Controllers.TenantCustomizationController.GetCustomCss (mywebsiteDemo.Web.Core)
    INFO 2018-12-17 10:20:53,166 [6 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method mywebsiteDemo.Web.Controllers.TenantCustomizationController.GetCustomCss (mywebsiteDemo.Web.Core) - Validation state: Valid
    ERROR 2018-12-17 10:20:53,262 [6 ] Mvc.ExceptionHandling.AbpExceptionFilter - Session.TenantId is null! Possible problems: No user logged in or current logged in user in a host user (TenantId is always null for host users).
    Abp.AbpException: Session.TenantId is null! Possible problems: No user logged in or current logged in user in a host user (TenantId is always null for host users).
    at Abp.Runtime.Session.AbpSessionExtensions.GetTenantId(IAbpSession session)
    at mywebsiteDemo.Web.Controllers.TenantCustomizationController.GetCustomCss() in C:\DEV\ReposNeu\mywebsitetoolNeu\mywebsiteDemo\aspnet-core\src\mywebsiteDemo.Web.Core\Controllers\TenantCustomizationController.cs:line 170
    at lambda_method(Closure , Object )
    at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
    at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()
    INFO 2018-12-17 10:20:53,273 [6 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action mywebsiteDemo.Web.Controllers.TenantCustomizationController.GetCustomCss (mywebsiteDemo.Web.Core) in 121.7508ms
    ERROR 2018-12-17 10:20:53,275 [6 ] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HLJ403EJ8DV1", Request id "0HLJ403EJ8DV1:00000004": An unhandled exception was thrown by the application.
    Abp.AbpException: Session.TenantId is null! Possible problems: No user logged in or current logged in user in a host user (TenantId is always null for host users).
    at Abp.Runtime.Session.AbpSessionExtensions.GetTenantId(IAbpSession session)
    at mywebsiteDemo.Web.Controllers.TenantCustomizationController.GetCustomCss() in C:\DEV\ReposNeu\mywebsitetoolNeu\mywebsiteDemo\aspnet-core\src\mywebsiteDemo.Web.Core\Controllers\TenantCustomizationController.cs:line 170
    at lambda_method(Closure , Object )
    at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
    at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
    at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()
    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ExceptionContext context)
    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
    at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
    at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
    at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
    at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
    at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
    at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
    at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.Invoke(HttpContext context)
    at Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.Invoke(HttpContext httpContext)
    at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.Invoke(HttpContext httpContext)
    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
    INFO 2018-12-17 10:20:53,359 [6 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 225.2234ms 500
    
  • User Avatar
    0
    maliming created
    Support Team

    This request requires a tenant ID, you can't request it directly. Angular will automatically set the tenant ID. So it will be obtained normally in the application.

    https://github.com/aspnetzero/aspnet-zero-core/blob/d44aa6324c1162cb948ccf84f818e6b0f49b94fd/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Core/Controllers/TenantCustomizationController.cs#L170

    AbpSession.GetTenantId() If the tenant ID is not obtained correctly, this method will throw an exception, causing the error you see.

  • User Avatar
    0
    kpmg created

    Thanks for the analysis. But why is the tenantId not set or obtained? I used the RAD tool and did no other adjustments.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @christianw

    Does this happen just after when you upload the css file ?

  • User Avatar
    0
    kpmg created

    @ismcagdas

    everytime I change the site I get the error in the developer console of chrome and also in the server logs.

    main.34f03c3c41db8237c873.js:1 GET https://mywebsite.azurewebsites.net//TenantCustomization/GetCustomCss?id=e2a1b0e6-4cc6-0daa-b8e3-39eacdb0338a net::ERR_ABORTED 500 (Internal Server Error)

    I also deleted the file and reuploaded it but nothing changed.

  • User Avatar
    0
    maliming created
    Support Team

    Please share your http request header

  • User Avatar
    0
    kpmg created

    I can see that the request headers are different to your call.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @christianw

    Are you using tenancy name as the subdomain ?

  • User Avatar
    0
    kpmg created

    No subdomains at all.

  • User Avatar
    0
    maliming created
    Support Team

    It's strange why TenantId doesn't work properly. Is it convenient to send the project's source code to: [email protected]?

  • User Avatar
    0
    kpmg created

    Hi @maliming! Unfortunately I can't send you the source code of the project. Basically, it is the 6.4 template with 6 entities generated by RAD. I changed nothing else in the project. Best wishes and thanks in advance!

  • User Avatar
    0
    ismcagdas created
    Support Team
  • User Avatar
    0
    kpmg created

    I've seen that the issue got closed. I still get the error and my custom css won't get applied.

    I use the new 6.5 template with angular and .net core 2.2. The error occures if I upload the custom css several times.

    I am hosting it on Azure as a Web App. I think the problem is somewhere else. When I restart the Web App and just call the login screen, the following logs are getting created. First I thought it is my Application Insights but the error bellow still occurs even if I disabled Application Insights.

    DELETED SOME LOGS FOR READABILITY

    
    DEBUG 2019-02-05 10:22:06,135 [1    ] Abp.Modules.AbpModuleManager             - Loading Abp modules...
    DEBUG 2019-02-05 10:22:06,394 [1    ] Abp.Modules.AbpModuleManager             - Found 23 ABP modules in total.
    DEBUG 2019-02-05 10:22:06,523 [1    ] Abp.Modules.AbpModuleManager             - 23 modules loaded.
    DEBUG 2019-02-05 10:22:27,794 [1    ] cy.SubscriptionExpireEmailNotifierWorker - Start background worker: myappDemo.MultiTenancy.SubscriptionExpireEmailNotifierWorker
    FATAL 2019-02-05 10:22:31,570 [1    ] soft.AspNetCore.Hosting.Internal.WebHost - Hosting startup assembly exception
    System.InvalidOperationException: Startup assembly Microsoft.AspNetCore.AzureAppServices.HostingStartup failed to execute. See the inner exception for more details. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.AzureAppServices.HostingStartup, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
       at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, IntPtr ptrLoadContextBinder)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, IntPtr ptrLoadContextBinder)
       at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
       at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
       --- End of inner exception stack trace ---**
       INFO  2019-02-05 10:22:32,477 [8    ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 OPTIONS http://myapp-dev7854.azurewebsites.net/AbpUserConfiguration/GetAll?d=1549362115780  
    INFO  2019-02-05 10:22:32,635 [8    ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful.
    INFO  2019-02-05 10:22:32,861 [8    ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 366.8468ms 204 
    INFO  2019-02-05 10:22:33,049 [8    ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://myapp-dev7854.azurewebsites.net/AbpUserConfiguration/GetAll?d=1549362115780 application/json 
    INFO  2019-02-05 10:22:33,052 [8    ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful.
    
    

    DELETED SOME LOGS FOR READABILITY

    
     INFO  2019-02-05 10:22:40,671 [11   ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://myapp-dev7854.azurewebsites.net/TenantCustomization/GetTenantLogo?skin=light&tenantId=3&id=7ac9b5b4-c56d-c92e-91a3-39eb92117412  
    INFO  2019-02-05 10:22:40,789 [11   ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'myappDemo.Web.Controllers.TenantCustomizationController.GetTenantLogo (myappDemo.Web.Core)'
    **ERROR 2019-02-05 10:22:40,798 [12   ] Mvc.ExceptionHandling.AbpExceptionFilter - Session.TenantId is null! Possible problems: No user logged in or current logged in user in a host user (TenantId is always null for host users).
    Abp.AbpException: Session.TenantId is null! Possible problems: No user logged in or current logged in user in a host user (TenantId is always null for host users).
       at Abp.Runtime.Session.AbpSessionExtensions.GetTenantId(IAbpSession session)
       at myappDemo.Web.Controllers.TenantCustomizationController.GetCustomCss() in C:\DEV\Repos\myapp\aspnet-core\src\myappDemo.Web.Core\Controllers\TenantCustomizationController.cs:line 170
       at lambda_method(Closure , Object )
       at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
       at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
       at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()**
    INFO  2019-02-05 10:22:40,817 [12   ] ore.Mvc.Internal.ControllerActionInvoker - Executed action myappDemo.Web.Controllers.TenantCustomizationController.GetCustomCss (myappDemo.Web.Core) in 286.7727ms
    INFO  2019-02-05 10:22:40,818 [12   ] ft.AspNetCore.Routing.EndpointMiddleware - Executed endpoint 'myappDemo.Web.Controllers.TenantCustomizationController.GetCustomCss (myappDemo.Web.Core)'
    **ERROR 2019-02-05 10:22:40,825 [12   ] Microsoft.AspNetCore.Server.Kestrel      - Connection id "0HLKBAFB83ATQ", Request id "0HLKBAFB83ATQ:00000005": An unhandled exception was thrown by the application.
    Abp.AbpException: Session.TenantId is null! Possible problems: No user logged in or current logged in user in a host user (TenantId is always null for host users).
       at Abp.Runtime.Session.AbpSessionExtensions.GetTenantId(IAbpSession session)
       at myappDemo.Web.Controllers.TenantCustomizationController.GetCustomCss() in C:\DEV\Repos\myapp\aspnet-core\src\myappDemo.Web.Core\Controllers\TenantCustomizationController.cs:line 170
       at lambda_method(Closure , Object )
       at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
       at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
       at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()
       at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ExceptionContext context)
       at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
       at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
       at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
       at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
       at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
       at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
       at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
       at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)
       at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
       at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
       at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
       at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
       at Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.Invoke(HttpContext httpContext)
       at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.Invoke(HttpContext httpContext)
       at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
       
    
  • User Avatar
    0
    ismcagdas created
    Support Team

    We couldn't reproduce the problem.

  • User Avatar
    0
    rfrcarvalho created

    I have the exact same problem where it works fine locally but not in Azure. I'm using the ASP.NET Core 2.2 and Angular version and didn't change anything onthe platform apart from creating some custom entities using the RAD Tool.

    Can anyone help?

    Locally

    Azure

  • User Avatar
    0
    maliming created
    Support Team

    hi @rfrcarvalho

    I see your browser exists in localhost Abp.TenantId cookie.

    But these cookies are not available in azure.