Problem to send EMAIL - Error creating Email. profile name is not valid

Good morning !!! Before I came here to ask for help, I searched for similar problems of mine but none of them helped me. 

I'm having problem to send Email (which started without doing any changes on email configurations). Every time I call "Send Email" Action, its raising this error:

"An error was raised by the application: Error create Email. profile name is not valid

An error was raised during trigger execution. The batch has been aborted and the user transaction, if any, has bens rolled back"

The error occur only in development environment, in productions is ok.

I read something about sql server issues during sending email, but I don't use sql server to send, only OutSystems (I think maybe Outsystems use it to send).

Anyone here faced similar problem like this?

Really appreciate any help.

Thank you


Hi Guilherme,

If you look at the bottom two lines in the stack:

'OutSystems.HubEdition.DatabaseProvider.SqlServer.ExecutionService.ExecutionService.ExecuteScalar(IDbCommand cmd)

   at OutSystems.Internal.Db.Command.ExecuteScalar(String description, Boolean isApplication, Boolean skipLog, Boolean applyTransformationsToParameters)

   at OutSystems.HubEdition.RuntimePlatform.DBRuntimePlatformSqlServer.SaveEmail(Transaction tran, String from, String to, String cc, String bcc, String subject, Byte[] content, Int32 contentlen, Int32 activityId, Int32 tenantId, Int32 eSpaceId, String emailDefSSKey, Boolean storeContent, String messageId, Boolean enableEmails, String testEmails)

at OutSystems.HubEdition.RuntimePlatform.Email.EmailProcessor.CreateEmail(String bodyUrl, String emailSubject, String emailBody, String from, String to, String cc, String bcc, Int32 activityId, Int32 tenantId, Int32 eSpaceId, String emailDefSSKey, Boolean storeContent, List`1 headers, List`1 attachments, String realHostname)

   at ModuleName.Flows.FlowRelatorios.ScrnActionName.Render(HtmlTextWriter writer)'

It's possible to see that the email creation is falling when trying to create the email record in that data base.

Remember that the emails in OutSystems are sent asynchronously and a record needs to be created to the send engine can pick it up.

Is everything ok with the database? Does the user you're using has access to create records in that table?´

To check the email logs just go to Monitoring -> Email in Service Center.

Hope it helps,

Ricardo Pisco.

Hello Ricardo, 

thank you for your help.

I will take a look with the database team to check if everything is ok.

And about the email logs, it is not logging anything there since the problem begun. It only show the error through "Monitoring -> Erros" in Service Center. 

Hello,

Do you have any screenshots of the logic that you can provide for us? 

-Bryan 

Hello,

Thanks for answering. I have the stack trace:

Do you know if Outsystems save the logs of emails sent in database? I'm asking because it's returning this error message and I wondering from where it is coming from.

Stack:

profile name is not valid

An error was raised during trigger execution. The batch has been aborted and the user transaction, if any, has been rolled back.

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

   at OutSystems.HubEdition.DatabaseProvider.SqlServer.ExecutionService.ExecutionService.ExecuteReader(IDbCommand cmd)

   at OutSystems.HubEdition.DatabaseProvider.SqlServer.ExecutionService.ExecutionService.ExecuteScalar(IDbCommand cmd)

   at OutSystems.Internal.Db.Command.ExecuteScalar(String description, Boolean isApplication, Boolean skipLog, Boolean applyTransformationsToParameters)

   at OutSystems.HubEdition.RuntimePlatform.DBRuntimePlatformSqlServer.SaveEmail(Transaction tran, String from, String to, String cc, String bcc, String subject, Byte[] content, Int32 contentlen, Int32 activityId, Int32 tenantId, Int32 eSpaceId, String emailDefSSKey, Boolean storeContent, String messageId, Boolean enableEmails, String testEmails)

   at OutSystems.HubEdition.RuntimePlatform.Email.EmailProcessor.CreateEmail(String bodyUrl, String emailSubject, String emailBody, String from, String to, String cc, String bcc, Int32 activityId, Int32 tenantId, Int32 eSpaceId, String emailDefSSKey, Boolean storeContent, List`1 headers, List`1 attachments, String realHostname)

   at ModuleName.Flows.FlowRelatorios.ScrnActionName.Render(HtmlTextWriter writer)

Hi Guilherme,

If you look at the bottom two lines in the stack:

'OutSystems.HubEdition.DatabaseProvider.SqlServer.ExecutionService.ExecutionService.ExecuteScalar(IDbCommand cmd)

   at OutSystems.Internal.Db.Command.ExecuteScalar(String description, Boolean isApplication, Boolean skipLog, Boolean applyTransformationsToParameters)

   at OutSystems.HubEdition.RuntimePlatform.DBRuntimePlatformSqlServer.SaveEmail(Transaction tran, String from, String to, String cc, String bcc, String subject, Byte[] content, Int32 contentlen, Int32 activityId, Int32 tenantId, Int32 eSpaceId, String emailDefSSKey, Boolean storeContent, String messageId, Boolean enableEmails, String testEmails)

at OutSystems.HubEdition.RuntimePlatform.Email.EmailProcessor.CreateEmail(String bodyUrl, String emailSubject, String emailBody, String from, String to, String cc, String bcc, Int32 activityId, Int32 tenantId, Int32 eSpaceId, String emailDefSSKey, Boolean storeContent, List`1 headers, List`1 attachments, String realHostname)

   at ModuleName.Flows.FlowRelatorios.ScrnActionName.Render(HtmlTextWriter writer)'

It's possible to see that the email creation is falling when trying to create the email record in that data base.

Remember that the emails in OutSystems are sent asynchronously and a record needs to be created to the send engine can pick it up.

Is everything ok with the database? Does the user you're using has access to create records in that table?´

To check the email logs just go to Monitoring -> Email in Service Center.

Hope it helps,

Ricardo Pisco.

Hello Ricardo, 

thank you for your help.

I will take a look with the database team to check if everything is ok.

And about the email logs, it is not logging anything there since the problem begun. It only show the error through "Monitoring -> Erros" in Service Center. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.