fflib-apex-common icon indicating copy to clipboard operation
fflib-apex-common copied to clipboard

Unable to deploy: no "System Administrator" or "Read Only" profiles

Open matrix818181 opened this issue 10 years ago • 4 comments
trafficstars

I get the following message when I try to deploy on my production environment. It's weird because I was able to deploy the same package on my sandbox.

From what I can understand, the "unit test user" is not able to create new user for test.

Can somebody help me ? I really need to be able to install the package on my prod environment.

Thx

Deployment CompleteTest failure, method: fflib_SecurityUtilsTest.readonly_field_access -- System.QueryException: List has no rows for assignment to SObject stack Class.fflib_SecurityUtilsTest.setupTestUser: line 38, column 1 Class.fflib_SecurityUtilsTest.readonly_field_access: line 56, column 1

Test failure, method: fflib_SecurityUtilsTest.readonly_objectAndField_access -- System.QueryException: List has no rows for assignment to SObject stack Class.fflib_SecurityUtilsTest.setupTestUser: line 38, column 1 Class.fflib_SecurityUtilsTest.readonly_objectAndField_access: line 153, column 1

Test failure, method: fflib_SecurityUtilsTest.readonly_object_access -- System.QueryException: List has no rows for assignment to SObject stack Class.fflib_SecurityUtilsTest.setupTestUser: line 38, column 1 Class.fflib_SecurityUtilsTest.readonly_object_access: line 99, column 1

Test failure, method: fflib_SecurityUtilsTest.sysadmin_objectAndField_access -- System.QueryException: List has no rows for assignment to SObject stack Class.fflib_SecurityUtilsTest.setupTestUser: line 38, column 1 Class.fflib_SecurityUtilsTest.sysadmin_objectAndField_access: line 238, column 1

matrix818181 avatar Aug 20 '15 20:08 matrix818181

Are you by chance set to a non-English language as the user running the deployment? The issue seems to be that there are no profiles name "Read Only" or "System Administrator" available.

If that's the case, then sadly there's no way to make references to these profiles without hard-coding the name, a gap I really, really wish Salesforce would fix. I did just get an interesting idea that might help us make this more portable if that is indeed the problem. For an immediate solution, try changing the deploying user's language to English temporarily.

capeterson avatar Aug 22 '15 02:08 capeterson

It seems my idea for a way to fine profiles regardless of user locale is viable. If you confirm that your issue is from running as a non-English user I'll get it implemented here soonish.

capeterson avatar Aug 22 '15 04:08 capeterson

@capeterson Assuming the answer is yes, are you able to contribute your idea?

afawcett avatar Mar 22 '16 22:03 afawcett

Also getting this issue when language is changed to Spanish, English users work fine.

Aequitas737 avatar Sep 02 '19 02:09 Aequitas737