forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
486 stars 78 forks source link

ERROR running force:source:retrieve: Cannot read property 'fileName' of undefined #400

Closed grdixit65 closed 2 years ago

grdixit65 commented 4 years ago

Getting this error when retriving components using VS code sfdx force:source:retrieve --manifest ERROR running force:source:retrieve: Cannot read property 'fileName' of undefined

Here us Package.XML ==>

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

* ApexClass * ApexComponent * ApexPage * ApexTestSuite * ApexTrigger * AuraDefinitionBundle * LightningComponentBundle * StaticResource 48.0

CLI version ==>

sfdx-cli/7.57.1-dbf54fc584 win32-x64 node-v10.15.3

clairebianchi commented 4 years ago

@grdixit65 it looks like one of the metadata types you are using is failing can you please pinpoint the type that you are unable to retrieve and we can get the team that owns it to fix the issue. thank you for reporting

grdixit65 commented 4 years ago

@clairebianchi it is "AuraDefinitionBundle" causing issue.

I saw this is very old issue since 2017 repeats after few releases.

aritram1 commented 4 years ago

Hi, for me it is happening when I tried with in package.xml

What I was trying:

Creare a blank project in VS code with SF extension and authorize a developer instance and then retrieving the components based on package.xml. I tried with class, trigger, TestSuite, Aura comp etc but only when I add lwc component with * (to retrieve all lwc in my org) I get that error. Version is 47.0 in package.xml. SFDX version : sfdx-cli/7.36.0 Win32 node-v10.15.3

Let me know if you need any more details.

@clairebianchi

agnivesh29 commented 3 years ago

Hi,

I am facing same issue and it occurs when "LightningComponentBundle" is present in manifest.

can this be addressed at the earliest please?

version 49.0

carlthress commented 3 years ago

I'm experiencing the same issue. It seems to have started when the dev org I'm working from updated to Winter 2021 (version 50.0). Tried changing the version on my package.xml file, but that didn't fix it. Only worked after removing the "LightningComponentBundle" section. Ok for now, as I'm working on apex, but I rely on VS Code for working with LWCs, as well, so the sooner this can get fixed the better.

palyam commented 3 years ago

Same issue here, addding "LightningComponentBundle" to package.xml throws this error.

Cannot read property 'fileName' of undefined

shetzel commented 3 years ago

This is a duplicate of #496 so I'll close it out in favor of that one, which was reported first. The fix will be in the next patch release.

shetzel commented 3 years ago

Actually this one was first, sorry. Doesn't matter...it'll be fixed asap.

Mohhamada commented 3 years ago

Also having the same issue

ERROR running force:source:retrieve: Cannot read property 'fileName' of undefined

sfdx-cli 7.82.0 (core)

nguyent90 commented 3 years ago

Same error for me using on Window OS. sfdx-cli/7.83.0

ffernandes69 commented 3 years ago

I'm experiencing this issue too

nbparrell commented 3 years ago

I am experiencing this issue.

I needed to remove

 <types>
        <members>*</members>
        <name>AuraDefinitionBundle</name>
    </types>

From my package.xml for it to work. Error I am receiving when running it while in there is:


    ERROR running force:source:retrieve:  Cannot read property 'fileName' of undefined 
*** Internal Diagnostic ***

TypeError: Cannot read property 'fileName' of undefined
    at Function.getMetadataFileNameFromBundleFileProperties (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\bundlePathHelper.js:42:48)
    at Function.getPathFromBundleTypeFileProperties (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\bundlePathHelper.js:36:43)
    at AuraDefinitionBundleMetadataType.getDefaultAggregateMetadataPath (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\metadataTypeImpl\bundleMetadataType.js:31:52)
    at SourceWorkspaceAdapter.processMdapiFileProperty (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\sourceWorkspaceAdapter.js:286:59)
    at C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\sourcePullApi.js:166:22
    at Array.forEach (<anonymous>)
    at MdapiPullApi._syncDownSource (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\sourcePullApi.js:158:31)      
    at SourceRetrieve.retrieveFromManifest (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\sourceRetrieve.js:177:64)
    at async SourceRetrieve.retrieve (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\sourceRetrieve.js:57:27)     
    at async SourceRetrieveCommand.execute (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\sourceRetrieveCommand.js:32:16)
    at async SourceRetrieveCommand.execLegacyCommand (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\ToolbeltCommand.js:149:29)
    at async SourceRetrieveCommand.run (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\commands\force\source\retrieve.js:32:16)
    at async SourceRetrieveCommand._run (C:\Program Files\Salesforce CLI\client\node_modules\@salesforce\command\lib\sfdxCommand.js:93:40)
    at async Config.runCommand (C:\Program Files\Salesforce CLI\client\node_modules\@oclif\config\lib\config.js:173:24)
    at async Main.run (C:\Program Files\Salesforce CLI\client\node_modules\@oclif\command\lib\main.js:27:9)
    at async Main._run (C:\Program Files\Salesforce CLI\client\node_modules\@oclif\command\lib\command.js:43:20)
Outer stack:
    at Function.wrap (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\node_modules\@salesforce\core\lib\sfdxError.js:171:27)       
    at SourceRetrieveCommand.catch (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\ToolbeltCommand.js:248:46)
    at async SourceRetrieveCommand._run (C:\Program Files\Salesforce CLI\client\node_modules\@salesforce\command\lib\sfdxCommand.js:97:13)
    at async Config.runCommand (C:\Program Files\Salesforce CLI\client\node_modules\@oclif\config\lib\config.js:173:24)
    at async Main.run (C:\Program Files\Salesforce CLI\client\node_modules\@oclif\command\lib\main.js:27:9)
    at async Main._run (C:\Program Files\Salesforce CLI\client\node_modules\@oclif\command\lib\command.js:43:20)
    at async Object.run (C:\Program Files\Salesforce CLI\client\dist\cli.js:32:20)
******

  sfdx:SourceRetrieveCommand ERROR [
  sfdx:SourceRetrieveCommand   '\u001b[1mERROR running force:source:retrieve: \u001b[22m',
  sfdx:SourceRetrieveCommand   "\u001b[31mCannot read property 'fileName' of undefined\u001b[39m",
  sfdx:SourceRetrieveCommand   '\u001b[31m\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m*** Internal Diagnostic ***\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     "\u001b[31mTypeError: Cannot read property 'fileName' of undefined\u001b[39m\n" +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at Function.getMetadataFileNameFromBundleFileProperties (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\bundlePathHelper.js:42:48)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at Function.getPathFromBundleTypeFileProperties (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\bundlePathHelper.js:36:43)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at AuraDefinitionBundleMetadataType.getDefaultAggregateMetadataPath (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\metadataTypeImpl\\bundleMetadataType.js:31:52)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at SourceWorkspaceAdapter.processMdapiFileProperty (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceWorkspaceAdapter.js:286:59)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourcePullApi.js:166:22\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at Array.forEach (<anonymous>)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at MdapiPullApi._syncDownSource (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourcePullApi.js:158:31)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at SourceRetrieve.retrieveFromManifest (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceRetrieve.js:177:64)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at async SourceRetrieve.retrieve (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceRetrieve.js:57:27)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at async SourceRetrieveCommand.execute (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceRetrieveCommand.js:32:16)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at async SourceRetrieveCommand.execLegacyCommand (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\ToolbeltCommand.js:149:29)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at async SourceRetrieveCommand.run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\commands\\force\\source\\retrieve.js:32:16)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at async SourceRetrieveCommand._run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:93:40)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at async Config.runCommand (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@oclif\\config\\lib\\config.js:173:24)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at async Main.run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@oclif\\command\\lib\\main.js:27:9)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at async Main._run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@oclif\\command\\lib\\command.js:43:20)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31mOuter stack:\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at Function.wrap (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\node_modules\\@salesforce\\core\\lib\\sfdxError.js:171:27)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at SourceRetrieveCommand.catch (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\ToolbeltCommand.js:248:46)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at async SourceRetrieveCommand._run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:97:13)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at async Config.runCommand (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@oclif\\config\\lib\\config.js:173:24)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at async Main.run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@oclif\\command\\lib\\main.js:27:9)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at async Main._run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@oclif\\command\\lib\\command.js:43:20)\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m    at async Object.run (C:\\Program Files\\Salesforce CLI\\client\\dist\\cli.js:32:20)\u001b[39m\n' +    
  sfdx:SourceRetrieveCommand     '\u001b[31m******\u001b[39m\n' +
  sfdx:SourceRetrieveCommand     '\u001b[31m\u001b[39m'
  sfdx:SourceRetrieveCommand ] +50s

FIXED:

File Path: C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\bundlePathHelper.js

Changed


 static getMetadataFileNameFromBundleFileProperties(fullName, bundleFileTypeProperties) {
        const bundleName = fullName.split(path.sep)[0];

        const matchingBundle = bundleFileTypeProperties.find(fileProperty => fileProperty.fullName.split(path.sep)[0] === bundleName);
        return `${path.basename(matchingBundle.fileName)}${MetadataRegistry.getMetadataFileExt()}`;
    }

to

 static getMetadataFileNameFromBundleFileProperties(fullName, bundleFileTypeProperties) {
        const bundleName = fullName.split('/')[0];

        const matchingBundle = bundleFileTypeProperties.find(fileProperty => fileProperty.fullName.split(path.sep)[0] === bundleName);
        return `${path.basename(matchingBundle.fileName)}${MetadataRegistry.getMetadataFileExt()}`;
    }
qwikag commented 3 years ago

Sorry how is this Closed or Fixed The issue is still there. the bad code is still there. Fixing it means deploying it to the stable branch before Closing the Bug.

Xander567 commented 3 years ago

Also getting this error. Fresh install of sfcli and sf extensions pack in vscode.

z4chry commented 3 years ago

Freshly installed VSCode and Salesforce Extensions pack.

Getting this error when trying to retrieve from manifest: 11:27:14.245 sfdx force:source:retrieve --manifest c:\Users\myUsername\VScode code\Partial\manifest\package.xml ERROR running force:source:retrieve: Cannot read property 'fileName' of undefined

This is the error I get when trying to retrieve using Org Browser: 11:31:31.753 sfdx force:source:retrieve --json --loglevel fatal -m LightningComponentBundle:training { "status": 1, "name": "TypeError", "message": "Cannot read property 'fileName' of undefined", "exitCode": 1, "commandName": "SourceRetrieveCommand", "stack": "TypeError: Cannot read property 'fileName' of undefined\n at Function.getMetadataFileNameFromBundleFileProperties (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\bundlePathHelper.js:42:48)\n at Function.getPathFromBundleTypeFileProperties (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\bundlePathHelper.js:36:43)\n at LightningComponentBundleMetadataType.getDefaultAggregateMetadataPath (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\metadataTypeImpl\\bundleMetadataType.js:31:52)\n at SourceWorkspaceAdapter.processMdapiFileProperty (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceWorkspaceAdapter.js:286:59)\n at C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourcePullApi.js:166:22\n at Array.forEach (<anonymous>)\n at MdapiPullApi._syncDownSource (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourcePullApi.js:158:31)\n at SourceRetrieve.retrieveFromManifest (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceRetrieve.js:177:64)\n at async SourceRetrieve.retrieve (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceRetrieve.js:65:27)\n at async SourceRetrieveCommand.execute (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceRetrieveCommand.js:32:16)\n at async SourceRetrieveCommand.execLegacyCommand (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\ToolbeltCommand.js:149:29)\n at async SourceRetrieveCommand.run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\commands\\force\\source\\retrieve.js:32:16)\n at async SourceRetrieveCommand._run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:93:40)\n at async Config.runCommand (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@oclif\\config\\lib\\config.js:173:24)\n at async Main.run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@oclif\\command\\lib\\main.js:27:9)\n at async Main._run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@oclif\\command\\lib\\command.js:43:20)\nOuter stack:\n at Function.wrap (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\node_modules\\@salesforce\\core\\lib\\sfdxError.js:171:27)\n at SourceRetrieveCommand.catch (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\ToolbeltCommand.js:248:46)\n at async SourceRetrieveCommand._run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:97:13)\n at async Config.runCommand (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@oclif\\config\\lib\\config.js:173:24)\n at async Main.run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@oclif\\command\\lib\\main.js:27:9)\n at async Main._run (C:\\Program Files\\Salesforce CLI\\client\\node_modules\\@oclif\\command\\lib\\command.js:43:20)\n at async Object.run (C:\\Program Files\\Salesforce CLI\\client\\dist\\cli.js:32:20)", "warnings": [] }

I do have another laptop setup with Visual Studio Code and Salesforce Extensions Pack that is working. The only difference between the working setup and broken configuration is the version of SFDX. Here is the configs:

Working Setup

Visual Studio Code Version: 1.52.1 (system setup) Commit: ea3859d4ba2f3e577a159bc91e3074c5d85c0523 Date: 2020-12-16T16:34:46.910Z Electron: 9.3.5 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Windows_NT x64 10.0.17763

SFDX sfdx-cli/7.81.0-7b953c80d1 win32-x64 node-v12.18.3

Salesforce Extensions Pack Salesforce extension pack = 50.14.0

Broken Setup

Visual Studio Code Version: 1.52.1 (system setup) Commit: ea3859d4ba2f3e577a159bc91e3074c5d85c0523 Date: 2020-12-16T16:34:46.910Z Electron: 9.3.5 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Windows_NT x64 10.0.17763

SFDX sfdx-cli/7.83.0-eba9c6a927 win32-x64 node-v12.18.3

Salesforce Extensions Pack Salesforce extension pack = 50.14.0

shetzel commented 3 years ago

Can you try the retrieve from vscode after enabling an experimental setting? Experimental: Deploy Retrieve is the setting id salesforcedx-vscode-core.experimental.deployRetrieve

WillieRuemmele commented 3 years ago

@z4chry @nbparrell Hi, I'm having the hardest time reproducing this issue on windows. I'm running

@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.5 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.5 (core)
analytics 1.12.1 (core)
auth 1.4.7 (core)
config 1.2.4 (core)
generator 1.1.5 (core)
salesforcedx 50.16.1 (core)
├─ limits 1.0.3 (core)
├─ schema 1.0.3 (core)
├─ user 1.0.11 (core)
├─ apex 0.1.4 (core)
├─ custom-metadata 1.0.11 (core)
├─ templates 50.4.0 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
└─ salesforce-alm 50.16.1 (core)
sfdx-cli 7.86.3 (core)
telemetry 1.0.1 (core)

with 3 different package.xml, LWC only,

<Package xmlns="http://soap.sforce.com/2006/04/metadata">
     <types>
        <members>*</members>
        <name>LightningComponentBundle</name>
    </types>
    <version>51.0</version>
</Package>

Aura only,

<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>AuraDefinitionBundle</name>
    </types>
    <version>51.0</version>
</Package>

Aura + LWC

<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>AuraDefinitionBundle</name>
    </types>
    <types>
        <members>*</members>
        <name> LightningComponentBundle</name>
    </types>
    <version>51.0</version>
</Package>

I'm able to sfdx force:source:retrieve -x package.xml without any errors, I'm able to sfdx force:source:retrieve -m LightningComponentBundle and sfdx force:source:retrieve -m AuraDefinitionBundle without errors. I'm even running $ sfdx force:source:retrieve -m LightningComponentBundle:lib "lib" is my bundle name without errors

@nbparrell while your fix above is no longer valid for that file, we are now normalizing all of the paths, and then path.sep should properly match, no matter where the path came from, or where it's going to.

If you see anything that I'm doing differently or that I'm missing please let me know!

nbparrell commented 3 years ago

@WillieRuemmele

So when going through and debugging, the issue I was seeing was that the file being retrieved was using '/' for it's path and not being normalized to '\' which as you have said would eliminate the need for a different path.sep. As for what you are doing different I am not sure. I have very limited knowledge regarding this extension, I had some free time to trouble shoot and fix my issue so that I could set up the environment on my computer. I am also not sure how the paths are initially being generated when pulling down from the org which is what I would assume is causing the issue, though I can't be sure since again I am not particularly familiar with the over all process. Where are you normalizing the paths so that you would only need to use the path.sep '\'. Is there a chance that certain naming conventions used when naming the bundles might interfere with the normalization process? Again shooting in the dark a bit but that would be the rabbit hole I would go down just to double check.

WillieRuemmele commented 3 years ago

Thanks for the response, I don't expect you to be an expert in how our tools work ;). Are you still seeing this issue on the cli versions I posted above? I'm quite confused on the activity on this issue because I'm not able to reproduce it, but obviously plenty of people are.

nbparrell commented 3 years ago

@WillieRuemmele

So one thing that I should mention, though I am not sure if it is a potential issue, is that I am storing my org on a seperate hard drive from the cli. So my project is on my D: drive where as the cli and visual studio code is on the C: drive.

I am currently on version 50.16.0 though I have not removed the changes or made any updates to that code so I am not seeing that issue. One issue I am seeing now is that when I try to retrieve from the manifest after the initial retrieval I am getting this error:


ERROR running force:source:retrieve:  Unexpected file found in package directory: D:\MedicalAlertSF\ConnectAmericaPartial\force-app\main\default\aura\AccountChangesPage\AccountChangesPage.auradoc\AccountChangesPage.auradoc 
*** Internal Diagnostic ***

UnexpectedFileFound: Unexpected file found in package directory: D:\MedicalAlertSF\ConnectAmericaPartial\force-app\main\default\aura\AccountChangesPage\AccountChangesPage.auradoc\AccountChangesPage.auradoc
    at Workspace.isValidSourcePath (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\workspace.js:171:35)       
    at Workspace.handleArtifact (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\workspace.js:154:18)
    at async Workspace.walk (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\workspace.js:144:36)
    at async Workspace.walk (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\workspace.js:146:17)
    at async Workspace.walk (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\workspace.js:146:17)
    at async Workspace.walk (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\workspace.js:146:17)
    at async Workspace.walk (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\workspace.js:146:17)
    at async Workspace.walk (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\workspace.js:146:17)
    at async Workspace.walkDirectories (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\workspace.js:131:13)   
    at async Workspace.initializeStateFull (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\workspace.js:99:9) 
    at async Workspace.init (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\workspace.js:46:17)
    at async Function.create (C:\Program Files\Salesforce CLI\client\node_modules\@salesforce\kit\lib\creatable.js:31:9)
    at async SourcePathStatusManager.init (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\sourcePathStatusManager.js:161:26)
    at async Function.create (C:\Program Files\Salesforce CLI\client\node_modules\@salesforce\kit\lib\creatable.js:31:9)
    at async SourceWorkspaceAdapter.init (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\source\sourceWorkspaceAdapter.js:60:21)
    at async Function.create (C:\Program Files\Salesforce CLI\client\node_modules\@salesforce\kit\lib\creatable.js:31:9)
Outer stack:
    at Function.wrap (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\node_modules\@salesforce\core\lib\sfdxError.js:171:27)   
    at SourceRetrieveCommand.catch (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\ToolbeltCommand.js:248:46)
    at async SourceRetrieveCommand._run (C:\Program Files\Salesforce CLI\client\node_modules\@salesforce\command\lib\sfdxCommand.js:97:13)        
    at async Config.runCommand (C:\Program Files\Salesforce CLI\client\node_modules\@oclif\config\lib\config.js:173:24)
    at async Main.run (C:\Program Files\Salesforce CLI\client\node_modules\@oclif\command\lib\main.js:27:9)
    at async Main._run (C:\Program Files\Salesforce CLI\client\node_modules\@oclif\command\lib\command.js:43:20)
    at async Object.run (C:\Program Files\Salesforce CLI\client\dist\cli.js:32:20)
******
qwikag commented 3 years ago

I too have this issue and have cli installed on C: and Workspace on D: (New Laptop build WIN10 Pro) I am not following the convo closely so sorry if out of touch. I fixed it by replacing the code with '/' as per @nbparrell comment.

or maybe it is fixed in the code and I am just seeing my changes are now the same as the new DL codebase. personally I am having issue with a whole other set of problems (Many problems, solve one anothe pops up.

BTW the std install is not the latest version, and hence an update is required, but this procedure needs to be communicated to the masses. I think the std download needs to be made from stable version.

Xander567 commented 3 years ago

BTW the std install is not the latest version, and hence an update is required, but this procedure needs to be communicated to the masses. I think the std download needs to be made from stable version.

That would explain why it wasn't working yesterday after a fresh install of the plugins and vscode and was working fine today. Haven't had any issues with retrieving the Aura Bundles today.

z4chry commented 3 years ago

Can you try the retrieve from vscode after enabling an experimental setting? Experimental: Deploy Retrieve is the setting id salesforcedx-vscode-core.experimental.deployRetrieve

@shetzel @WillieRuemmele Setting Experimental: Deploy Retrieve to true did fix the errors I was experiencing on sfdx-cli/7.83.0-eba9c6a927 win32-x64 node-v12.18.3. Alternatively, when I downgrade to sfdx-cli/7.81.0-7b953c80d1 win32-x64 node-v12.18.3 I didn't experience any errors.

All projects and program installations are located on the same drive.

ffernandes69 commented 3 years ago

I updated VS Code this morning and I can now retrieve Aura and LWC components

mbarbarelli commented 3 years ago

Encounter this error on sfdx force:source:pull, sfdx-cli/7.83.0-eba9c6a927 win32-x64 node-v12.18.3. Have also enabled Experimental: Deploy Retrieve, to no effect. Any updates?

kateluu-comdev commented 3 years ago

Hi team , @mshanemc

I am using Illuminated Cloud 2 on Win.x64, and facing the same issue while try to retrieve metadata for SFDX project via OAuthen connection . Tools version are below

SFDX plugins --core C:\Workplace\SFDX1>sfdx plugins --core @oclif/plugin-autocomplete 0.3.0 (core) @oclif/plugin-commands 1.3.0 (core) @oclif/plugin-help 3.2.2 (core) @oclif/plugin-not-found 1.2.4 (core) @oclif/plugin-plugins 1.10.0 (core) @oclif/plugin-update 1.4.0-3 (core) @oclif/plugin-warn-if-update-available 1.7.0 (core) @oclif/plugin-which 1.0.3 (core) @salesforce/sfdx-trust 3.6.0 (core) alias 1.1.10 (core) apex 0.2.2 (core) auth 1.6.1 (core) config 1.2.8 (core) custom-metadata 1.0.12 (core) data 0.4.12 (core) generator 1.1.7 (core) limits 1.2.1 (core) org 1.6.6 (core) salesforcedx 48.10.1 (48.10.1) ├─ @salesforce/sfdx-plugin-lwc-test 0.1.5 ├─ salesforce-alm 48.10.0 └─ salesforcedx-templates 48.8.0 schema 1.0.7 (core) sfdx-cli 7.106.3 (core) telemetry 1.2.2 (core) templates 51.5.0 (core) user 1.3.0 (core) package.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>LightningComponentBundle</name>
    </types>
    <version>45.0</version>
</Package>

Error message Retrieve Failed-Failed to retrieve metadata.-Status: FAILED - Message: TypeError - Cannot read property 'fileName' of undefined

Any update for this issue, please advice, thank a lot. Cheers, Kate

WillieRuemmele commented 3 years ago

Hi @kateluu-comdev

you can checkout the soon-to-be-announced beta source plugin by installing it with sfdx plugins:install @salesforce/plugin-source , and uninstalling it with sfdx plugins:uninstall @salesforce/plugin-source that should resolve these metadata-specific issues you're seeing.

Let me know how it goes 👍

kateluu-comdev commented 3 years ago

sfdx plugins:install @salesforce/plugin-source

Hi @WillieRuemmele , Thank for the suggestion , did apply the install and uninstall as propose, then got something new as below

Error Message

Failed to obtain the org list from the Salesforce CLI:
       • status = 1
       • message = Unexpected argument: --skipconnectionstatus
    See more help with --help

Log details when run the sfdx force:org:list --skipconnectionstatus --json

{
  "status": 1,
  "name": "Error",
  "message": "Unexpected argument: --skipconnectionstatus
See more help with --help",
  "exitCode": 1,
  "commandName": "OrgListCommand",
  "stack": "Error: Unexpected argument: --skipconnectionstatus
  See more help with --help
  at validateArgs (~\sfdx\\node_modules\\@oclif\\parser\\lib\\validate.js:10:19)  
  at Object.validate (~\sfdx\\node_modules\\@oclif\\parser\\lib\\validate.js:55:5)
  at Object.parse (~\\AppData\\Local\\sfdx\\node_modules\\@oclif\\parser\\lib\\index.js:28:7)  
  at OrgListCommand.parse (~\sfdx\\node_modules\\@oclif\\command\\lib\\command.js:86:41)
  at OrgListCommand.init (~\sfdx\\node_modules\\salesforce-alm\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:196:44)
 at async OrgListCommand._run (~\sfdx\\node_modules\\s
alesforce-alm\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:80:13)
 at async Config.runCommand (~\sfdx\\client\\7.106.3-4b5d171\\node_
modules\\@oclif\\config\\lib\\config.js:173:24)
 at async Main.run (~\\
AppData\\Local\\sfdx\\client\\7.106.3-4b5d171\\node_modules\\@oclif\\command\\lib\\main.js:
27:9)
 at async Main._run (~\sfdx\\client\\7.106.3-4b5
d171\\node_modules\\@oclif\\command\\lib\\command.js:43:20)
 at async Object.run (~\sfdx\\client\\7.106.3-4b5d171\\dist\\cli.js:114:21) Outer stack:
 at Function.wrap (~\sfdx\\node_modules\\salesforce-alm\\node_modules\\@salesforce\\core\\lib\\sfdxError.js:151:27)
 at OrgListCommand.catch (~\sfdx\\node_modules\\salesforce-alm\\dist\\ToolbeltCommand.js:246:46)
 at async OrgListCommand._run (~\sfdx\\node_modules\\salesforce-alm\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:85:13)
 at async Config.runCommand (~\sfdx\\client\\7.106.3-4b5d171\\node_modules\\@oclif\\config\\lib\\config.js:173:24)
 at async Main.run (~\sfdx\\client\\7.106.3-4b5d171\\node_modules\\@oclif\\command\\lib\\main.js:27:9)
 at async Main._run (~\sfdx\\client\\7.106.3-4b5d171\\node_modules\\@oclif\\command\\lib\\command.js:43:20)
 at async Object.run (~\sfdx\\client\\7.106.3-4b5d171\\dist\\cli.js:114:21)",
  "warnings": []
}
hemrag07 commented 3 years ago

Hi All, Getting error after the Salesforce CLi got update to this version sfdx-cli/7.113.0 win32-x64 node-v14.17.4

ERROR running force:source:deploy: Cannot read property 'id' of undefined

Any help will be much appreciated, I tried to downgrade to the lower version, but it complains about "System cannot find the path specified"

WillieRuemmele commented 3 years ago

Hi @hemrag07 while this error message is the same, that is a new bug. Could you please file a new information with all of the information