forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
953 stars 405 forks source link

SFDXError with retrieve for Aura and LWC #2907

Closed marcopfluidogroup closed 3 years ago

marcopfluidogroup commented 3 years ago

Summary

Short summary of what is going on or to provide context.

Without apparent reason/change, since a couple of days I cannot use the command "retrieve source from org" anymore on LWC and Aura. I receive SFDX: retrieve source from Org failed to run. This appears ad error message reason in the output: ENOENT: no such file or directory. The command appears to work just fine for all the other metadata. The problem shows up in all my existing projects. If I create a new project with manifest (SFDX:create project with manifest), I receive this error message: Error re-indexing workspace: EISDIR: illegal operation on a directory, read and the resulting folder structure for Aura and LWC appears messed up. I include two screenshots in order of mention.

ErrorRetrieve CaptureErrorForBug

VS Code Version: 1.52.1

SFDX CLI Version: v50.14.0

OS and version: Microsoft Windows 10 Pro

lcampos commented 3 years ago

Hi @marcopfluidogroup , the EISDIR: illegal operation on a directory, read error means you do not have permissions to create or update files under that file path. Can you confirm you are creating the project in a location in your machine where you do have the correct system permissions to modify files ?

marcopfluidogroup commented 3 years ago

Hi @lcampos , yes it should be. It is a folder in my Desktop and that has been like that since several month. This issue showed up only very recently

Capture

lcampos commented 3 years ago

@marcopfluidogroup what about running those commands directly from the terminal ? Do they fail with the same error or actually succeed ?

marcopfluidogroup commented 3 years ago

@lcampos I tried from the terminal of VSCode and they fail nonetheless, the deploy command fails unless I manually fix the folder structure of the Aura Component while the retrieve command fails the same, even after "sanitizing" the folder structure. Example here:

Capture

It seems like the Folder structure gets another nesting when I initially retrieve

AshishSinghSFDC commented 3 years ago

Hi @lcampos ,

I'm also struggling with the same issue from last few days. Once I retrieve the package, both AURA and LWC component bundle file get's a nesting folder with the Error : Error re-indexing workspace: EISDIR: illegal operation on a directory, read. I'm using VS code editor for long time and haven't changed any permission or installed on my system. It is exactly same what @marcopfluidogroup has mentioned.

image

juandomenechh commented 3 years ago

I'm also having trouble at the moment of retrieveing files from Org. Until two days ago I had no problems with this, and I have not made any changes to user permissions or any other changes at all. The error I am getting is:

Starting SFDX: Retrieve Source from Org

10:00:30.998 sfdx force:source:retrieve --manifest c:\Users\JDOMENECH\.....\manifest\package.xml ERROR running force:source:retrieve: ENOENT: no such file or directory, open 'c:\Users\JDOMENECH\.....\force-app\main\default\lwc\caseRecordNotificationOff\caseRecordNotificationOff.js\caseRecordNotificationOff.js' 10:01:06.650 sfdx force:source:retrieve --manifest c:\Users\JDOMENECH\.....\manifest\package.xml ended with exit code 1

Any ideas on how to solve this? It stopped working from one minute to another.

Also getting this message of error: image

lcampos commented 3 years ago

I haven't been able to replicate this on my side on either Windows or Mac. I'm using version 7.84.2 of the CLI. Can someone on this thread provide which version of the CLI you are on and a sample of a project/component that consistently causes this issue ?

AshishSinghSFDC commented 3 years ago

Hi @lcampos , I'm on sfdx-cli/7.84.2 version.

AshishSinghSFDC commented 3 years ago

My issue has been resolved after updating CLI to the latest version.

lcampos commented 3 years ago

@AshishSinghSFDC thanks for confirming this issue is fixed by using the latest version of the CLI. I'll go ahead an close this now.

filipaGitHub commented 3 years ago

Hi,

I am trying to retrieve source from my org through the package.xml - SFDX:Retrieve This Source from Org I am getting this error:

SFDX: Retrieve Source from Org failed to run Unknown Exception

I have been working on this project in GitHub and it was working just fine until it suddently stopped retrieving throught the package.xml I have already tried to uninstall the Salesforce CLI Integration (Extension) from visual studio and also visual studio itself but I am still getting this error.

If I use the command line sfdx force:source:retrieve -x manifest/package.xml it works. But it only works if I use the command line and before I didn't have to use it.

AshishSinghSFDC commented 3 years ago

@filipaGitHub

I would suggest you open a new ticket with more details and screenshots if possible as it has already been marked as closed.

Also if possible could you try the below things:

  1. Reinstall Salesforce Extension Pack from Visual Studio Code. (Complete Package which comprises of multiple extension).
  2. Make sure the Salesforce Extension pack is Active. If it's active you would see Org details in footer as shown in the screenshot below.
  3. Go to the inbuilt terminal of Visual Studio Code and type sfdx update.
  4. Go to Package.xml and right-click on the XML file and choose Retrieve Source from Org.

image

filipaGitHub commented 3 years ago

@AshishSinghSFDC

Thank you for your suggestions, I have tried your 4 points but it still didn't work. I will open a new ticket with more details and screenshots.