-
-
Notifications
You must be signed in to change notification settings - Fork 82
"Could not convert to String: <null>" error with empty strings #143
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
Comments
Hi @juanLovera, as you may know a lot was changed for 1.5.0. See #135. The question now is: Is this a bug in PostgresNIO or is this a bug in a layer above that was only made visible through the changes in Would you be able to run your Fluent query as plain SQL with a plain |
@fabianfett Just ran the raw query and the returned rows are correct. Also compared the generated query using 1.5.0 vs 1.4.3 and they're the same. Let me know if I can help with anything else. Thanks. |
We see same bug in PostgresBridge, empty strings became NULLs, it is explicitly visible during inserts.
@fabianfett Seems that it is bug in |
@MihaelIsaev @juanLovera We already have identified the issue and are working on a fix. Should be up in latest an hour. |
@MihaelIsaev @juanLovera could you please verify the pr #144 resolves your issue? |
Describe the bug
After upgrading to postgres-nio 1.5.0, our server started crashing with a bunch of errors like this:
[ ERROR ] invalid field: stripe_id type: String error: typeMismatch(Swift.String, Swift.DecodingError.Context(codingPath: [], debugDescription: "Could not convert to String: <null>", underlyingError: nil)) [request-id: 4A11F25B-AD9C-43EC-BC9B-996A434DBAF2]
The indicated field is non-null on Postgres and non optional on Swift. I discovered that this is happening when the field's value is an empty string, so it would seem like empty strings are being treated as null values.
To Reproduce
Expected behavior
It should return the empty string instead of crashing.
Vapor 4.32.0
Fluent 4.0.0
Postgres-nio 1.5.0
Postrges 11.5
The text was updated successfully, but these errors were encountered: