Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Cannot access UI on latest version #5121


User avatar
0
manojreddy created

I'm getting the error while trying to access UI on <a class="postlink" href="http://localhost:4200">http://localhost:4200</a>.

INFO 2018-05-14 14:43:07,495 [22 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 OPTIONS <a class="postlink" href="http://localhost:22742/AbpUserConfiguration/GetAll">http://localhost:22742/AbpUserConfiguration/GetAll</a>
INFO 2018-05-14 14:43:07,542 [22 ] pNetCore.Cors.Infrastructure.CorsService - Policy execution successful. INFO 2018-05-14 14:43:07,726 [22 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 209.9348ms 204 INFO 2018-05-14 14:43:07,953 [22 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET <a class="postlink" href="http://localhost:22742/AbpUserConfiguration/GetAll">http://localhost:22742/AbpUserConfiguration/GetAll</a> application/json INFO 2018-05-14 14:43:07,961 [22 ] pNetCore.Cors.Infrastructure.CorsService - Policy execution successful. INFO 2018-05-14 14:43:08,022 [22 ] pNetCore.Cors.Infrastructure.CorsService - Policy execution successful. INFO 2018-05-14 14:43:08,114 [22 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.GetAll (Abp.AspNetCore) with arguments ((null)) - ModelState is Valid ERROR 2018-05-14 14:43:08,169 [25 ] Mvc.ExceptionHandling.AbpExceptionFilter - No language defined! Abp.AbpException: No language defined! at Abp.Localization.MultiTenantLocalizationDictionaryProvider.GetDefaultDictionary() at Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource.GetAllStrings(CultureInfo culture, Boolean includeDefaults) in D:\Github\aspnetboilerplate\src\Abp\Localization\Dictionaries\DictionaryBasedLocalizationSource.cs:line 146 at Abp.Web.Configuration.AbpUserConfigurationBuilder.GetUserLocalizationConfig() in D:\Github\aspnetboilerplate\src\Abp.Web.Common\Web\Configuration\AbpUserConfigurationBuilder.cs:line 135 at Abp.Web.Configuration.AbpUserConfigurationBuilder.<GetAll>d__38.MoveNext() in D:\Github\aspnetboilerplate\src\Abp.Web.Common\Web\Configuration\AbpUserConfigurationBuilder.cs:line 70 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.<GetAll>d__2.MoveNext() in D:\Github\aspnetboilerplate\src\Abp.AspNetCore\AspNetCore\Mvc\Controllers\AbpUserConfigurationController.cs:line 18 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at lambda_method(Closure , Object ) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 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>d__14.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextExceptionFilterAsync>d__23.MoveNext() INFO 2018-05-14 14:43:08,185 [25 ] etCore.Mvc.Internal.ObjectResultExecutor - Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. INFO 2018-05-14 14:43:08,188 [25 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.GetAll (Abp.AspNetCore) in 209.7928ms INFO 2018-05-14 14:43:08,203 [25 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 253.2542ms 500 application/json; charset=utf-8

I'm using 5.4.1 version with MqSql, I also observed that there is no entry in abplanguages table after running the service side application.


7 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    @ManojReddy,

    Is this a clean download ? It seems like the Seed method is not worked in your case.

    You can debug the code and see if it is runned or not.

  • User Avatar
    0
    manojreddy created

    Yes, its clean download, only changes I have made is that instead of using SQL Server I'm using MySql and I have made the changes by referring <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/EF-Core-MySql-Integration?searchKey=mqsql">https://aspnetboilerplate.com/Pages/Doc ... hKey=mqsql</a>.

    I checked that GetInitialLanguages method is not getting called in DefaultLanguagesCreator class.

  • User Avatar
    0
    manojreddy created

    I checked it again. I'm getting an exception while connecting to DB in DatabaseCheckHelper class method public static bool Exist(string connectionString)

    I'm just wondering that I'm able to successfully generate the migrations, but not able to hit DB. appsettings.json

    { "ConnectionStrings": { "Default": "Server=127.0.0.1;uid=root;pwd=root; Database=StanchionDb;" }, "AbpZeroLicenseCode": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "App": { "WebSiteRootAddress": "http://localhost:45776/", "AdminWebSiteRootAddress": "http://localhost:4200/" } }

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ManojReddy,

    It seems like the problem is related to DB connection.

    Is it possible that some other connection string is in use ? If not, be sure that you are able to connect to database with the connection string on the screenshot you have shared.

  • User Avatar
    0
    manojreddy created

    It's very obvious that this issue is related to the connection string. I'm not able to identify the root cause that is why I have posted my question here. Why are you giving an obvious answer and repeating my answer only?

    I have used the same configuration with free template also in other application, and there its working fine.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @ManojReddy does it work when you manually insert a language record to AbpLanguages table ?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I have found the problem. Please change DatabaseCheckHelper class like below and try again;

    public static class DatabaseCheckHelper
    {
        public static bool Exist(string connectionString)
        {
            if (connectionString.IsNullOrEmpty())
            {
                //connectionString is null for unit tests
                return true;
            }
           
            using (DbConnection connection = new MySqlConnection(connectionString))
            {
                try
                {
                    connection.Open();
                }
                catch
                {
                    return false;
                }
    
                return true;
            }
        }
    }