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

fix(document-store): document save throws ERROR: invalid byte sequence for encoding "UTF8": 0x00 #8204

Closed
pujavs opened this issue Apr 2, 2024 · 2 comments
Assignees
Labels
kind-bug Issue or PR is a bug in existing functionality

Comments

@pujavs
Copy link
Contributor

pujavs commented Apr 2, 2024

Document save functionality throws error in PSQL Database

Screenshot:
image

Error snippet:
Caused by: com.querydsl.core.QueryException: Caught PSQLException for insert into "public"."jansDocument" ("creationDate", "description", "displayName", "document", "inum", "jansEnabled", "jansModuleProperty", "objectClass", "dn", "doc_id")
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
at com.querydsl.sql.DefaultSQLExceptionTranslator.translate(DefaultSQLExceptionTranslator.java:50) ~[querydsl-sql-4.4.0.jar:?]
at com.querydsl.sql.Configuration.translate(Configuration.java:508) ~[querydsl-sql-4.4.0.jar:?]
at com.querydsl.sql.dml.AbstractSQLInsertClause.execute(AbstractSQLInsertClause.java:437) ~[querydsl-sql-4.4.0.jar:?]
at io.jans.orm.sql.operation.impl.SqlOperationServiceImpl.addEntryImpl(SqlOperationServiceImpl.java:209) ~[jans-orm-sql-1.1.1-SNAPSHOT.jar:?]
at io.jans.orm.sql.operation.impl.SqlOperationServiceImpl.addEntry(SqlOperationServiceImpl.java:177) ~[jans-orm-sql-1.1.1-SNAPSHOT.jar:?]
at io.jans.orm.sql.impl.SqlEntryManager.persist(SqlEntryManager.java:215) ~[jans-orm-sql-1.1.1-SNAPSHOT.jar:?]
... 108 more
Caused by: org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0x00
Where: unnamed portal parameter $4

Logs:
2024_04_02.jetty.log

@mo-auto mo-auto added the kind-bug Issue or PR is a bug in existing functionality label Apr 2, 2024
@pujavs pujavs self-assigned this Apr 3, 2024
@pujavs
Copy link
Contributor Author

pujavs commented Apr 3, 2024

Two changes made for this;

  1. Used saveBinaryDocumentStream method instead of saveDocumentStream
    image

  2. Datatype of document field in DB changed from varchar to text
    image

@pujavs
Copy link
Contributor Author

pujavs commented Apr 3, 2024

Fixed via PR 8215 and 8211

@pujavs pujavs closed this as completed Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind-bug Issue or PR is a bug in existing functionality
Projects
None yet
Development

No branches or pull requests

3 participants