Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with sf-cli Command: Unable to Retrieve Specific Static Resource #2959

Closed
Alfystar opened this issue Jul 17, 2024 · 11 comments
Closed
Labels
investigating We're actively investigating this issue more information required Issue requires more information or a response from the customer validated Version information for this issue has been validated

Comments

@Alfystar
Copy link

Summary

Hello Salesforce Support Team,

I hope this message finds you well.

I am encountering an issue with the sf-cli tool when attempting to retrieve metadata from my org. Specifically, the problem arises when using the following command:

sf org list metadata --metadata-type {metaType} --target-org '{self.alias}' --json

With the appropriate parameters, I receive a list of resources. However, when I attempt to retrieve these resources, the process consistently fails on one particular resource: icrt__AeMobileStaticResources.

Here is the command I use for the retrieval:

sf project retrieve start --target-org DevInt_RM --ignore-conflicts --manifest fullRetrieve_Orgs/DevInt_RM/package_StaticResource_51.xml --output-dir fullRetrieve_Orgs/DevInt_RM/retrievePack/dir_52 --wait 240

And the error message I receive is as follows:

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                                                                                                                  ┃
┃ $> sf project retrieve start --target-org DevInt_RM --ignore-conflicts --manifest fullRetrieve_Orgs/DevInt_RM/package_StaticResource_51.xml --output-dir fullRetrieve_Orgs/DevInt_RM/retrievePack/dir_52 --wait 240                              ┃
┃ [StaticResource_51] Error command execution:                                                                                                                                                                                                     ┃
┃ Retrieving v56.0 metadata from [email protected] using the v61.0 SOAP API                                                                                                                                          ┃
┃  ›   Warning: @salesforce/cli update available from 2.8.11 to 2.49.7.                                                                                                                                                                            ┃
┃ Preparing retrieve request...                                                                                                                                                                                                                    ┃
┃ (node:16799) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.                                                              ┃
┃ (Use `node --trace-warnings ...` to show where the warning was created)                                                                                           
Preparing retrieve request... ⣾ Sending request to org                                                                                                              
Preparing retrieve request... ⣽ Sending request to org                                                                                                              
Preparing retrieve request... ⣻ Sending request to org                                                                                                              
Preparing retrieve request... ⢿ Sending request to org                                                                                                              
Preparing retrieve request... ⡿ Sending request to org                                                                                                              
Preparing retrieve request... ⣟ Waiting for the org to respond                                                                                                      
Preparing retrieve request... ⣯ Waiting for the org to respond                                                                                                      
Preparing retrieve request... ⣷ Waiting for the org to respond                                                                                                      
Preparing retrieve request... ⣾ Waiting for the org to respond                                                                                                      
Preparing retrieve request... ⣽ Waiting for the org to respond                                                                                                      
Preparing retrieve request... ⣻ Waiting for the org to respond                                                                                                      
Preparing retrieve request... ⢿ Waiting for the org to respond                                                                                                      
Preparing retrieve request... MetadataTransferError                                                                                                                                                                                    ┃
┃ Error (1): Metadata API request failed: Unable to open zip file unpackaged/staticresources/icrt__AeMobileStaticResources.resource for icrt__AeMobileStaticResources (unpackaged/staticresources/icrt__AeMobileStaticResources.resource-meta.xml) ┃
┃                                                                                                                                                                                                                                                  ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

I have also checked the org from which I obtained the list and searched for all static resources containing “icrt” in their names, but the resulting list is empty.
image

image

I believe this might be a bug with the sf org list metadata command or another related issue. Could you please assist me in resolving this?

Thank you for your help and support.

Best regards,

Emanuele

System Information

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.49.7",
  "nodeVersion": "node-v20.15.0",
  "osVersion": "Darwin 23.5.0",
  "rootPath": "/Users/ea_enel/.local/share/sf/client/2.49.7-e83764e",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.1.5 (core)",
    "@oclif/plugin-commands 4.0.5 (core)",
    "@oclif/plugin-help 6.2.4 (core)",
    "@oclif/plugin-not-found 3.2.8 (core)",
    "@oclif/plugin-plugins 5.3.3 (core)",
    "@oclif/plugin-search 1.2.1 (core)",
    "@oclif/plugin-update 4.4.6 (core)",
    "@oclif/plugin-version 2.2.5 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.7 (core)",
    "@oclif/plugin-which 3.2.5 (core)",
    "@salesforce/cli 2.49.7 (core)",
    "apex 3.2.3 (core)",
    "auth 3.6.31 (core)",
    "data 3.5.3 (core)",
    "deploy-retrieve 3.9.12 (core)",
    "info 3.3.15 (core)",
    "limits 3.3.16 (core)",
    "marketplace 1.2.17 (core)",
    "org 4.3.3 (core)",
    "packaging 2.7.0 (core)",
    "schema 3.3.17 (core)",
    "settings 2.3.7 (core)",
    "sobject 1.4.16 (core)",
    "source 3.5.1 (core)",
    "telemetry 3.6.1 (core)",
    "templates 56.3.1 (core)",
    "trust 3.7.13 (core)",
    "user 3.5.17 (core)",
    "sfdx-plugin-source-read 1.2.0 (user) published 266 days ago (Tue Oct 24 2023)"
  ]
}
@Alfystar Alfystar added the investigating We're actively investigating this issue label Jul 17, 2024
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@github-actions github-actions bot added the validated Version information for this issue has been validated label Jul 17, 2024
@mshanemc
Copy link
Contributor

Do you have an ICRT (afaik, that's InformaticaCloudRealTime) package installed in the org?

@mshanemc mshanemc added the more information required Issue requires more information or a response from the customer label Jul 17, 2024
@mshanemc
Copy link
Contributor

what I did using @salesforce/cli/2.51.6 darwin-arm64 node-v20.15.0

  1. install the icrt package sf package install --package 04t5c000000o7Tk -o icrt --wait 60 in a scratch org
  2. retrieve that resource into my project sf project retrieve start -o icrt -m StaticResource:icrt__AeMobileStaticResources (works fine)
  3. retrieve that resource into a different dir sf project retrieve start -o icrt -m StaticResource:icrt__AeMobileStaticResources --output-dir output (works fine)
  4. create a manifest for it like sf project generate manifest --metadata StaticResource:icrt__AeMobileStaticResources which results in
    <types>
        <members>icrt__AeMobileStaticResources</members>
        <name>StaticResource</name>
    </types>
    <version>53.0</version>
</Package>

then retrieve that via sf project retrieve start -o icrt --manifest package.xml --output-dir output (also works fine).

Can you replicate it with another org, like maybe this one is returning a broken response?

@Alfystar
Copy link
Author

Hi @mshanemc
Now I'm going to try to replicate the problem on a scratch org, but while doing more testing I came across another problem that I believe is related.

I'm running the retrieve of other packages, in this case all layouts, always generated with the same tactic I described before, and I end up with this xml package:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>copado__Copado_Protected_Settiing__mdt-Copado key Layout</members>
        <members>copado__Copado_Setting__mdt-Copado Setting Layout</members>
        <members>copado__Copado_Smart_Help__mdt-Copado Smart Help Layout</members>
        <members>copado__Data_Template_Setup__mdt-Data Template Setup Layout</members>
        <members>copado__Data_Template__c-Data Template Layout</members>
        <members>copado__Deployment_Flow_Step__c-Deployment Flow Step Layout</members>
        <members>copado__Deployment_Flow__c-Deployment Flow Layout</members>
        <members>copado__Deployment_History__c-Copado Deployment History Layout</members>
        <members>copado__Deployment_Job__c-Deployment Job Layout</members>
        <members>copado__Deployment_Task__c-Deployment Task Layout</members>
        <members>copado__Deployment__c-Deployment Layout</members>
        <members>copado__Destination_Org__c-Destination Org Layout</members>
        <members>copado__Environment__c-Environment Layout</members>
        <members>copado__Environmental_Variable__c-Environment Variable Layout</members>
        <members>copado__Epic__c-Epic Layout</members>
        <members>copado__External_CI_Job_Result__c-External CI Job Result Layout</members>
        <members>copado__External_CI_Job__c-External CI Job Layout</members>
        <members>copado__External_CI_Setting__c-External CI Setting Layout</members>
        <members>copado__Filter__c-Filter Layout</members>
        <members>copado__Git_Backup__c-Git Backup Layout</members>
        <members>copado__Git_Backup__c-Git Snapshot Layout</members>
        <members>copado__Git_Commit__c-Git Commit Layout</members>
        <members>copado__Git_Org_Commit__c-Git Org Commit Layout</members>
        <members>copado__Git_Org_Commit__c-Snapshot Commit Layout</members>
        <members>copado__Git_Repository__c-Git Repository Layout</members>
        <members>copado__Git_Repository__c-Git Server Layout</members>
        <members>copado__Kanban_Board_View__c-Kanban Board View Layout</members>
        <members>copado__Kanban_Board__c-Kanban Board Layout</members>
        <members>copado__Metadata_Group_Item__c-Metadata Group Item Layout</members>
        <members>copado__Metadata_Group_Item__c-Metadata Item Layout</members>
        <members>copado__Metadata_Group_Item__c-Metadata Template Item Layout</members>
        <members>copado__Metadata_Group__c-Metadata Group Layout</members>
        <members>copado__OrgDiff__c-Org Difference Layout</members>
        <members>copado__OrgDiff__c-OrgDiff Layout</members>
        <members>copado__Org__c-Org Credential Layout</members>
        <members>copado__Org__c-Org Layout</members>
        <members>copado__Persona_Permission__c-Persona Permission Layout</members>
        <members>copado__Persona__c-Persona Layout</members>
        <members>copado__Project__c-Project Layout</members>
        <members>copado__Promoted_User_Story__c-Promoted User Story Layout</members>
        <members>copado__Promotion__c-Promotion Layout</members>
        <members>copado__Pull_Request_Review__c-Pull Request Review Layout</members>
        <members>copado__Pull_Request__c-Pull Request Layout</members>
        <members>copado__Quality_Gate__c-Quality Gate Layout</members>
        <members>copado__Release__c-Release Layout</members>
        <members>copado__Scheduled_Job_Run__c-Scheduled Job Result Layout</members>
        <members>copado__Scheduled_Job__c-Scheduled Job Layout</members>
        <members>copado__Scratch_Org_Definition__c-Scratch Org Definition Layout</members>
        <members>copado__Scratch_Org_Project_Template__c-Scratch Org Artifacts Template Layout</members>
        <members>copado__Selenium_Group_Org_Credential__c-Selenium Group Org Credential Layout</members>
        <name>Layout</name>
    </types>
</Package>

Through the code I proceeded to create an output directory and launched the retrieve command:

10:05:00 ~/Documents/01_repo/sfdc-ci-enel-mercato  (release/R2_2024)
└─▶ $ mkdir -p fullRetrieve_Orgs/DevInt_RM/retrievePack/dir_528             
10:09:12 ~/Documents/01_repo/sfdc-ci-enel-mercato  (release/R2_2024)
└─▶ $ sf project retrieve start --target-org DevInt_RM --ignore-conflicts --manifest fullRetrieve_Orgs/DevInt_RM/package_Layout_22.xml --output-dir fullRetrieve_Orgs/DevInt_RM/retrievePack/dir_528 --wait 240
Retrieving v56.0 metadata from [email protected] using the v61.0 SOAP API
Preparing retrieve request... Succeeded
Error (ENOENT): ENOENT: no such file or directory, stat '/Users/ea_enel/Documents/01_repo/sfdc-ci-enel-mercato/fullRetrieve_Orgs/DevInt_RM/retrievePack/dir_528/main/default'

I then tried to make him happy by adding the 2 directories (which in theory wouldn't even be needed):

10:09:19 ~/Documents/01_repo/sfdc-ci-enel-mercato  (release/R2_2024)
└─▶ $ mkdir -p fullRetrieve_Orgs/DevInt_RM/retrievePack/dir_528/main/default
10:10:17 ~/Documents/01_repo/sfdc-ci-enel-mercato  (release/R2_2024)
└─▶ $ sf project retrieve start --target-org DevInt_RM --ignore-conflicts --manifest fullRetrieve_Orgs/DevInt_RM/package_Layout_22.xml --output-dir fullRetrieve_Orgs/DevInt_RM/retrievePack/dir_528 --wait 240
(node:27546) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
Retrieving v56.0 metadata from [email protected] using the v61.0 SOAP API
Preparing retrieve request... Succeeded
 ›   Warning: Nothing retrieved

Warnings
======================================================================================================================================================
| File                   Problem                                                                                                                       
| ────────────────────── ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Environment__c-Environment Layout' cannot be found                                     
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Kanban_Board_View__c-Kanban Board View Layout' cannot be found                         
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Metadata_Group__c-Metadata Group Layout' cannot be found                               
| unpackaged/package.xml Entity of type 'Layout' named 'copado__OrgDiff__c-Org Difference Layout' cannot be found                                      
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Data_Template__c-Data Template Layout' cannot be found                                 
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Git_Backup__c-Git Backup Layout' cannot be found                                       
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Environmental_Variable__c-Environment Variable Layout' cannot be found                 
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Org__c-Org Credential Layout' cannot be found                                          
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Project__c-Project Layout' cannot be found                                             
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Copado_Setting__mdt-Copado Setting Layout' cannot be found                             
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Data_Template_Setup__mdt-Data Template Setup Layout' cannot be found                   
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Scheduled_Job__c-Scheduled Job Layout' cannot be found                                 
| unpackaged/package.xml Entity of type 'Layout' named 'copado__External_CI_Setting__c-External CI Setting Layout' cannot be found                     
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Kanban_Board__c-Kanban Board Layout' cannot be found                                   
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Release__c-Release Layout' cannot be found                                             
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Git_Backup__c-Git Snapshot Layout' cannot be found                                     
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Metadata_Group_Item__c-Metadata Template Item Layout' cannot be found                  
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Quality_Gate__c-Quality Gate Layout' cannot be found                                   
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Deployment_Flow__c-Deployment Flow Layout' cannot be found                             
| unpackaged/package.xml Entity of type 'Layout' named 'copado__OrgDiff__c-OrgDiff Layout' cannot be found                                             
| unpackaged/package.xml Entity of type 'Layout' named 'copado__External_CI_Job__c-External CI Job Layout' cannot be found                             
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Git_Commit__c-Git Commit Layout' cannot be found                                       
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Org__c-Org Layout' cannot be found                                                     
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Promoted_User_Story__c-Promoted User Story Layout' cannot be found                     
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Selenium_Group_Org_Credential__c-Selenium Group Org Credential Layout' cannot be found 
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Git_Repository__c-Git Server Layout' cannot be found                                   
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Filter__c-Filter Layout' cannot be found                                               
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Persona_Permission__c-Persona Permission Layout' cannot be found                       
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Promotion__c-Promotion Layout' cannot be found                                         
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Copado_Protected_Settiing__mdt-Copado key Layout' cannot be found                      
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Metadata_Group_Item__c-Metadata Item Layout' cannot be found                           
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Git_Org_Commit__c-Snapshot Commit Layout' cannot be found                              
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Deployment_Job__c-Deployment Job Layout' cannot be found                               
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Git_Repository__c-Git Repository Layout' cannot be found                               
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Git_Org_Commit__c-Git Org Commit Layout' cannot be found                               
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Pull_Request__c-Pull Request Layout' cannot be found                                   
| unpackaged/package.xml Entity of type 'Layout' named 'copado__External_CI_Job_Result__c-External CI Job Result Layout' cannot be found               
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Scheduled_Job_Run__c-Scheduled Job Result Layout' cannot be found                      
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Scratch_Org_Definition__c-Scratch Org Definition Layout' cannot be found               
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Scratch_Org_Project_Template__c-Scratch Org Artifacts Template Layout' cannot be found 
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Copado_Smart_Help__mdt-Copado Smart Help Layout' cannot be found                       
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Deployment_Task__c-Deployment Task Layout' cannot be found                             
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Epic__c-Epic Layout' cannot be found                                                   
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Destination_Org__c-Destination Org Layout' cannot be found                             
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Deployment_Flow_Step__c-Deployment Flow Step Layout' cannot be found                   
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Deployment__c-Deployment Layout' cannot be found                                       
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Metadata_Group_Item__c-Metadata Group Item Layout' cannot be found                     
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Deployment_History__c-Copado Deployment History Layout' cannot be found                
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Pull_Request_Review__c-Pull Request Review Layout' cannot be found                     
| unpackaged/package.xml Entity of type 'Layout' named 'copado__Persona__c-Persona Layout' cannot be found                                             

I deduce that the first error is due to a lack of sf-cli which first generates an empty folder while extracting, and then gives an error, I think this is already something to fix...
In any case, I'm bringing it back here, because this list of resources was always obtained with the:

sf org list metadata --metadata-type Layout > layoutList.json

And in this case, here's what I read for some of them:

{
  "createdById": "00524000001VhXEAA0",
  "createdByName": "AE43352",
  "createdDate": "2016-01-30T18:50:17.000Z",
  "fileName": "layouts/copado__Org__c-Org Layout.layout",
  "fullName": "copado__Org__c-Org Layout",
  "id": "00h24000005YUdgAAG",
  "lastModifiedById": "00524000001VhXEAA0",
  "lastModifiedByName": "AE43352",
  "lastModifiedDate": "2016-01-30T18:50:44.000Z",
  "manageableState": "installed",
  "namespacePrefix": "copado",
  "type": "Layout"
},
{
  "createdById": "00524000001VhXEAA0",
  "createdByName": "AE43352",
  "createdDate": "2016-01-30T18:50:16.000Z",
  "fileName": "layouts/copado__Deployment_Flow_Step__c-Deployment Flow Step Layout.layout",
  "fullName": "copado__Deployment_Flow_Step__c-Deployment Flow Step Layout",
  "id": "00h24000005YUdTAAW",
  "lastModifiedById": "00524000001VhXEAA0",
  "lastModifiedByName": "AE43352",
  "lastModifiedDate": "2016-01-30T18:50:42.000Z",
  "manageableState": "installed",
  "namespacePrefix": "copado",
  "type": "Layout"
},
...

I can already tell you that copado is also an installed library, like ICRT (which I have also verified is installed in this sandbox):

ICRT && Copado installation screenshot

image

In the case of copado there are also Apex classes that have been found without problems, so... please help me

@mshanemc
Copy link
Contributor

your 2nd issue we already know about (mdapi/list omitting the namespace for layouts). see #2168

let's keep this issue focused on replicating your StaticResource problem

@Alfystar
Copy link
Author

Alfystar commented Jul 19, 2024

Hi @mshanemc
Forgive me for the delay, unfortunately I had a busy day at work yesterday.
Anyway, here's my use case:

  1. Following the Dreamhouse repository (https://github.com/trailheadapps/dreamhouse-lwc) i create a sandbox. (Step 1 to 8)

  2. Then i run my code, and this is the output (the cmd execute is sf-cli standard interface), the outcome is positive here 🤯 :

8:55:10 ~/Documents/01_repo/dreamhouse-lwc  (main)
└─▶ $ fullRetrieve.py --alias dreamhouse --whiteList StaticResource --retrieve --sub-split 50
>> Detect default packageDirectories from sfdx-project.json, equal to: force-app/main/default
[dreamhouse] 
[dreamhouse] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[dreamhouse] >> Change system default org to: 'dreamhouse'
[dreamhouse] └─▶ $ sf config set target-org 'dreamhouse'
[dreamhouse] (node:4215) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabli [22 B]
[dreamhouse] (Use `node --trace-warnings ...` to show where the warning was created)
[dreamhouse] Set Config
[dreamhouse] ===============================
[dreamhouse] | Name       Value      Success 
[dreamhouse] | ────────── ────────── ─────── 
[dreamhouse] | target-org dreamhouse true    

Add mandatory type, according with the metadata request by the user...

>> fullRetrieve_Orgs/dreamhouse exists, archived inside: '00_Archive/fullRetrieve/2024-07-19_08-55-48_dreamhouse'

Start 'listMetadata' operation with 4 worker...

100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:06<00:00,  6.61s/MetaType]

>> Filter/Grouping resources types to generate the minimum package necessary...


Store command 1° list inside 'fullRetrieve_Orgs/dreamhouse/retrieveCmd.sh'
╔═════════════════════════════════════════════════════════════════════════════╗
║ Starting retrieve process. Start time "08:55:54" (Relax, may take minutes!) ║
╚═════════════════════════════════════════════════════════════════════════════╝
Execute retrieves command with 4 workers...
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:06<00:00,  6.31s/Connections]
Time to retrieve each group: (hh:mm:ss)
   1) 0:00:06 - StaticResource_0
╔══════════════════════════════════════════╗
║ Time elapsed: 0:00:06                    ║
║ Linear time:  0:00:06                    ║
║ Time save:    -1 day, 23:59:59 (--0.04%) ║
╚══════════════════════════════════════════╝
Merging directories: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 30.28dir/s]

[Warning] For 13 files read process fail, no validation was apply.
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Full-Retrieve end with SUCCESS ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

And this is the package_StaticResource_0.xml generete by the code using sf org list metadata information:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>icrt__AeMobileStaticResources</members>
        <members>icrt__AeVersionProperties</members>
        <members>leafletjs</members>
        <members>sample_data_brokers</members>
        <members>sample_data_contacts</members>
        <members>sample_data_properties</members>
        <name>StaticResource</name>
    </types>
</Package>

I thought the problem might be caused by using a manifest, but I see that in this scratch org everything is fine 😢

But if I try to do the same thing on the enterprise sandbox, those 2 resources fail.

How can I give you a better debug of what's going on?

@Alfystar
Copy link
Author

Alfystar commented Jul 19, 2024

I tried running the same commands as the dreamhouse repository in a sandbox created by Salesforce Playground.
But even there it continues to work normally...

Unfortunately today in the office there are connection problems, and I cannot redo the test on our sandbox.
But until yesterday it was still failing.

Installed Package in Playground org

image

Installed Package in Sandbox Org

image

As you can see, in the our sandbox the version are 1.24, in the Playground is 1.26.
Maybe can be this the difference?


StaticResource in Playground org

image

StaticResource in Sandbox Org (query with prefix name ictr)

I noticed that in the message I gave you earlier, when I did the filter on StaticResource I did a search on the name while I should have done on the prefix

image

I'm waiting for your other ideas to be able to capture the problem and solve it 😄

@mshanemc
Copy link
Contributor

I hate to say this, but sometimes an Org is just...weird. The fact that it works on all the other orgs so far means it's probably not something the CLI team can fix.

Do you have other sandboxes that have the same problem (existing sbox or a new one). If it's, "yeah, all my sandboxes do that" then maybe we can get an sbox and open a bug for [some team sbox? mdapi? staticResource?]

If it's just that one bad org, then it's probably not something I can even get anyone to respond to and I'll close this.

@Alfystar
Copy link
Author

Hi @mshanemc
I understand what you're saying, unfortunately I often had the same feeling...

In any case I re-tested the problem on our PreProd org, which is a Prod-aligned full-sandbox, and this is the output:

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                                                                                                                                      ┃
┃ $> sf project retrieve start --target-org PreProd --ignore-conflicts --manifest fullRetrieve_Orgs/PreProd/package_StaticResource_10.xml --output-dir fullRetrieve_Orgs/PreProd/retrievePack/dir_10 --wait 240                                                        ┃
┃ [StaticResource_10] Error command execution:                                                                                                                                                                                                                         ┃
┃ Retrieving v56.0 metadata from [email protected] using the v61.0 SOAP API                                                                                                                                                                           ┃
┃ (node:6142) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.                                                                                   ┃
┃ (Use `node --trace-warnings ...` to show where the warning was created)                                                                                                                                                                                              ┃
┃ Preparing retrieve request... Sending request to org                                                                                                                                                                                                                 ┃
┃ Preparing retrieve request... Waiting for the org to respondPreparing retrieve request... In ProgressPreparing retrieve request... MetadataTransferError                                                                                                             ┃
┃ Error (MetadataTransferError): Metadata API request failed: Unable to open zip file unpackaged/staticresources/icrt__AeMobileStaticResources.resource for icrt__AeMobileStaticResources (unpackaged/staticresources/icrt__AeMobileStaticResources.resource-meta.xml) ┃
┃                                                                                                                                                                                                                                                                      ┃
┃                                                                                                                                                                                                                                                                      ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

and I can confirm that by commenting the 2 ictrs the package.xml works.

I honestly don't understand what the problem is, but it affects all our Orgs on which I've been able to test it, I think it might be worth looking into further, something else interesting might come up

@mshanemc
Copy link
Contributor

but it affects all our Orgs on which I've been able to test it,
Interesting. It doesn't affect your scratch orgs.

  1. Are all the affected orgs sandboxes?
  2. Does the prod org also have the same problem if you try to retrieve from it? (if NOT, then maybe it's a sandbox copy problem?)
  3. If you uninstall/reinstall the icrt package in an affected sandbox, does the issue persist (IF the copy is the problem, but it works ok from a fresh install)
  4. if you retrieve the package or use mdapi format (--target-metadata-dir --unzip) is the zip file that comes down for that static resource bad, like maybe you can't unzip it?

I'm trying to differentiate between

  1. ICRT shipped a bad zip file in a package version, maybe via push update, and Salesforce servers/apis are providing the expected responses (and hopefully they already fixed it and if not you can let them know)
  2. ICRT package is fine and there's something wrong with these orgs or the API (and you therefore need a Salesforce Support case).

Either way, I'm going to close this because the CLI can't help and it seems limited to one package or a certain group of orgs.

@Alfystar
Copy link
Author

I discussed the idea of ​​trying to update the package with my team, we decided to wait because, apart from this failed retrieve, everything else works and we can't be sure that the new package won't cause regressions in production, but thanks for the support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating We're actively investigating this issue more information required Issue requires more information or a response from the customer validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

2 participants