InvalidCastException: Cannot write DateTime with Kind=Local to PostgreSQL type 'timestamp with time zone', only UTC is supported. Note that it's not possible to mix DateTimes with different Kinds in an array/range. See the Npgsql.EnableLegacyTimestampBehavior AppContext switch to enable legacy behavior.
(01) Generate new solution using ABP Suite (02) Clean solution (03) Add '{' and '}' along with namespace and with VS-2019 doesn't allow namespace xyz; structure to run the application (04) Solution build successfully. (05) Run "demo.DbMigrator" project. While run this project it creates table and DB structure in the Postgres-V-12.0. (06) Error occurs when try to insert the seed data into database.
Following is the StackTrace
Microsoft.EntityFrameworkCore.DbUpdateException
HResult=0x80131500
Message=An error occurred while saving the entity changes. See the inner exception for details.
Source=Microsoft.EntityFrameworkCore.Relational
StackTrace:
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.<ExecuteAsync>d__29.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.<ExecuteAsync>d__9.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.<ExecuteAsync>d__9.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.<ExecuteAsync>d__9.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.<SaveChangesAsync>d__103.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.<SaveChangesAsync>d__107.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable
1.ConfiguredTaskAwaiter.GetResult()
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.<ExecuteAsync>d__72.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable
1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.EntityFrameworkCore.DbContext.<SaveChangesAsync>d__60.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.EntityFrameworkCore.DbContext.<SaveChangesAsync>d__60.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Volo.Abp.EntityFrameworkCore.AbpDbContext
1.<SaveChangesAsync>d__41.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository
2.<InsertAsync>d__20.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Castle.DynamicProxy.AsyncInterceptorBase.<ProceedAsynchronous>d__14
1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.<ProceedAsync>d__7.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at Volo.Abp.Uow.UnitOfWorkInterceptor.<InterceptAsync>d__2.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.<InterceptAsync>d__3
1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
This exception was originally thrown at this call stack: [External Code]
Inner Exception 1: InvalidCastException: Cannot write DateTime with Kind=Local to PostgreSQL type 'timestamp with time zone', only UTC is supported. Note that it's not possible to mix DateTimes with different Kinds in an array/range. See the Npgsql.EnableLegacyTimestampBehavior AppContext switch to enable legacy behavior.
Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
If you're creating a bug/problem report, please include followings:
I am not able to upload log file where i upload log file? because it is big contain so please provide me upload log file.
Hi there,
Can you please provide the checklist or the steps? We will executes those steps or prerequisite to make sure that everything is in place.
Thank you
We are not able to login with public site.
We have login page in admin site we follow identity service rules with public web site for login.
We have two project Admin and Public. We use our Identity server policy in Admin section we are successfully login. But we are not able to login with public web site.
we follow all trick like change setting on our both appsettings.json file and add our public link in Administration -> Identity Server -> Client -> Application Url ->CallbackUrl but it is not login with public site. This issue we facing on Publish site. In Development work ok but when we publish it is not working. so please give us step with example.
Steps to reproduce the issue:"
As per your answer Do you use microservice template? I am not using Microsrvice Share authserver and public web application logs please.
we Admin application host on https://1.1.2.43:44343 and public application host on https://1.1.2.43:44344 in admin have login page we are trying call with our publish web site login it give internal server error.
discussion log file error please refer it
Initialized all ABP modules. 2022-01-28 10:40:44.233 +05:30 [INF] Application started. Press Ctrl+C to shut down. 2022-01-28 10:40:44.233 +05:30 [INF] Hosting environment: Production 2022-01-28 10:40:44.234 +05:30 [INF] Content root path: D:\IISPublish\PVPublic 2022-01-28 10:40:44.256 +05:30 [INF] Request starting HTTP/2 GET https://1.1.2.43:44344/ - - 2022-01-28 10:40:48.612 +05:30 [INF] Executing endpoint '/Index' 2022-01-28 10:40:48.650 +05:30 [INF] Route matched with {page = "/Index", action = "", controller = "", area = ""}. Executing page /Index
We follow under steps Step 1 In admin web site appsetting.json file configuration setting we configuration this "App": { "SelfUrl": "https://1.1.2.43:44343" },
"AuthServer": { "Authority": "https://1.1.2.43:44343", "RequireHttpsMetadata": "true" }, ** Step 2 In public web site appsetting.json file configuration setting we configuration this **
"App": { "SelfUrl": "https://1.1.2.43:44344" },
"AuthServer": { "Authority": "https://1.1.2.43:44343", "RequireHttpsMetadata": "false", "ClientId": "SGLPV_Web_Public_Demo", "ClientSecret": "1q2w3e*" }, Step 3 Register clients
Administration -> Identity resources -> Clients -> Create a New client we are creating New client name is SGLPV_Web_Public_Demo
Step 4 Add callbackurl with Application Urls Menu -> callback
i create callback url like https://1.1.2.43:44344/signin-oidc
Step 5 Add our login url in our public web site href="~/Account/Login"
so what we miss about calling login page with public site please guide us.
Our LOG Error
2022-01-28 10:40:44.233 +05:30 [INF] Application started. Press Ctrl+C to shut down. 2022-01-28 10:40:44.233 +05:30 [INF] Hosting environment: Production 2022-01-28 10:40:44.234 +05:30 [INF] Content root path: D:\IISPublish\PVPublic 2022-01-28 10:40:44.256 +05:30 [INF] Request starting HTTP/2 GET https://1.1.2.43:44344/ - - 2022-01-28 10:40:48.612 +05:30 [INF] Executing endpoint '/Index' 2022-01-28 10:40:48.650 +05:30 [INF] Route matched with {page = "/Index", action = "", controller = "", area = ""}. Executing page /Index
As per your answer Do you use microservice template? I am not using Microsrvice Share authserver and public web application logs please.
we Admin application host on https://1.1.2.43:44343 and public application host on https://1.1.2.43:44344 in admin have login page we are trying call with our publish web site login it give internal server error.
discussion log file error please refer it
Initialized all ABP modules.
2022-01-28 10:40:44.233 +05:30 [INF] Application started. Press Ctrl+C to shut down.
2022-01-28 10:40:44.233 +05:30 [INF] Hosting environment: Production
2022-01-28 10:40:44.234 +05:30 [INF] Content root path: D:\IISPublish\PVPublic
2022-01-28 10:40:44.256 +05:30 [INF] Request starting HTTP/2 GET https://192.168.2.43:44344/ - -
2022-01-28 10:40:48.612 +05:30 [INF] Executing endpoint '/Index'
2022-01-28 10:40:48.650 +05:30 [INF] Route matched with {page = "/Index", action = "", controller = "", area = ""}. Executing page /Index
We follow under steps
**Step 1 In admin web site appsetting.json file configuration setting we configuration this**
"App": {
"SelfUrl": "https://1.1.2.43:44343"
},
"AuthServer": {
"Authority": "https://1.1.2.43:44343",
"RequireHttpsMetadata": "true"
},
** Step 2 In public web site appsetting.json file configuration setting we configuration this **
"App": {
"SelfUrl": "https://1.1.2.43:44344"
},
"AuthServer": {
"Authority": "https://1.1.2.43:44343",
"RequireHttpsMetadata": "false",
"ClientId": "SGLPV_Web_Public_Demo",
"ClientSecret": "1q2w3e*"
},
**Step 3 Register clients**
Administration -> Identity resources -> Clients -> Create a New client
we are creating New client name is SGLPV_Web_Public_Demo
**Step 4 Add callbackurl with Application Urls Menu -> callback**
i create callback url like
https://1.1.2.43:44344/signin-oidc
**Step 5 Add our login url in our public web site**
href="~/Account/Login"
so what we miss about calling login page with public site please guide us.
Thank you for your support