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

InvalidCastException: Column 'column_name' is null. #6

Open
zicjin opened this issue Nov 8, 2023 · 0 comments
Open

InvalidCastException: Column 'column_name' is null. #6

zicjin opened this issue Nov 8, 2023 · 0 comments

Comments

@zicjin
Copy link

zicjin commented Nov 8, 2023

System.InvalidCastException: Column 'site_id' is null.
   at Npgsql.ThrowHelper.ThrowInvalidCastException_NoValue(FieldDescription field)
   at Npgsql.Replication.PgOutput.ReplicationValue.GetStream()
   at Npgsql.Replication.PgOutput.ReplicationValue.GetTextReader()
   at PostgresOutbox.Subscriptions.Replication.EventDataMapper.ReadFromReplication(InsertMessage insertMessage, CancellationToken ct) in /src/czmpmedia/PostgresOutbox/Subscriptions/Replication/EventDataMapper.cs:line 15
   at PostgresOutbox.Subscriptions.Replication.EventDataMapper.ReadFromReplication(InsertMessage insertMessage, CancellationToken ct) in /src/czmpmedia/PostgresOutbox/Subscriptions/Replication/EventDataMapper.cs:line 12
   at PostgresOutbox.Subscriptions.ReplicationMessageHandlers.InsertMessageHandler.Handle(InsertMessage message, IReplicationDataMapper dataMapper, CancellationToken ct) in /src/czmpmedia/PostgresOutbox/Subscriptions/ReplicationMessageHandlers/InsertMessageHandler.cs:line 12
   at PostgresOutbox.Subscriptions.Subscription.Subscribe(SubscriptionOptions options, CancellationToken ct)+MoveNext() in /src/czmpmedia/PostgresOutbox/Subscriptions/Subscription.cs:line 69
   at PostgresOutbox.Subscriptions.Subscription.Subscribe(SubscriptionOptions options, CancellationToken ct)+MoveNext() in /src/czmpmedia/PostgresOutbox/Subscriptions/Subscription.cs:line 65
   at PostgresOutbox.Subscriptions.Subscription.Subscribe(SubscriptionOptions options, CancellationToken ct)+MoveNext() in /src/czmpmedia/PostgresOutbox/Subscriptions/Subscription.cs:line 65
   at PostgresOutbox.Subscriptions.Subscription.Subscribe(SubscriptionOptions options, CancellationToken ct)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()

I found relevant information:
https://stackoverflow.com/a/38930847/346701
"In ADO.NET, you need to check for a null value with reader.IsDBNull(0) before actually getting the value."
But the TextReader here does not have the IsDBNull() method.

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