Error Message

During migration or mailbox processing, you may see the following error:

The request failed. The underlying connection was closed: An unexpected error occurred on a send.

Problem Description

This error is a network-level failure that commonly occurs during EWS migrations, especially when migrating a large number of items or large mailbox data.

The connection between the migration tool and Exchange Online is unexpectedly closed while sending data.

This is a temporary issue, not a permanent failure.

Common Causes

1. EWS Server Forcibly Closing the Connection

Exchange/Office 365 may terminate the connection when it detects:

  • Too many requests in a short time
  • Too many open or concurrent connections
  • Long-running upload operations
  • Large mailbox items (attachments, large MIME messages)

2. ServicePoint / TLS Idle Timeout (.NET)

In some cases, the .NET framework closes idle connections after a short timeout.

This typically occurs when:

  • Large items are being transferred
  • Network speed is slow
  • The connection remains idle for too long during upload

As a result, the connection is aborted and the error is returned.

Important Notes

  • This error does not indicate data corruption or mailbox issues.
  • Exchange Online automatically allows connections again after a short time.
  • No tenant-side configuration changes are required.

Resolution

Wait and Retry (Recommended)

  1. Pause the migration or affected operation.
  2. Wait a few minutes (typically 5–15 minutes).
  3. Retry the operation.

The migration should resume successfully once the temporary condition clears.

Best Practices

  • Avoid running too many parallel migrations at the same time
  • Allow sufficient delay between retries
  • Migrate large mailboxes during off-peak hours when possible

Summary

The “Underlying connection was closed” error during EWS migrations is a temporary network or service-protection issue caused by high load, large items, or timeout conditions. Waiting briefly and retrying the operation usually resolves the issue.