rbeckman-nextgen / test-mc4

0 stars 0 forks source link

Mirth Connect has a MIME Type Character Limit #4080

Open rbeckman-nextgen opened 4 years ago

rbeckman-nextgen commented 4 years ago

When inputting a MIME Type that is 40 characters or longer, it throws the following error in the server logs:

[2017-11-27 14:33:05,793] ERROR (com.mirth.connect.donkey.server.channel.Channel:1258): Error processing message in channel attachmentMIMEtest (0ca2b2dc-0111-4c00-8330-2cb322c01ad5). com.mirth.connect.donkey.server.channel.ChannelException: com.mirth.connect.donkey.server.data.DonkeyDaoException: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(40) at com.mirth.connect.donkey.server.channel.Channel.dispatchRawMessage(Channel.java:1213) at com.mirth.connect.donkey.server.channel.SourceConnector.dispatchRawMessage(SourceConnector.java:192) at com.mirth.connect.server.controllers.DonkeyEngineController.dispatchRawMessage(DonkeyEngineController.java:1067) at com.mirth.connect.server.api.servlets.MessageServlet$2.run(MessageServlet.java:107) at java.lang.Thread.run(Thread.java:745)Caused by: com.mirth.connect.donkey.server.data.DonkeyDaoException: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(40) at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.insertMessageAttachment(JdbcDao.java:524) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.executeTasks(BufferedDao.java:113) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:85) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:72) at com.mirth.connect.donkey.server.channel.Channel.dispatchRawMessage(Channel.java:1185) ... 4 moreCaused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(40) at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:168) at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:135) at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.insertMessageAttachment(JdbcDao.java:495) ... 8 more

--------------------Steps to Reproduce-------------------- 1) Create a new channel in Mirth Connect 2) Set "Attachment" to "Entire Message" and "Mime Type" to "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet". (Optional: set "Data Type" to "RAW" on both Source / Destination) 3) Save and Deploy the Channel 4) Send any message to the channel and you will see the following error in the server logs:

ERROR (com.mirth.connect.donkey.server.channel.Channel:1258): Error processing message in channel attachmentMIMEtest (0ca2b2dc-0111-4c00-8330-2cb322c01ad5). com.mirth.connect.donkey.server.channel.ChannelException: com.mirth.connect.donkey.server.data.DonkeyDaoException: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(40) at com.mirth.connect.donkey.server.channel.Channel.dispatchRawMessage(Channel.java:1213) at com.mirth.connect.donkey.server.channel.SourceConnector.dispatchRawMessage(SourceConnector.java:192) at com.mirth.connect.server.controllers.DonkeyEngineController.dispatchRawMessage(DonkeyEngineController.java:1067) at com.mirth.connect.server.api.servlets.MessageServlet$2.run(MessageServlet.java:107) at java.lang.Thread.run(Thread.java:745)Caused by: com.mirth.connect.donkey.server.data.DonkeyDaoException: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(40) at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.insertMessageAttachment(JdbcDao.java:524) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.executeTasks(BufferedDao.java:113) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:85) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:72) at com.mirth.connect.donkey.server.channel.Channel.dispatchRawMessage(Channel.java:1185) ... 4 moreCaused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(40) at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:168) at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:135) at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.insertMessageAttachment(JdbcDao.java:495) ... 8 more

The message you send won't show up in the channel itself.

Original Case: 04571040

Imported Issue. Original Details: Jira Issue Key: MIRTH-4228 Reporter: kgouw Created: 2017-11-29T07:39:17.000-0800

rbeckman-nextgen commented 4 years ago

As a workaround, you should be able to use Velocity replacement there, so you could put that in the Configuration Map.

Imported Comment. Original Details: Author: narupley Created: 2017-11-29T07:40:37.000-0800