linagora / james-project

Mirror of Apache James Project
Apache License 2.0
70 stars 63 forks source link

[Postgres] Issue with AttachmentId and sql insert? #5140

Closed Arsnael closed 3 months ago

Arsnael commented 4 months ago

Spotted while running some jmap perf tests:

{"timestamp":"2024-03-26T08:37:17.570Z","level":"WARN","thread":"reactor-tcp-epoll-1","logger":"org.apache.james.transport.mailets.delivery.MailDispatcher","message":"Error While storing mail. This error will be retried for 0 more times.","context":"default","exception":"org.jooq.exception.DataAccessException: SQL [insert into attachment (\n  id,\n  blob_id,\n  type,\n  message_id,\n  size\n)\nvalues (\n  $1, \n  $2, \n  $3, \n  cast($4 as uuid), \n  $5\n)]; column \"id\" is of type uuid but expression is of type character varying\n\tat

[...]

My guess would be related to the recent refactoring work on AttachmentId?

quantranhong1999 commented 4 months ago

I checked Postgres OVH and the attachment's id column has a UUID data type (the reworking id work seems to change data type from String -> UUID).

Any chance we are using an old version of the postgres-app that trying to insert old school String id?

Arsnael commented 4 months ago

Any chance we are using an old version of the postgres-app that trying to insert old school String id?

Hmmm maybe... Might need to do a rebase to check

Arsnael commented 3 months ago

Does not happen anymore, likely because of the cause mentionned by @quantranhong1999

Closing this