fflib-apex-common
fflib-apex-common copied to clipboard
Unable to deploy: no "System Administrator" or "Read Only" profiles
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
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.
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 Assuming the answer is yes, are you able to contribute your idea?
Also getting this issue when language is changed to Spanish, English users work fine.