apex-enterprise-patterns / fflib-apex-common

Common Apex Library supporting Apex Enterprise Patterns and much more!
BSD 3-Clause "New" or "Revised" License
913 stars 517 forks source link

Failed to deploy #357

Closed javaInSchool closed 3 years ago

javaInSchool commented 3 years ago

First I have successfully deployed on a new ORG this one lib: https://github.com/apex-enterprise-patterns/fflib-apex-mocks

but this one: https://github.com/apex-enterprise-patterns/fflib-apex-common/tree/master gives me a bundle of errors

Failures: deploy/labels/fflib-Apex-Common-CustomLabels.labels(fflib_QueryFactory_recursive_subquery_error):Not in package.xml deploy/labels/fflib-Apex-Common-CustomLabels.labels(fflib_QueryFactory_fieldset_wrong_sobject_error):Not in package.xml deploy/labels/fflib-Apex-Common-CustomLabels.labels(fflib_security_error_object_not_updateable):Not in package.xml deploy/labels/fflib-Apex-Common-CustomLabels.labels(fflib_security_error_object_not_readable):Not in package.xml deploy/labels/fflib-Apex-Common-CustomLabels.labels(fflib_security_error_object_not_insertable):Not in package.xml And so on, it is not full list

This is a part of task from trailhead in Apply Unit of Work Principles in Apex

What's wrong?

RanikaR commented 3 years ago

I had the same issue. I found this solved thread that helped: https://github.com/apex-enterprise-patterns/fflib-apex-common/issues/167 On the deployment page, before you click 'Login to Salesforce' type '7366576' to the Branch/Tag/Commit textbox. This worked for me.

ImJohnMDaniel commented 3 years ago

G'day @javaInSchool -- Can elaborate please on how you are deploying the framework? I have tried deploying the latest codebase to a scratch org and it worked for me.

stohn777 commented 3 years ago

Hi @javaInSchool

Per your original information, I went to the Trailhead module that you referenced and was able to install both packages -- mocks and commons.

image

Please review the instructions and re-attempt the installation. Perhaps a spurious issue arose that may not re-occur.

Thanks!

javaInSchool commented 3 years ago

G'day @javaInSchool -- Can elaborate please on how you are deploying the framework? I have tried deploying the latest codebase to a scratch org and it worked for me.

  1. On a trailhead page click the button "Deploy to salesforce"
  2. Next in a new window: Deploy to: Production / Developer Owner: financialforcedev Repository: fflib-apex-common Branch/Tag/Commit: leave empty
  3. Press the button "Login to salesforce"
  4. On a deploy page I push "deploy" button.
javaInSchool commented 3 years ago

I had the same issue. I found this solved thread that helped: #167 On the deployment page, before you click 'Login to Salesforce' type '7366576' to the Branch/Tag/Commit textbox. This worked for me.

That worked for me too. Thanks!!!

wimvelzeboer commented 3 years ago

I seem to run into a similar issue. Suddenly my automated script to rebuild-scratch-org (from the falcon template), started failing. The script basically does the following:

mkdir ./temp
cd ./temp
git clone https://github.com/apex-enterprise-patterns/fflib-apex-common.git
sfdx force:source:deploy -p ./fflib-apex-common/sfdx-source -u $SCRATCH_ORG_ALIAS

It fails with the following messages:

 sfdx force:source:deploy -p ./fflib-apex-common/sfdx-source -u apex-extensions-samplecode
*** Deploying with SOAP API ***
Deploy ID: 0AfJ000001iiQG6KAM
SOURCE PROGRESS | ██████████████████████████████░░░░░░░░░░ | 22/29 Components

=== Component Failures [24]
Type   Name                                                        Problem
─────  ──────────────────────────────────────────────────────────  ───────────────────────────────────────────────────────────────────────────────────────────────────────────────
Error  fflib_QueryFactory                                          Dependent class is invalid and needs recompilation:
                                                                    Class fflib_SecurityUtils : External string does not exist: fflib_security_error_object_not_insertable (56:24)
Error  fflib_SObjectSelector                                       Dependent class is invalid and needs recompilation:
                                                                    Class fflib_QueryFactory : Dependent class is invalid and needs recompilation:
                                                                    Class fflib_SecurityUtils : External string does not exist: fflib_security_error_object_not_insertable (56:24)
Error  fflib_SecurityUtils                                         External string does not exist: fflib_security_error_field_not_updateable (90:24)
Error  fflib_SecurityUtils                                         External string does not exist: fflib_security_error_field_not_readable (88:24)
Error  fflib_SecurityUtils                                         External string does not exist: fflib_security_error_field_not_insertable (86:24)
Error  fflib_SecurityUtils                                         External string does not exist: fflib_security_error_object_not_deletable (62:24)
Error  fflib_SecurityUtils                                         External string does not exist: fflib_security_error_object_not_updateable (60:24)
Error  fflib_SecurityUtils                                         External string does not exist: fflib_security_error_object_not_readable (58:24)
Error  fflib_SecurityUtils                                         External string does not exist: fflib_security_error_object_not_insertable (56:24)
Error  fflib_ApplicationTest                                       Dependent class is invalid and needs recompilation:
                                                                    Class fflib_SObjectSelector : Dependent class is invalid and needs recompilation:
                                                                    Class fflib_QueryFactory : Dependent class is invalid and needs recompilation:
                                                                    Class fflib_SecurityUtils : External string does not exist: fflib_security_error_object_not_insertable (56:24)
Error  fflib_QueryFactoryTest                                      Dependent class is invalid and needs recompilation:
                                                                    Class fflib_QueryFactory : Dependent class is invalid and needs recompilation:
                                                                    Class fflib_SecurityUtils : External string does not exist: fflib_security_error_object_not_insertable (56:24)
Error  fflib_SObjectSelectorTest                                   Dependent class is invalid and needs recompilation:
                                                                    Class fflib_SObjectSelector : Dependent class is invalid and needs recompilation:
                                                                    Class fflib_QueryFactory : Dependent class is invalid and needs recompilation:
                                                                    Class fflib_SecurityUtils : External string does not exist: fflib_security_error_object_not_insertable (56:24)
Error  fflib_SecurityUtilsTest                                     Dependent class is invalid and needs recompilation:
                                                                    Class fflib_SecurityUtils : External string does not exist: fflib_security_error_object_not_insertable (56:24)
Error  fflib_QueryFactory_crossobject_fieldsets_not_allowed_error  Not in package.xml
Error  fflib_QueryFactory_fieldset_wrong_sobject_error             Not in package.xml
Error  fflib_QueryFactory_recursive_subquery_error                 Not in package.xml
Error  fflib_QueryFactory_subquery_invalid_relationship            Not in package.xml
Error  fflib_security_error_field_not_insertable                   Not in package.xml
Error  fflib_security_error_field_not_readable                     Not in package.xml
Error  fflib_security_error_field_not_updateable                   Not in package.xml
Error  fflib_security_error_object_not_deletable                   Not in package.xml
Error  fflib_security_error_object_not_insertable                  Not in package.xml
Error  fflib_security_error_object_not_readable                    Not in package.xml
Error  fflib_security_error_object_not_updateable                  Not in package.xml

I was able to resolve the issue by simply renaming the Custom Labels file from 'fflib-Apex-Common-CustomLabels.labels-meta.xml' into 'CustomLabels.labels-meta.xml'. I have raised pull request #358 to resolve this

daveespo commented 3 years ago

As discussed over on #358 , this should be resolved later this week when the new version of the CLI is published (Aug 26)