Unable to Retrieve Object(s) using Metadata API due to Queue with dangling User reference in LastModifiedById field
Salesforce closed this issue.
Summary
If a Queue has the LastModifiedById field set to a non-existent user on the Org, it will prevent the Object(s) the Queue is related to, from being retrieved. An error message(as below) will be thrown instead.
"Metadata API received improper input. Please ensure file name and capitalization is correct. Load of metadata from db failed for metadata of type:CustomObject and file name:Lead."
The only way that a Queue could end up in this state is when creating a Developer or Developer Pro Sandbox.
Developer and Developer Pro Sandboxes do not copy Portal Users during Sandbox refresh.
If a Portal User modified a queue, and ends up in the LastModifiedById field, and then the Sandbox is created or refreshed, it will impact the retrieval of object(s) related to the Queue because the Queue is copied, but the User is not.
"Metadata API received improper input. Please ensure file name and capitalization is correct. Load of metadata from db failed for metadata of type:CustomObject and file name:Lead."
The only way that a Queue could end up in this state is when creating a Developer or Developer Pro Sandbox.
Developer and Developer Pro Sandboxes do not copy Portal Users during Sandbox refresh.
If a Portal User modified a queue, and ends up in the LastModifiedById field, and then the Sandbox is created or refreshed, it will impact the retrieval of object(s) related to the Queue because the Queue is copied, but the User is not.
Workaround
We haven't loaded the full details for this issue yet. Check the official page.
History
First tracked here as Closed with 1 report
Nov 30, 2026
Also open in ALM
Performance Degradation Message Queue Processing on multiple sandbox instances
Solution ScheduledWorkaroundPlatform / ALMSummer '22Reported May 19, 2022605 reports605reports
sfdx mdapi:deploy RunSpecifiedTests using REST API results in JSON_PARSER_ERROR
Solution ScheduledPlatform / ALMSummer '20Reported Oct 20, 2020129 reports129reports
Patch org creation failure due to permission or feature discrepancy between dev org and patch org
Solution ScheduledPlatform / ALMSpring '19Reported Jul 8, 2019112 reports112reports
Issue with User/System Permissions in PermissionSet when installed via Unlocked Package
In ReviewPlatform / ALMReported Apr 12, 202139 reports39reports