4

When doing a sfdx force:source:pull command from my scratch org to collect my metadata changes made to Custom Labels, I get the following error:

ERROR: Metadata API received improper input. Please ensure file name and capitalization is correct. Load of metadata from db failed for metadata of type:Profile and file name:admin. sfdx force:source:pull ended with exit code 1

I had just recently created the scratch org and deployed an existing code base to the org. I have been working with a couple other scratch orgs and have not previously had this issue.

When getting a similar issue with the Trial Customer Portal User, I am able to modify the profile's name manually. However, since "Admin" is a standard profile, I cannot do this same workaround.

Has anybody come across a similar issue?

6

I am still not 100% sure why this happens between different scratch orgs, but I have found a solution:

The .forceignore file works for both source:push and source:pull commands, but in order to ignore a file during source:pull, you have to specify the exact file name as it would have in your org. In this case the exact file name was Admin.profile.

I had src/main/default/profiles/Admin.profile-meta.xml in my .forceignore file, assuming that this maps to the corresponding Admin.profile file in the org, but that is not the case.

In summary, I now have two separate parts of the .forceignore file. The first part specifies anything that I don't want to source:pull from any of my scratch orgs, and the second part specifies anything that I don't want to force:push.

I hope this is helpful to somebody searching a similar problem in the future.

2

This is a Known Issue and there are a couple workarounds posted at https://success.salesforce.com/issues_view?id=a1p3A000000EUd7QAG

1

I been having the same issue, I think its because when creating new fields I was adding profile permissions to the new fields.

After looking at some of the DX Trailhead modules it appears that you should deselect all field level security when creating the field and manage security through Permission Sets. See Trailhead instruction below.

Create a Custom Field

To build this app, we’re going to first create a custom field on the Account object. The easiest way is to use setup tools that exist in the scratch org.

Open the scratch org: sfdx force:org:open

In the Fields & Relationships section, click New.

For the Data Type, select Geolocation, then click Next.

Enter these details, then click Next:

Field Label: Location Latitude and Longitude Display Notation: Decimal Decimal Places: 7 Field Name: Location

Click Visible to select all field-level security profiles, then click it again to deselect them all.

In the Visible column, select Standard User. Click Next, then Save.

Next, define a permission set to control field level access to the newly created location field.

0

I was facing the same problem. I fixed it by:

  • Renaming the "Trial Customer Portal User" to lower case: "trial customer portal user"
  • Creating a new profile called "admin".

PS: That's just a workaround in order to continue pulling your code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.