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

This directory does not contain a valid Salesforce DX project #1499

Closed
swapniljn8 opened this issue May 7, 2022 · 14 comments
Closed

This directory does not contain a valid Salesforce DX project #1499

swapniljn8 opened this issue May 7, 2022 · 14 comments
Labels
investigating We're actively investigating this issue more information required Issue requires more information or a response from the customer

Comments

@swapniljn8
Copy link

Summary

After I initialize my salesforce directory to Git, automatically default ORG was removed from the directory

Steps To Reproduce:

  1. Create a Salesforce project
  2. Initialize the repo to my Git hub repo
  3. try to set the default ORG again, as it was removed automatically once I initialize the repo.

System Information

  • If you are using sfdx

    • Run sfdx force:­con­fig:set defaul­tde­vhu­bus­ern­ame­=so­me@­use­r.com
  • Output :
    This directory does not contain a valid Salesforce DX project

  • I also tried

    • Run sfdx force:mdapi:convert -r mdapipackage/
  • Output :
    ERROR running force:mdapi:convert: This command is required to run from within an SFDX project.

@swapniljn8 swapniljn8 added the investigating We're actively investigating this issue label May 7, 2022
@github-actions
Copy link

github-actions bot commented May 7, 2022

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.

@iowillhoit
Copy link
Contributor

Hello @swapniljn8, I assume that you are running sfdx force:project:create to "Create a Salesforce project". Are you creating the scratch org after creating the project?
Example: sfdx force:org:create -s -f config/project-scratch-def.json

I am able to see similar errors if I run the provide commands before actually creating the scratch org. If you are doing something different, can you please provide the exact commands you are running to set up and replicate the errors? Please also provide what version of sfdx you are using (sfdx version --verbose --json)

@iowillhoit iowillhoit added waiting for internal reply The Salesforce team is working on a fix and has promised an update more information required Issue requires more information or a response from the customer and removed waiting for internal reply The Salesforce team is working on a fix and has promised an update labels May 9, 2022
@iowillhoit
Copy link
Contributor

Closing due to inactivity. Please reopen if you are still seeing issues after the suggestions above.

@swapniljn8
Copy link
Author

I actually found the issue in this, actually when I was initializing the directory from my VS code than I didn't stage the
sfdx-project.json and some other meta files as well and since I didn't staged they got deleted from my local directory which eventually led to VS code not to recognize the Project as Salesforce DX project and hence Salesforce extension was not working.
Thanks for your input above, I didn't knew about the thing which you mentioned in your comment

@Bartheleway
Copy link

Hi we sometimes encounter this as well on our VS Code projects. Using the command line is providing a workaround, the right-click retrieve command works great but deploy doesn't want to.

We once solved it by rebooting VS Code but it's not always working.

Could you fix the issue ?

@savage25
Copy link

I'm also getting this more and more often in my Visual Studio Code projects. They will work one day, and the next, I can no longer deploy:

Component conversion failed: This directory does not contain a valid Salesforce DX project

@litolax
Copy link

litolax commented Apr 12, 2023

I have same error, few days ago when I closed and reopen vs code it helped me, but now it doesn't work at all.

@cristiand391
Copy link
Member

@Bartheleway @savage25 @litolax I would log a new issue here for that team:
https://github.com/forcedotcom/salesforcedx-vscode/issues

Component conversion failed: This directory does not contain a valid Salesforce DX project

@savage25 if that bug happens when using string replacements, I'm pretty sure this PR fixed it:
forcedotcom/source-deploy-retrieve#908

but vscode extensions need to be updated to pass the right path.

@marcopfluidogroup
Copy link

I keep receiving the following error: Metadata API request failed: This directory does not contain a valid Salesforce DX project.
but to my surprise the deploy does commit indeed and the metadata is updated/created accordingly.

@cristiand391
Copy link
Member

@marcopfluidogroup that seems to be coming from a different place than the one discussed here (Component conversion failed).

If you can repro with the Salesforce CLI please create a new bug report here:
https://github.com/forcedotcom/cli/issues/new?assignees=&labels=investigating&projects=&template=bug_report.md&title=

@itaishmida
Copy link

This is also happening to me
now more often
I get:
Metadata API request failed: This directory does not contain a valid Salesforce DX project.
whenever I try to deploy with save or right click
any solution to this bug?

@A127324
Copy link

A127324 commented Jun 22, 2023

Happening for me, any solution for this bug ?

@cristiand391
Copy link
Member

@itaishmida @A127324
the error can be coming from different places, please open a new issue and follow the template:
https://github.com/forcedotcom/cli/issues/new?assignees=&labels=investigating&projects=&template=bug_report.md&title=

@jaganeswar
Copy link

I just updated the Cli it's now working fine

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
Projects
None yet
Development

No branches or pull requests

10 participants