[Office 365 Connector] String or binary data would be truncated?

[Office 365 Connector] String or binary data would be truncated?

  
Forge Component
(23)
Published on 2015-11-27 by João Martins
23 votes
Published on 2015-11-27 by João Martins

In continuing to try to get the Office365Connector Demo to work, our network administrator, in his words, "switched us from V2.0 to V1.0"

I am still getting the same Error 400 (bad request) message but the detail in the Error Log is different:


String or binary data would be truncated.
The statement has been terminated.
Environment InformationeSpaceVer: 2 (Id=621, PubId=625, CompiledWith=10.0.816.0)
RequestUrl: https://hrc-dev.outsystemsenterprise.com/Office365Connector/Callback.aspx?code=AQABAAIAAADX8GCi6Js6SK82TsD2Pb7rx3ndsZAC4GQ5JPYQZIuLgibflH4bca2aby6ON6njA8MJ3coVD1o__YmNkriN45N5U4TYo1Ho16M9kfO2zLR8aEQkK0OgY9dmkghXwENVxhyGKsAMrXl1poWQfX4wiLAzjjQzsMOp35lm2bRIZ4D78hUA3SRqrp-L82vch4MDTJpLsqSv_5xTsMEGNUhN73WmqKbLM3Othyj9szjB59icCAt7UkD7b31xLN5IOooQKtIvKr_Dp1-EWRLXFIsoN47lb6WKENWud3syjYMQo06F2_osvznWCqjZYWQDcTHt9I98F8fDJUN6y7_Bv7Kl7y67HzbrxNz1Z8H63RO0ArMQ8KRcxptWUuK-i3ylHGJVQ3W--_F-DEK9f5XBQjLPrHSXG5VImeAXoK8rXQ6L-dORq2XbnkuLoSRFZBVPEa9_wEvraAaQAeJhCCiSyT2E-xQVDTsNbi0c5XFOCF-vEIb9yRpA5fu35OBNwc4-6Oxby2unr3orffjSu988wwdPtke2ecFhnkJukF2kD7m9j94RwhvSU2IepbIGJiOkBFB414DWc_exlSl1guLzzAa8TPtItlVCfGq1y9HAsr8Sq5qYl4qpK_SV4cA4XdYgm05LiDlEvH4Vok5pTqNl8a5DJ1G4YtZk4S4rbolyQIyOytgT6SP06O9O7oDJtjSK7HTwzlM3T6KMvykSsZcYBtNecLkN-MLkLb446jUEgrvUiFVuqvAR76bH6MNf3aOkauUEBcMBSQFK6KGR3Me4kaKCVxpHpjupRVHHhye4-sFiol9ZRCAA&state=72259466-4c8d-449c-96c8-37282f9f1805&session_state=0c44dbe2-b06d-4759-bfe0-4489e314ddb0 (Method: GET)
AppDomain: /LM/W3SVC/1/ROOT/Office365Connector-17-131753698997228888
FilePath: d:\OutSystems\Platform Server\running\Office365Connector.426566037\CallbackPage.aspx
ClientIp: 12.30.156.2
Locale: en-US
DateFormat: MM-dd-yyyy
PID: 980 ('w3wp', Started='7/5/2018 9:14:21 PM', Priv=746Mb, Virt=9421Mb)
TID: 9
Thread Name:
.NET: 4.0.30319.42000
Stack:String or binary data would be truncated.
The statement has been terminated.
   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.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
   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.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at OutSystems.HubEdition.Extensibility.Data.ExecutionService.BaseExecutionService.ExecuteNonQuery(IDbCommand cmd)
   at OutSystems.Internal.Db.Command.ExecuteNonQuery(String description, Boolean isApplication, Boolean skipLog, Boolean applyTransformationsToParameters)
   at ssOffice365Connector.ExtendedActions.CreateOrUpdateTokenRequest(HeContext heContext, BitArray usedFields, RCTokenRequestRecord inParamSource, Int32& outParamId)
   at ssOffice365Connector.Actions.ActionOffice_OAuth2_GetToken(HeContext heContext, String inParamCode, String inParamSessionCode, STGetTokenResponseStructure& outParamResponse)
   at ssOffice365Connector.Flows.FlowConfiguration.ScrnCallbackPage.Preparation(HeContext heContext)
   at ssOffice365Connector.Flows.FlowConfiguration.ScrnCallbackPage.Page_Load(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint

Do you have any thoughts on what might be causing that or how I can diagnose it farther?  Any help would be much appreciated.

Dave Schuler

Hi Dave, it seems we are really close! I would say it is failing when inserting the token information into the database which means you were able to get the token :) Can you debug the code and check which field could possibly be causing this error? Or maybe activate the full logging level on the rest API that gets the token and check if the length of the values you are getting are suitable for the length of each field.

Hope this helps

Cheers