Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres sql Datetime convention issue #1329

Open
Damdias opened this issue Jan 7, 2025 · 0 comments
Open

Postgres sql Datetime convention issue #1329

Damdias opened this issue Jan 7, 2025 · 0 comments

Comments

@Damdias
Copy link

Damdias commented Jan 7, 2025

Describe the bug
Create a Activity according tutorial refer in documentation (https://workflow-core.readthedocs.io/en/latest/activities/)

To Reproduce
I am using asp.net core API with dotnet 8. and store data in postgres sql version is "PostgreSQL 16.2 (Debian 16.2-1.pgdg110+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit"

error occur in GetPendingActivity method
var activity = host.GetPendingActivity("approve-doc1", "worker1", TimeSpan.FromMinutes(1)).Result;

Expected behavior
xception has occurred: CLR/System.AggregateException
An exception of type 'System.AggregateException' occurred in System.Private.CoreLib.dll but was not handled in user code: 'One or more errors occurred.'
Inner exceptions found, see $exception in variables window for more details.
Innermost exception System.ArgumentException : 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, or multirange. Arg_ParamName_Name
at Npgsql.Internal.Converters.DateTimeConverterResolver1.Get(DateTime value, Nullable1 expectedPgTypeId, Boolean validateOnly)
at Npgsql.Internal.Converters.DateTimeConverterResolver.<>c.b__0_0(DateTimeConverterResolver1 resolver, DateTime value, Nullable1 expectedPgTypeId)
at Npgsql.Internal.Converters.DateTimeConverterResolver1.Get(T value, Nullable1 expectedPgTypeId)
at Npgsql.Internal.PgConverterResolver1.GetAsObjectInternal(PgTypeInfo typeInfo, Object value, Nullable1 expectedPgTypeId)
at Npgsql.Internal.PgResolverTypeInfo.GetResolutionAsObject(Object value, Nullable1 expectedPgTypeId) at Npgsql.Internal.PgTypeInfo.GetObjectResolution(Object value) at Npgsql.NpgsqlParameter.ResolveConverter(PgTypeInfo typeInfo) at Npgsql.NpgsqlParameter.ResolveTypeInfo(PgSerializerOptions options) at Npgsql.NpgsqlParameterCollection.ProcessParameters(PgSerializerOptions options, Boolean validateValues, CommandType commandType) at Npgsql.NpgsqlCommand.<ExecuteReader>d__120.MoveNext() at Npgsql.NpgsqlCommand.<ExecuteReader>d__120.MoveNext() at Npgsql.NpgsqlCommand.<ExecuteDbDataReaderAsync>d__113.MoveNext() at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.<ExecuteReaderAsync>d__18.MoveNext() at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.<ExecuteReaderAsync>d__18.MoveNext() at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.d__21.MoveNext()
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.d__72.MoveNext() at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.d__20.MoveNext()
at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable1.ConfiguredValueTaskAwaiter.GetResult() at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.<SingleOrDefaultAsync>d__151.MoveNext()
at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.d__15`1.MoveNext()
at WorkflowCore.Persistence.EntityFramework.Services.EntityFrameworkPersistenceProvider.d__26.MoveNext()
at WorkflowCore.Services.ActivityController.d__5.MoveNext()

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant