Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Attachment gives error in private endpoint enabled bot #6771

Open
SyedFayaz opened this issue Apr 9, 2024 · 0 comments
Open

File Attachment gives error in private endpoint enabled bot #6771

SyedFayaz opened this issue Apr 9, 2024 · 0 comments
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.

Comments

@SyedFayaz
Copy link

SyedFayaz commented Apr 9, 2024

Version

4.12.0

Bot Composer Versions:

Version: 2.1.3-nightly.364675.1a93f21
Electron: 14.2.6
Chrome: 93.0.4577.82
NodeJS: 14.17.0
V8: 9.3.345.20-electron.0

Describe the bug

Getting below error in bot when attachment is uploaded
Error getting value from 'ReadTimeout' on 'System.IO.MemoryStream'

To Reproduce

Steps to reproduce the behavior:

  1. Make sure private endpoint is enabled in Bot Service
  2. Add file attachment dialogs
  3. Run the webchat sample code with createDirectLineAppServiceExtension
  4. Upload any file - You will see Error getting value from 'ReadTimeout' on 'System.IO.MemoryStream'

Expected behavior

File should be attached successfully

Screenshots

image
image

Additional Error

Getting below error in Azure App Service Logs kudu logs

[OnTurnError] unhandled error : Error getting value from 'ReadTimeout' on 'System.IO.MemoryStream'.

Exception:
Newtonsoft.Json.JsonSerializationException: Error getting value from 'ReadTimeout' on 'System.IO.MemoryStream'.
---> System.InvalidOperationException: Timeouts are not supported on this stream.
at System.IO.Stream.get_ReadTimeout()
at lambda_method(Closure , Object )
at Newtonsoft.Json.Serialization.ExpressionValueProvider.GetValue(Object target)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Serialization.ExpressionValueProvider.GetValue(Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)
at Microsoft.Bot.Builder.Dialogs.ObjectPath.GetNormalizedValue(Object value, Boolean json)
at Microsoft.Bot.Builder.Dialogs.ObjectPath.SetObjectSegment(Object obj, Object segment, Object value, Boolean json)
at Microsoft.Bot.Builder.Dialogs.ObjectPath.SetPathValue(Object obj, String path, Object value, Boolean json)
at Microsoft.Bot.Builder.Dialogs.DialogSet.CreateContextAsync(ITurnContext turnContext, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.Dialogs.DialogExtensions.RunAsync(Dialog dialog, ITurnContext turnContext, IStatePropertyAccessor`1 accessor, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialogBot.OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.SetSpeakMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.ShowTypingMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.MiddlewareSet.ReceiveActivityWithStatusAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.BotAdapter.RunPipelineAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken)
Failed to read frame from transport.

Exception:
System.IO.InvalidDataException: header type delimeter is malformed
at Microsoft.Bot.Streaming.Payloads.HeaderSerializer.Deserialize(Byte[] buffer, Int32 offset, Int32 count)
at Microsoft.Bot.Connector.Streaming.Transport.TransportHandler.TryParseHeader(ReadOnlySequence`1& buffer, Header& header)
at Microsoft.Bot.Connector.Streaming.Transport.TransportHandler.ListenAsync(CancellationToken cancellationToken)

@SyedFayaz SyedFayaz added bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team. labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.
Projects
None yet
Development

No branches or pull requests

1 participant