microsoft / microsoft/powerplatform-vscode

Error while exporting entities with "pac data export" and "pac tool cmt"

Open
#1,162 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
277
Forks
60
Avg merge
1d 1h
Merged PRs (30d)
14

Description

Im facing this issue on a 64 bit system. At the very end of the export, I get the following error as cmt converts the data to data.xml file:

Command: pac data export -env https://xxxxxxx.crm.dynamics.com -v -df .\Downloads\prod_export.zip -sf "D:\prod_setup.xml" -o

`
Entity Export Process Complete
Writting output file : C:\Users\srbonham1\AppData\Local\Temp\wml5zczf.wa3\data.xml
Message: Exception Raised when Serializing Microsoft.Xrm.Tooling.Dmt.DataMigCommon.DataModel.Data.entities
Source : mscorlib
Method : CreateStringFromEncoding
Date : 3/22/2025
Time : 7:41:22 PM
Error : Exception of type 'System.OutOfMemoryException' was thrown.
Stack Trace : at System.String.CreateStringFromEncoding(Byte* bytes, Int32 byteLength, Encoding encoding)
at System.Text.UTF8Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)
at Microsoft.Xrm.Tooling.Dmt.DataMigCommon.Utility.Helper.Serialize[T](Object objToSerialize)

Failed to create output file`

Im exporting around 360K records.

36 Entities

Version:
Microsoft PowerPlatform CLI
Version: 1.39.3+g0f45f92
64 bit version

Windows 10, 64 Bit.

Machine has 128GB. Theres around 93GB available at the time the crash occured.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported pac data export command and the pac tool cmt serialization failure in the issue, focusing on the System.OutOfMemoryException from Helper.Serialize while writing data.xml. Reproduce with a comparable large export and determine what is required for the export to create its output file successfully.

Written by the indexing model from the issue text.

Assessment

Domain
cli, data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.