CumulusCI icon indicating copy to clipboard operation
CumulusCI copied to clipboard

release_unlocked_beta doesn't work when an install key is specified

Open krishnakolluneocol opened this issue 2 years ago • 2 comments

Describe the bug

When I use the "cci flow run release_unlocked_beta --org dev" command, and specify an install key using the install_key yaml option for the create_package_version task, the package version creates, but later, it fails when it tries to query the SubscriberPackageVersion object. This error prevents the rest of the release_unlocked_beta from running

Error Details

Error: Malformed request https://neocol.my.salesforce.com/services/data/v52.0/tooling/query/?q=SELECT+Dependencies+FROM+SubscriberPackageVersion+WHERE+Id%3 D%2704t8W000003JjVhQAK%27. Response content: [{'message': 'Please provide installationkey when querying against SubscriberPackageVersion that is protected by installationkey', 'errorCode': 'INSTALL_KEY_REQUIRED'}]

[Success]: Package creation successful [05/02/23 17:05:50] Exception in task create_package_version

Reproduction steps

  1. In the cumulusci.yml file, override the install_key option for create_package_version to some value
  2. Run cci flow run release_unlocked_beta --org dev
  3. The package version will create, but it will fail when the task executes a query against the SubscriberPackageVersion object

Your CumulusCI and Python versions

CumulusCI version: 3.75.1 (/Users/kollu/.local/bin/cci) Python version: 3.11.1 (/Users/kollu/.local/pipx/venvs/cumulusci/bin/python)

Operating System

Mac

Windows environment

No response

CumulusCI installation method

None

Error Gist

No response

Additional information

I was able to fix the issue locally by copying the create_package_version.py script from the cumulusci repo, and change the query as follows

install_key = self.options.get('install_key')
query = f"SELECT Dependencies FROM SubscriberPackageVersion WHERE Id = '{package2_version['SubscriberPackageVersionId']}'"
if install_key:
    query += f" AND InstallationKey = '{install_key}'"

Can you make a similar change to your repo so that you pass over the installation key if provided?

krishnakolluneocol avatar May 03 '23 13:05 krishnakolluneocol

Looks like this is an issue with release_unlocked_production as well:


kollu@Krishnas-MacBook-Pro Solution_AsyncActionFramework % cci flow run release_unlocked_production --org dev
[05/03/23 09:21:05] ============================================================                    
                    Initializing flow: FlowCoordinator (release_unlocked_production)                
                    Promote the latest beta 2GP unlocked package version and create a new release in
                    GitHub                                                                          
                    ============================================================                    
                                                                                                    
                    Verifying and refreshing credentials for the specified org: dev.                
                    Getting org info from Salesforce CLI for [email protected]          
[05/03/23 09:21:16] Org info updated, writing to keychain                                           
                    ------------------------------------------------------------                    
                    Organization:                                                                   
                      Username: [email protected]                                       
                        Org Id: 00DDR000000rRSh                                                     
                      Instance: CS251                                                               
                    ------------------------------------------------------------                    
                                                                                                    
                    ------------------------------------------------------------                    
                    Steps:                                                                          
                    Description: Promote the latest beta 2GP unlocked package version and create a  
                    new release in GitHub                                                           
                                                                                                    
                    Flow Steps                                                                      
                    1) task: promote_package_version [from current folder]                          
                    2) task: github_release                                                         
                    3) task: github_release_notes                                                   
                    ------------------------------------------------------------                    
                                                                                                    
                    Starting execution                                                              
                    ============================================================                    
                                                                                                    
                    ------------------------------------------------------------                    
                    Running task: promote_package_version                                           
                    ------------------------------------------------------------                    
                                                                                                    
                    Options:                                                                        
                    Getting org info from Salesforce CLI for NeocolDevHub                           
[05/03/23 09:21:18] Beginning task: PromotePackageVersion                                           
                                                                                                    
                    No version_id specified. Automatically resolving to latest available Beta       
                    version.                                                                        
[05/03/23 09:21:20] Resolved to version: 04t8W000003JjWpQAK                                         
                                                                                                    
[05/03/23 09:21:21] Exception in task promote_package_version                                       

Error: Malformed request 
https://neocol.my.salesforce.com/services/data/v55.0/tooling/query/?q=SELECT+Id%2C+Dependencies%2C+R
eleaseState%2C+SubscriberPackageId+FROM+SubscriberPackageVersion+WHERE+Id%3D%2704t8W000003JjWpQAK%27
. Response content: [{'message': 'Please provide installationkey when querying against 
SubscriberPackageVersion that is protected by installationkey', 'errorCode': 
'INSTALL_KEY_REQUIRED'}]

krishnakolluneocol avatar May 03 '23 13:05 krishnakolluneocol

Just hit this today. Seems like CumulusCI effectively doesn't support install keys as only 1-2 tasks can actually work with it.

yippie avatar Aug 02 '23 16:08 yippie