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

sfdx force:source:deploy ended with 0 but doesn't do nothing #904

Closed
ayiyann opened this issue Mar 1, 2021 · 30 comments
Closed

sfdx force:source:deploy ended with 0 but doesn't do nothing #904

ayiyann opened this issue Mar 1, 2021 · 30 comments

Comments

@ayiyann
Copy link

ayiyann commented Mar 1, 2021

I deploy to my salesforce org by selecting my LWC and click SFDX: deploy source to org" . The command ended with code 0 but oesn't do nothing .

Sometime i need to restart my computer in order to make the command ok.

16:32:16.931 sfdx force:source:deploy --sourcepath c:\Users\yann\Desktop\YANN\AUTRES\OUTILS\VSCode_Salesforce\Salesforce_ORG\PERSO\LWC_Playground\LWC\force-app\main\default\lwc\boatSearchForm\boatSearchForm.js --json --loglevel fatal
ended with exit code 0

@smaddox-sf
Copy link

Hi @ayiyann - We need more information to attempt to troubleshoot this:

  1. Please include the versions of the Salesforce extensions, CLI and your OS.
  2. Are you using the 'Experimental Deploy Retrieve' setting in preferences?
  3. do you get any error message in the bottom-right corner of VSCode's footer or in the Dev Tools console (Help > Toggle Developer Tools and select the Console tab). If you do can you provide those details ?

@ayiyann
Copy link
Author

ayiyann commented Mar 3, 2021

hi
How can i find log file of Vscode and send them to you ?

here i smy config:

  • OS: windows 10

  • sfdx --version :sfdx-cli/7.89.2-d1d2614d02 win32-x64 node-v14.15.4

  • sfdx plugins --core
    @oclif/plugin-autocomplete 0.3.0 (core)
    @oclif/plugin-commands 1.3.0 (core)
    @oclif/plugin-not-found 1.2.4 (core)
    @oclif/plugin-plugins 1.9.5 (core)
    @oclif/plugin-warn-if-update-available 1.7.0 (core)
    @oclif/plugin-which 1.0.3 (core)
    @salesforce/lwc-dev-server 2.10.0
    ├─ @oclif/plugin-help 2.2.3
    └─ @oclif/plugin-update 1.3.10
    @salesforce/sfdx-diff 0.0.6
    @salesforce/sfdx-trust 3.6.0 (core)
    alias 1.1.5 (core)
    auth 1.4.8 (core)
    config 1.2.4 (core)
    generator 1.1.5 (core)
    salesforcedx 51.1.1 (core)
    ├─ schema 1.0.4 (core)
    ├─ user 1.1.2 (core)
    ├─ limits 1.0.4 (core)
    ├─ custom-metadata 1.0.11 (core)
    ├─ apex 0.1.4 (core)
    ├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
    ├─ templates 51.3.0 (core)
    └─ salesforce-alm 51.1.1 (core)
    sfdx-cli 7.89.2 (core)

  • i also use local development server in order to preview LWC locally

  • when i deploy to my salesforce org nothing happens even if the command ended with 0 ( i need to restard my computer in order to make everything works fine until it happens again => very boring ).

  • in Help > Toggle Developer Tools > console i don't see anything

@ayiyann
Copy link
Author

ayiyann commented Mar 3, 2021

i can share my screen and show you the issue if it is possible for you

@lcampos
Copy link

lcampos commented Mar 4, 2021

Hi @ayiyann , let's take a step back. Can you explain what you mean by "doesn't do nothing" ? Is it that your changes do not get deployed to the org ? What changes happen to your experience with the command that is solved by restarting your machine ?

@ayiyann
Copy link
Author

ayiyann commented Mar 4, 2021

Hi,
yes that mean my changes are not deployed. i am currently facing the same issue again. i don't know why it is random.
I just right click on my component and deploy to my sandbox and i get this ( but nothing what been deployed to my sandbox): Notice that the command doesn't show at the end of the log the deployed components ( maybe i can try to send you a video or screenshots )

Starting SFDX: Deploy Source to Org
18:26:06.573 sfdx force:source:deploy --sourcepath c:\Users\yann\Desktop\YANN\AUTRES\OUTILS\VSCode_Salesforce\Salesforce_ORG\AGEFOS\AGEFOS_develop\AGEFOS_develop\force-app\main\default\lwc\lwc018_demandeDeRappelV2\lwc018_demandeDeRappelV2.html --json --loglevel fatal
18:26:12.396 sfdx force:source:deploy --sourcepath c:\Users\yann\Desktop\YANN\AUTRES\OUTILS\VSCode_Salesforce\Salesforce_ORG\AGEFOS\AGEFOS_develop\AGEFOS_develop\force-app\main\default\lwc\lwc018_demandeDeRappelV2\lwc018_demandeDeRappelV2.html --json --loglevel fatal
ended with exit code 0

In order to make it run the solution i currently use is to restart my computer. yesterday i stop local developpement server + restart vscode and the deployment works fine. Today i am facing the same issue ( local development server is not running) . i don't know where is the issue. I will restart again vscode and if it is not working i will restart my computer .

@ayiyann
Copy link
Author

ayiyann commented Mar 4, 2021

hi
je restart Vscode and the "SFDX: Deploy Source" command works fine . Here is the logs when it runs fine. You can see that at the end of the log the deployed component are listed. When i face the issue the logs doesn't show the deployed components. (cf the logs of my previous post)

Starting SFDX: Deploy Source to Org

18:38:05.147 sfdx force:source:deploy --sourcepath c:\Users\yann\Desktop\YANN\AUTRES\OUTILS\VSCode_Salesforce\Salesforce_ORG\AGEFOS\AGEFOS_develop\AGEFOS_develop\force-app\main\default\lwc\lwc018_demandeDeRappelV2\lwc018_demandeDeRappelV2.html --json --loglevel fatal
18:38:13.457 sfdx force:source:deploy --sourcepath c:\Users\yann\Desktop\YANN\AUTRES\OUTILS\VSCode_Salesforce\Salesforce_ORG\AGEFOS\AGEFOS_develop\AGEFOS_develop\force-app\main\default\lwc\lwc018_demandeDeRappelV2\lwc018_demandeDeRappelV2.html --json --loglevel fatal
ended with exit code 0

=== Deployed Source
STATE FULL NAME TYPE PROJECT PATH
───── ────────────────────────────────────────────────────── ──────────────────────── ────────────────────────────────────────────────────────────────────────────────────────
Add lwc018_demandeDeRappelV2\lwc018_demandeDeRappelV2.html LightningComponentBundle force-app\main\default\lwc\lwc018_demandeDeRappelV2\lwc018_demandeDeRappelV2.html
Add lwc018_demandeDeRappelV2\lwc018_demandeDeRappelV2.js LightningComponentBundle force-app\main\default\lwc\lwc018_demandeDeRappelV2\lwc018_demandeDeRappelV2.js
Add lwc018_demandeDeRappelV2\lwc018_demandeDeRappelV2.js LightningComponentBundle force-app\main\default\lwc\lwc018_demandeDeRappelV2\lwc018_demandeDeRappelV2.js-meta.xml

@manjitsingh8
Copy link

manjitsingh8 commented Mar 8, 2021

I do have the same issue on running the same command. I am on latest version of SFDX. Here is what happens

image

It just finishes, no error, no warning, no success. A week back, it used to work i.e. show number of components, deploy status etc. Same thing happens if I run it from a terminal, adding --verbose flag does not provide any useful info. I will be happy to provide more information.

OS: Windows 10
I am using default config of SFDX, no experimental flags. It started happening after I updated SFDX a week back

Version:
image

@lcampos lcampos transferred this issue from forcedotcom/salesforcedx-vscode Mar 8, 2021
@jbeauchamp715
Copy link

I too am having this issue. When I make a change to my Apex class and I save the change, the deploy to salesforce executes but does not actually deploy the changes. I get message stating it ended with an exit code of 0 but it did not actually deploy the code. I then have to make another change to the file, and save it. It then deploys to Salesforce, sometimes this works, sometimes it does not. I have to continue to make changes until the file is actually sent to Salesforce. Here are the logs from doing this today.

Starting SFDX: Deploy Source to Org

07:52:52.352 sfdx force:source:deploy --sourcepath c:\Salesforce\VSCode\McConxJB\force-app\main\default\classes\MSLUpdateEventServiceTest.cls --json --loglevel fatal
07:53:04.993 sfdx force:source:deploy --sourcepath c:\Salesforce\VSCode\McConxJB\force-app\main\default\classes\MSLUpdateEventServiceTest.cls --json --loglevel fatal
ended with exit code 0

It says the deploy of the source code worked but my changes are not on the org.

Starting SFDX: Deploy Source to Org

07:53:22.536 sfdx force:source:deploy --sourcepath c:\Salesforce\VSCode\McConxJB\force-app\main\default\classes\MSLUpdateEventServiceTest.cls --json --loglevel fatal
07:53:39.654 sfdx force:source:deploy --sourcepath c:\Salesforce\VSCode\McConxJB\force-app\main\default\classes\MSLUpdateEventServiceTest.cls --json --loglevel fatal
ended with exit code 0

=== Deployed Source
STATE FULL NAME TYPE PROJECT PATH
───── ───────────────────────── ───────── ─────────────────────────────────────────────────────────────────────
Add MSLUpdateEventServiceTest ApexClass force-app\main\default\classes\MSLUpdateEventServiceTest.cls
Add MSLUpdateEventServiceTest ApexClass force-app\main\default\classes\MSLUpdateEventServiceTest.cls-meta.xml

Now the changes are actually on the org.

@ayiyann
Copy link
Author

ayiyann commented Mar 10, 2021

Hi
a fix will be available soon ? It is very difficult to work like this.
I confirm it is the same issue in forcedotcom/salesforcedx-vscode#3042
Best Regards

@RCMoonpie
Copy link

@smaddox-sf : Stephanie, there is something that I failed to mention in forcedotcom/salesforcedx-vscode#3042 that I will add here. It may or may not help, but when dealing with issues I feel that too much information is better than not enough:

When running the deploy command by typing it into the terminal, every time that it has indicated success, the file has actually been deployed into the org.

@vikyaiyer
Copy link

I am too facing this issue since updating to 7.89 versions of the cli. In the meantime this issues is fixed has anyone found a workaround or a way to roll back cli to stable versions?

@shetzel
Copy link
Contributor

shetzel commented Mar 16, 2021

I believe you are running into a slightly different version of the expired session problem as in #899
If you switch to use SOAP (sfdx config:set restDeploy=false) or ensure your auth tokens are valid (you can run sfdx force:org:display and it should refresh it for you) I think you will no longer see this problem. Can you please confirm and if that is the case, close this issue?

@manjitsingh8
Copy link

manjitsingh8 commented Mar 17, 2021

I believe you are running into a slightly different version of the expired session problem as in #899
If you switch to use SOAP (sfdx config:set restDeploy=false) or ensure your auth tokens are valid (you can run sfdx force:org:display and it should refresh it for you) I think you will no longer see this problem. Can you please confirm and if that is the case, close this issue?

Thank you for providing assistance.

I did that, here is the command log. I still see the same issue. The retrieve also gives an error. The class I am trying to retrieve is present since 2 years and is present in same org as seen in screenshot.

I will reinstall the CLI entirely.


image


image

@manjitsingh8
Copy link

manjitsingh8 commented Mar 18, 2021

I finally fixed by

  1. Removing Salesforce CLI from programs
  2. Removing sfdx-cli from npm npm remove sfdx-cli -g
  3. Deleted the .sfdx folder in user directory C:\\users\yourname.
  4. Fresh install of sfdx-cli npm install sfdx-cli -g
  5. Disabling rest deploy
  6. Reauthorizing all orgs.

@vikyaiyer
Copy link

vikyaiyer commented Mar 18, 2021

As mentioned by @manjitsingh8, the issue doesn't seem to be with the token as all my orgs when I ran the command sfdx force:org:display it did show as connected and I'm also able to retrieve the components from the org. But with the deploy command, the components don't get deployed to the org. I'm still facing this issue in the 7.91 version of the cli.

I also don't have the flexibility to uninstall and install applications in a corporate environment. So I'm waiting for the fix in an upcoming update.

@shetzel
Copy link
Contributor

shetzel commented Mar 18, 2021

@vikyaiyer I don't think you have to wait for a fix to the REST deploy path. If you're on v7.91 of the CLI and the core version of salesforcedx plugin bundled with that CLI then you should be able to switch to SOAP for the deploy and it should work. Appending --dev-debug generally gives additional helpful output as well.

@vikyaiyer
Copy link

@shetzel thanks for the update, switching to SOAP for deploy worked.

@mshanemc
Copy link
Contributor

I'm closing this--it's all related to the soap/rest switch.

@ayiyann
Copy link
Author

ayiyann commented Mar 26, 2021

hi however it is related to soap/rest switch i hope the rest behaviour will be fixed

@RCMoonpie
Copy link

RCMoonpie commented Mar 31, 2021

@mshanemc What "soap/rest switch"? (EDIT: As in, I understand the discussion of the workaround of switching from using REST to using SOAP. What I don't understand is your reference to "the soap/rest switch" [emphasis added by me].)

This was closed without resolution but with no reference/link to any other issue.

@ayiyann
Copy link
Author

ayiyann commented Apr 1, 2021

hi @RCMoonpie the workaround is to switch to soap deployment by using the command: sfdx config:set restDeploy=false in the terminal

@RCMoonpie
Copy link

Thank you for the replay @ayiyann . But you said it yourself - that is a "workaround". Which means the underlying issue still exists.

Which is why I do not understand the closing of this issue without directly linking it to another issue that is still being worked.

@peternoges
Copy link

peternoges commented Apr 1, 2021

I was updating a managed package very late last month & saw the toast say success during my right-click in a file > deploy action...yet the org didnt get the update. I think its happened as few as ~ 3 times for me, (that i noticed and out of tens of thousands of uses).

to anyone troubleshooting: I have not intentionally made any edits to the "soap/rest switch".

I think reopening vscode helped me around it, but im really not sure what causes or what fixes it.

Im on sfdx-cli/7.91.0-6a6ed69ebe win32-x64 node-v14.15.4.

@ayiyann
Copy link
Author

ayiyann commented Apr 5, 2021

Thank you for the replay @ayiyann . But you said it yourself - that is a "workaround". Which means the underlying issue still exists.

Which is why I do not understand the closing of this issue without directly linking it to another issue that is still being worked.

hi @RCMoonpie I agree with you . I don't understand why they have closed this case because switching to soap is just a workaround.

@NarangAshish
Copy link

Has anyone got solution (no workaround please)

@vikyaiyer
Copy link

@NarangAshish
The issue would be resolved once you update the cli and switch to SOAP deploy
sfdx update
sfdxconfig:set restDeploy=false

@shawnholt
Copy link

Should this issue should not be closed if it is a bug (REST is default) and there is no error given. The config:set restDeploy=false workaround is not working and spent a while just to get here :)
Goal is simply to use org browser, edit a file on sandbox, deploy to org.

@shawnholt
Copy link

Whoever is reading this - note that all these user issues are happening on Windows - Can we confirm that this is not related to parsing of windows path names?

@shetzel
Copy link
Contributor

shetzel commented Jul 7, 2021

@shawnholt - REST is no longer the default. It was switched back to SOAP months ago. In order to reopen this issue there would need to be more information in how to reproduce it, or open a new issue with the details from the template filled out such as CLI and plugin versions, the exact command and parameters used, and any debug output that may help track down the problem (append --dev-debug to the command for that.
You can also try installing/using the source plugin beta which is what we're moving towards in the very near future to see if that fixes the problem. Details for that are in the announcement at the top of the issues page.
Another thing you can check is that you no longer have the salesforcedx plugin installed if you're on the latest CLI version (7.108.0). If you do you should uninstall it.

@JimAtLang
Copy link

JimAtLang commented Jul 23, 2021

I've been having this bug too, inconsistently. I will deploy source to org and SFDX will tell me 'Deploy source to org ran successfully,' but the remote code won't change. I am using the SOAP not the REST.

It's obvious that the developers just aren't going to reopen this problem and figure out what is actually going on here, so I will tell you the workaround that worked for me:

Edit the code remotely using the web interface, and make some trivial change like adding a comment. Then when you deploy it will work.

It is really annoying I have to do this because I have to waste time every time I deploy to make sure the deployment actually worked. It would be really nice if this problem was actually fixed instead of being swept under the rug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests