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
482 stars 78 forks source link

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

Closed ayiyann closed 3 years ago

ayiyann commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

here i smy config:

ayiyann commented 3 years ago

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

lcampos commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

jbeauchamp715 commented 3 years ago

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 commented 3 years ago

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

RCMoonpie commented 3 years ago

@smaddox-sf : Stephanie, there is something that I failed to mention in https://github.com/forcedotcom/salesforcedx-vscode/issues/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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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

mshanemc commented 3 years ago

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

ayiyann commented 3 years ago

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

RCMoonpie commented 3 years ago

@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 commented 3 years ago

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

RCMoonpie commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Has anyone got solution (no workaround please)

vikyaiyer commented 3 years ago

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

shawnholt commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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.