Cli: Getting error "ERROR running force:source:retrieve: core_1.fs.fileExists is not a function" while retrieving

Created on 26 Jul 2020  Â·  13Comments  Â·  Source: forcedotcom/cli

Getting the error 'ERROR running force:source:retrieve: core_1.fs.fileExists is not a function" when retrieving the source on package.xml from vscode after successsful authorization of the org.
Getting this error on a windows NT machine only on a few projects.

Please help.
Version 1.47.2

Most helpful comment

Hi @ddxxtony , @shalinimendu , @nramyasri-sf , @indrajitaus ,

I have been able to fix this issue after a lots of debugging and grilling.
Error will come with both CLI and retrieve command from right click @shalinimendu , @ddxxtony
The problem that I found out is that one of the plugins installed with Salesforce CLI is creating an issue.
So we just need to run 2 commands and issue will get resolved.

Open cmd (command prompt) and run these 2 commands

  1. sfdx plugins:uninstall salesforcedx
  2. sfdx update

That's it and problem is solved.
Please let me know if you still face this problem.

All 13 comments

Hi @shalinimendu - We need a bit more info to understand what's going on. Please post back with:

Steps To Reproduce:



    1. 2.

Expected result

_Describe what should have happened_.

Actual result

_Describe what actually happened instead_.

SFDX CLI Version:

OS and version:

Hi @smaddox-sf,
cc: @shalinimendu

Steps To Reproduce:

  1. Open VS Code
  2. Create a Project with Manifest
  3. Go to Package.xml
  4. Right click on Package.xml
  5. Click on SFDX: Retrieve Source in Manifest from Org.

Expected result
It will retrieve the apex class or trigger or the elements mentioned in package.xml

Actual result
It gives an error, ERROR running force:source:retrieve: core_1.fs.fileExists is not a function" while retrieving.
Attaching one image to explain it better.
error

SFDX CLI Version: 7.66.2-4f159a1d07 (Latest version)

OS and version: Windows 10 Enterprise (64 bit, x64-based processor)

Please help me out as it is really urgent to get it solved.

Hi @kunalmukhi did you find a solution, I am having the same issue, but when I am trying to deploy a package.xml

I am also facing similar issue...

@kunalmukhi , is this still an issue? Do you see the same error when you execute the command directly through the CLI?

I am experiencing this issue now.

Sent from Yahoo Mail on Android

On Fri, 7 Aug 2020 at 6:42 am, nramyasri-sfnotifications@github.com wrote:

@kunalmukhi , is this still an issue? Do you see the same error when you execute the command directly through the CLI?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

@shalinimendu , Do you see the same error when you execute the command directly through the CLI?

Yes.

Sent from Yahoo Mail on Android

On Fri, 7 Aug 2020 at 1:03 pm, nramyasri-sfnotifications@github.com wrote:

@shalinimendu , Do you see the same error when you execute the command directly through the CLI?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

@shalinimendu , Do you see the same error when you execute the command directly through the CLI?

I am also running the command directly through the CLI

Hi @ddxxtony , @shalinimendu , @nramyasri-sf , @indrajitaus ,

I have been able to fix this issue after a lots of debugging and grilling.
Error will come with both CLI and retrieve command from right click @shalinimendu , @ddxxtony
The problem that I found out is that one of the plugins installed with Salesforce CLI is creating an issue.
So we just need to run 2 commands and issue will get resolved.

Open cmd (command prompt) and run these 2 commands

  1. sfdx plugins:uninstall salesforcedx
  2. sfdx update

That's it and problem is solved.
Please let me know if you still face this problem.

Same issue over here:

> sfdx version
sfdx-cli/7.71.0-4193fb4acc darwin-x64 node-v12.18.3

Stacktrace:

TypeError: core_1.fs.fileExists is not a function
    at Workspace.walkDirectories (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/dist/lib/source/workspace.js:119:44)
    at Workspace.initializeStateFull (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/dist/lib/source/workspace.js:95:20)
    at Workspace.init (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/dist/lib/source/workspace.js:47:28)
    at Function.create (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/node_modules/@salesforce/core/node_modules/@salesforce/kit/lib/creatable.js:31:9)
    at SourcePathStatusManager.init (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/dist/lib/source/sourcePathStatusManager.js:161:26)
    at Function.create (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/node_modules/@salesforce/kit/lib/creatable.js:20:9)
    at SourceWorkspaceAdapter.init (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/dist/lib/source/sourceWorkspaceAdapter.js:61:21)
    at Function.create (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/node_modules/@salesforce/kit/lib/creatable.js:20:9)
    at MdapiPushApi.init (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/dist/lib/source/sourcePushApi.js:29:20)
    at Function.create (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/node_modules/@salesforce/kit/lib/creatable.js:20:9)
    at SourceApiCommand.execute (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/dist/lib/source/sourceApiCommand.js:48:15)
    at SourcePushCommand.execLegacyCommand (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/dist/ToolbeltCommand.js:148:29)
    at SourcePushCommand.run (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/dist/commands/force/source/push.js:29:16)
    at SourcePushCommand._run (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/node_modules/@salesforce/command/lib/sfdxCommand.js:93:40)
    at Config.runCommand (/Users/jpmonette/.local/share/sfdx/client/7.71.0-4193fb4acc/node_modules/@oclif/config/lib/config.js:173:24)
    at Main.run (/Users/jpmonette/.local/share/sfdx/client/7.71.0-4193fb4acc/node_modules/@oclif/command/lib/main.js:22:9)
Outer stack:
    at Function.wrap (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/node_modules/@salesforce/core/lib/sfdxError.js:151:27)
    at SourcePushCommand.catch (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/dist/ToolbeltCommand.js:247:46)
    at SourcePushCommand._run (/Users/jpmonette/.local/share/sfdx/node_modules/salesforce-alm/node_modules/@salesforce/command/lib/sfdxCommand.js:97:13)
    at Config.runCommand (/Users/jpmonette/.local/share/sfdx/client/7.71.0-4193fb4acc/node_modules/@oclif/config/lib/config.js:173:24)
    at Main.run (/Users/jpmonette/.local/share/sfdx/client/7.71.0-4193fb4acc/node_modules/@oclif/command/lib/main.js:22:9)
    at Main._run (/Users/jpmonette/.local/share/sfdx/client/7.71.0-4193fb4acc/node_modules/@oclif/command/lib/command.js:43:20)
    at Object.run (/Users/jpmonette/.local/share/sfdx/client/7.71.0-4193fb4acc/dist/cli.js:32:20)

UPDATE:
Not ideal, but removing sfdx and reinstalling fixed the issue:
https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_uninstall.htm

just run the command : sfdx update, it resolved my issue.

Was this page helpful?
0 / 5 - 0 ratings