Hi all,

I sent to user notification  with some text and pdf attachment. But its give this error. Normally action works fine. Only sending specific one mail is giving error. We are sending to different user with same data (only structure, It can be different valur) successfully.

I tried set "Log Content : No". But its could not fix.

Note : I dont have OSSYS_Email_Content table in my application. I guess its system table.

"Error creating Email. String or binary data would be truncated. Can not instert to value NULL into column 'ID' table 'outsystems.dbo.OSSYS_Email_Content'; column does not allow nulls. INSERT fails. The statement has been terminated. The statement has been terminated."


Its deleted from monitoring. I can not send error details.



If you don't have OSSYS_Email_Content entity, then you have to check where it's writing the content in the entity which doesn't exists.

It's SQL error which is blocking further email operation.

Erdem Birinci wrote:

Hi all,

I sent to user notification  with some text and pdf attachment. But its give this error. Normally action works fine. Only sending specific one mail is giving error. We are sending to different user with same data (only structure, It can be different valur) successfully.

I tried set "Log Content : No". But its could not fix.

Note : I dont have OSSYS_Email_Content table in my application. I guess its system table.

"Error creating Email. String or binary data would be truncated. Can not instert to value NULL into column 'ID' table 'outsystems.dbo.OSSYS_Email_Content'; column does not allow nulls. INSERT fails. The statement has been terminated. The statement has been terminated."


Its deleted from monitoring. I can not send error details.



Hi Erdem,

OSSYS_EMAIL_CONTENT is a system entity and OutSystems tries to insert a new record when you set Log Content option is yes. Otherwise not.

Are you sure you're getting new errors after you changed LogContent to No? I mean maybe still you're getting the same error for previous emails? Because scheduler service tries to send all pending emails. Could you check do you have any email on service center > monitoring > email with status 'Pending'

"String or binary data would be truncated" is a known database error that means you're trying to insert a record to a table but your content length is bigger then column length.

Have you ever try to decrease the content length of your email? or Did you check how many MB you're trying to send in the attachment?

With best regards,
F. Karatay

Hello Erdem,

This is strange. It is not common to have an error logging the email content. 

In fact, it seems you have two different errors: one that is a problem of data truncating (that generates an exception), and then the problem of trying to create a record in the email content table.

I would say that the truncate error happens, causing a rollback, and then when the service that sends the mail tries to store the content, it fails because the email does not exist anymore... (this is just guessing, of course).

Do you have any operation after the SendMail statement in your logic, that is creating or updating a record in the database and could be trying to save data that does not fit in the field (like a text bigger than the size of the entity attribute)?

Cheers

Hi Kumar,

I dont have any INSERT action. Only i m sending mail.

Hi Ferhat,

Thanks for answer. I cant see anything in monitoring about this I guess its could not create log. Problem is in production environment therefore I can't see data content. I tried replicate this etc. attached file with big size but i could not.