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

SyntaxError: Unexpected token < in JSON at position 1 #884

Closed
AllanOricil opened this issue Feb 25, 2021 · 55 comments
Closed

SyntaxError: Unexpected token < in JSON at position 1 #884

AllanOricil opened this issue Feb 25, 2021 · 55 comments
Assignees
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@AllanOricil
Copy link

AllanOricil commented Feb 25, 2021

Summary

After updating sfdx to version 7.88.4-3b2e55c3f1 I can no longer use source push in one of my projects.

The same project, with no changes, could be deployed using 7.85.something

image

When deploying the same project without any changes, but using the vscode push command it worked.

image

I can deploy other projects using the terminal with no problem

image

So it is probably related to the metadata that I'm deploying. But why does it work when I run the vscode push command?

SFDX CLI Version(to find the version of the CLI engine run sfdx --version): 7.88.4-3b2e55c3f1

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)

PS C:\Users\oricil\workspace\scratch-org-communities-setup> 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-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)
hpe-sfdx-plugins 0.3.2
salesforcedx 51.0.4 (core)
├─ limits 1.0.4 (core)
├─ schema 1.0.4 (core)
├─ user 1.1.2 (core)
├─ custom-metadata 1.0.11 (core)
├─ apex 0.1.4 (core)
├─ templates 51.2.0 (core)
├─ salesforce-alm 51.0.2 (core)
└─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
sfdx-cli 7.88.4 (core)
sfdx-dependency-plugin 2.0.1
telemetry 1.1.1 (core)

OS and version: Windws 10

@AllanOricil AllanOricil added the investigating We're actively investigating this issue label Feb 25, 2021
@github-actions
Copy link

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.

@AllanOricil
Copy link
Author

AllanOricil commented Feb 25, 2021

Another project I can no longer deploy using the windows 10 terminal

image

But I can with the extension push command

image

@AllanOricil
Copy link
Author

AllanOricil commented Feb 25, 2021

It is actually not deploying anything, nor showing any error messages when using the extension.
So the extension is suppressing the error that I have when running in the terminal.

image

image

Look at the timestamps, there is no deploy tentative for the source push I tried with the extension. OBS: The errors that are there are for something else.
image

@AllanOricil
Copy link
Author

related #872

@AllanOricil
Copy link
Author

related #860

@MathieuGOLLNICK
Copy link

Hello !
I have exactly the same problem since yesterday and I believe it is also related to #881.
I searched some time and I realized I couldn't deploy / connect to my org due to some Oauth issues.
This is what I am using (in case it can help) :

image

@bowdi
Copy link

bowdi commented Feb 25, 2021

I'm also receiving this issue since updating to sfdx 7.88.4 however, i've noticed it when using sfdx force:source:deploy. I dug into the local code and added some debug statements. the issue seems to stem from receiving this response from Salesforce:

<html>
<head><title>An internal server error has occurred</title></head>
<body>


<div style="display:none;" id="errorTitle">An internal server error has occurred</div>
<div style="display:none;" id="errorDesc">An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the 
error, please contact <a href="https://help.salesforce.com/apex/hthome">Salesforce Support</a>. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. <br/><br/>Thank you again for your patience and assistance. And thanks for using salesforce.com!</div>
<table cellspacing=10>
<tr><td><span style="font-weight: bold; font-size: 12pt;">An internal server error has occurred</span></td></tr>
<tr><td>
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact <a href="https://help.salesforce.com/apex/hthome">Salesforce Support</a>. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. <br/><br/>Thank you again for your patience and assistance. And thanks for using salesforce.com!
<br><br>
Error ID: 1910852402-137678 (1534884652)
</td>
</tr>
<tr><td>
<br clear="all"><br><br>


</td></tr>
</table>

</td></tr>
</table>



</body>
</html>

Which is then trying to be parsed as a json response.

It could be a coincidence but I only started noticing the *** Deploying with REST *** statement this release but the sfdx force:source:deploy command does not provide a --soapdeploy flag such as the force:mdapi:deploy command does (even though under the hood the sfdx force:source:deploy uses the force:mdapi:deploy command) so perhaps a default has been changed?

@bowdi
Copy link

bowdi commented Feb 25, 2021

As a temporary workaround you can use the mdapi commands directly with the --soapdeploy flag.
i.e.

# flags extended for readability
# first convert from source to mdapi format 
sfdx force:source:convert --sourcepath .\force-app\main\default --outputdir .\deploy
# then use mdapi command to deploy using --soapdeploy flag
sfdx force:mdapi:deploy --deploydir .\deploy --wait 10 --soapdeploy

@AllanOricil
Copy link
Author

To solve my problem, I uninstalled v7.88.4 and installed version v7.85.1

npm i [email protected] -g

@paulknebulaconsulting
Copy link

This might help someone, but I had to downgrade the salesforcedx plugin after reinstalling the plugin.
I'm using Windows 10, the CLI download from the website and set this plugin version to v51.0.2

sfdx plugins:install [email protected]

@bowdi
Copy link

bowdi commented Feb 26, 2021

related #870

@cjl58
Copy link

cjl58 commented Feb 26, 2021

To solve my problem, I uninstalled v7.88.4 and installed version v7.85.1

npm i [email protected] -g

This solution works for me.
I had the latest version v7.9x.x and got the error.

@kenhuman-regions
Copy link

sfdx force:mdapi:deploy -u user -d .\delta\src -c --json --apiversion=50.0 results in a post to https://regions--uat.my.salesforce.com/services/data/v50.0/metadata/deployRequest returning

<html>
<body>

<table cellspacing=10>
    <tr>
        <td><span style="font-weight: bold; font-size: 12pt;">Illegal Request</span></td>
    </tr>
    <tr>
        <td>You have sent us an Illegal URL or an improperly formatted request.
        </td>
    </tr>
    <tr>
        <td>

        </td>
    </tr>
</table>



<!-- Body events -->
<script type="text/javascript">function bodyOnLoad(){if(window.PreferenceBits){window.PreferenceBits.prototype.csrfToken="null";};}function bodyOnBeforeUnload(){}function bodyOnFocus(){}function bodyOnUnload(){}</script>

</body>
</html>


<!--
...................................................................................................
...................................................................................................
...................................................................................................
...................................................................................................
-->

This is happening randomly. I believe this is a Salesforce problem rather than an SFDX problem.

@SCWells72
Copy link

Not to lump on, but I'm seeing the same thing even after updating the CLI to 7.89.2-d1d2614d02:

SyntaxError: Unexpected token < in JSON at position 1
    at JSON.parse (<anonymous>)
    at Request._callback (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\salesforce-alm\dist\lib\core\force.js:583:25)
    at Request.self.callback (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\request\request.js:185:22)
    at Request.emit (events.js:315:20)
    at Request.<anonymous> (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\request\request.js:1154:10)
    at Request.emit (events.js:315:20)
    at IncomingMessage.<anonymous> (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\request\request.js:1076:12)
    at Object.onceWrapper (events.js:421:28)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)SyntaxError: Unexpected token < in JSON at position 1
    at JSON.parse (<anonymous>)
    at Request._callback (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\salesforce-alm\dist\lib\core\force.js:583:25)
    at Request.self.callback (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\request\request.js:185:22)
    at Request.emit (events.js:315:20)
    at Request.<anonymous> (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\request\request.js:1154:10)
    at Request.emit (events.js:315:20)
    at IncomingMessage.<anonymous> (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\request\request.js:1076:12)
    at Object.onceWrapper (events.js:421:28)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)SyntaxError: Unexpected token < in JSON at position 1
    at JSON.parse (<anonymous>)
    at Request._callback (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\salesforce-alm\dist\lib\core\force.js:583:25)
    at Request.self.callback (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\request\request.js:185:22)
    at Request.emit (events.js:315:20)
    at Request.<anonymous> (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\request\request.js:1154:10)
    at Request.emit (events.js:315:20)
    at IncomingMessage.<anonymous> (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\request\request.js:1076:12)
    at Object.onceWrapper (events.js:421:28)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)SyntaxError: Unexpected token < in JSON at position 1
    at JSON.parse (<anonymous>)
    at Request._callback (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\salesforce-alm\dist\lib\core\force.js:583:25)
    at Request.self.callback (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\request\request.js:185:22)
    at Request.emit (events.js:315:20)
    at Request.<anonymous> (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\request\request.js:1154:10)
    at Request.emit (events.js:315:20)
    at IncomingMessage.<anonymous> (C:\Users\Scott\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\request\request.js:1076:12)
    at Object.onceWrapper (events.js:421:28)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

@sconnock
Copy link

sconnock commented Mar 1, 2021

Same issue on a push with 7.89.2. I uninstalled and re-installed the CLI which took me back to 7.81.0 and no longer see the issue.

@nvuillam
Copy link

nvuillam commented Mar 1, 2021

I have the same with force:source:push --json : no error thrown, exit code 0 .... but no deployment done

and --soapdeploy is not an available option for force:source:push !!
Is there some workaround to force it ?

@AllanOricil
Copy link
Author

I have the same with force:source:push --json : no error thrown, exit code 0 .... but no deployment done

and --soapdeploy is not an available option for force:source:push !!
Is there some workaround to force it ?

@nvuillam downgrade your sfdx to 7.85.1 and it should work as before

@nvuillam
Copy link

nvuillam commented Mar 1, 2021

That's what i did, but i hope this bug will be solved soon :/

@shetzel
Copy link
Contributor

shetzel commented Mar 1, 2021

This is a duplicate of #860. I am fixing the issue and will post specifics in 860. Will go into the latest-rc release being built soon and will be promoted to latest this Thursday.

@shetzel shetzel added bug Issue or pull request that identifies or fixes a bug and removed investigating We're actively investigating this issue labels Mar 1, 2021
@shetzel shetzel self-assigned this Mar 1, 2021
@uip-robot-zz
Copy link

This issue has been linked to a new work item: W-8952401

@chintan9033
Copy link

chintan9033 commented Mar 2, 2021

This issue was resolved in the latest version of the CLI 7.89.2-d1d2614d02. Please update your CLI to the latest version.
Use "sfdx update" command to update your CLI version.

@AllanOricil
Copy link
Author

@shetzel @chintan9033 Thank you

@jamesmelville
Copy link

I suspect this is a related issue, so posting here:

Running sfdx force:org:create is working successfully in that an org is created, but the org is not assigned the alias specified with --setalias. The command exits with code 0, but this error is displayed in the output:

SyntaxError: Unexpected token < in JSON at position 6
    at JSON.parse (<anonymous>)
    at Request._callback (/usr/local/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/dist/lib/core/force.js:583:25)
    at Request.self.callback (/usr/local/lib/node_modules/sfdx-cli/node_modules/request/request.js:185:22)
    at Request.emit (node:events:378:20)
    at Request.<anonymous> (/usr/local/lib/node_modules/sfdx-cli/node_modules/request/request.js:1154:10)
    at Request.emit (node:events:378:20)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/sfdx-cli/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (node:events:484:28)
    at IncomingMessage.emit (node:events:390:22)
    at endReadableNT (node:internal/streams/readable:1307:12)
    at processTicksAndRejections (node:internal/process/task_queues:81:21)

Rolling back the salesforcedx version sfdx plugins:install [email protected] resolves the issue.

sfdx-cli/7.89.2 linux-x64 node-v15.10.0
You acknowledge and agree that the CLI tool may collect usage information, user environment, and crash reports for the purposes of providing services or functions that are relevant to use of the CLI tool and product improvements.

@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.10.0 (core)
@oclif/plugin-update 1.4.0-2 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.7 (core)
auth 1.4.9 (core)
config 1.2.5 (core)
generator 1.1.5 (core)
salesforcedx 51.1.1 (core)
├─ schema 1.0.4 (core)
├─ limits 1.0.4 (core)
├─ user 1.1.2 (core)
├─ apex 0.1.4 (core)
├─ custom-metadata 1.0.11 (core)
├─ templates 51.3.0 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
└─ salesforce-alm 51.1.1 (core)
sfdx-cli 7.89.2 (core)
telemetry 1.1.1 (core)

@javier-delgado
Copy link

Hi 👋
When do you think this fix will be available on the npm version of the CLI? Due to some restrictions I have, I can only use that version

@GeneralDoddi
Copy link

I have exactly the same problem as @jamesmelville. I'm working from a fresh install and a new computer, did all rollbacks that people listed as workarounds with no success, my core list matches @jamesmelville

@nvuillam
Copy link

nvuillam commented Mar 4, 2021

Same here, it was the force:source:push which was also crashing... I still have to downgrade sfdx-cli

Maybe add --soapdeploy argument for all related commands until the REST deployment is stable ?

@shetzel
Copy link
Contributor

shetzel commented Mar 4, 2021

force:org:create uses the metadata api to deploy settings to the scratch org, so it subject to some of the same issues as the deploy commands wrt the REST API. To workaround the issue you can use the restDeploy config variable to switch to SOAP if you're using the latest-rc version of the CLI. The current latest-rc is scheduled to be promoted to latest tomorrow morning PST. There are still bugs with using the REST API in both the CLI and core app and fixes are coming soon. There are multiple issues reported and fix details are spread between them. I.e., #860 and #884

@jamesmelville
Copy link

Thanks @shetzel.
I'm not sure if it was a fluke I reported earlier but moving the plugin version to sfdx plugins:install [email protected] didn't seem to fix it after all, and neither did running against latest-rc (assume I needed to flip something with the restDeploy config variable). I rolled back my whole CLI to [email protected] and this is back to normal for the moment.

@shetzel
Copy link
Contributor

shetzel commented Mar 4, 2021

@jamesmelville The most recent salesforcedx@latest-rc is 51.2.2 (npm view salesforcedx) so that is the version you'll want to get and then set the restDeploy config var either by doing sfdx config:set restDeploy=false or setting the equivalent environment variable, SFDX_REST_DEPLOY=false

There are more fixes coming in the next latest-rc release that will improve the reliability of using REST with CLI deployments. Check out the release notes when they are published (in this repo).

@CrownSeven
Copy link

CrownSeven commented Mar 4, 2021

Pulled down the latest version, set the flag correctly. This is still occurring on 7.90.2-b8f9206a5c win32-x64 node-v14.15.4.

I've given up waiting for a solution and modified the force.js above to add the wait command. Works brilliantly. Thank you @theunisj .

@theunisj
Copy link

theunisj commented Mar 5, 2021

@CrownSeven , @shetzel

I have Tested the new Version, and Still Experiencing the same issues,
I have tested the Wait Function again, and with 200 ms, and it still works Great, I have asked our Entire Team To do this until a resolution is in Place

Unfortunately they need to do this every time there is a new update

@gsbasso sure

added a wait Function As I could not find one

Force.prototype.wait = function(ms){
    var start = new Date().getTime();
    var end = start;
    while(end < start + ms) {
      end = new Date().getTime();
   }
 }

and then in the Force.prototype.mdapiRestDeploy method
I added

this.wait(1000);

after the headers = this.setRestHeaders(connection); variable Assignment

image

@gsbasso
Copy link

gsbasso commented Mar 5, 2021

Well I give up...

Have upgraded to the 7.90.2 build, tried setting environment variable SFDX_REST_DEPLOY=false or config:set restDeploy=false and it still shows *** Deploying with REST *** (and fails, obviously).

Even the hack to force.js does not work for me. I keep getting INVALID_SESSION_ID: Session expired or invalid

It's fortunate automatic updates on our Jenkins server have mysteriously stopped working. Otherwise we'd be dead in the water with this issue.

Not sure how/why this could have been released, never mind allowed to drag on for days.

@CrownSeven
Copy link

@gsbasso just re authorize the org you are deploying to that will take care of the invalid session id error.

@gsbasso
Copy link

gsbasso commented Mar 5, 2021

@CrownSeven Re-authorizing worked - thanks so much for the suggestion.

Still showing *** Deploying with REST *** (with restDeploy set to false). Seems to be ignoring the config setting, unless the message is misleading (?).

@CrownSeven
Copy link

CrownSeven commented Mar 5, 2021 via email

@bowdi
Copy link

bowdi commented Mar 9, 2021

Looking at the status page for the cli it looks like the build is failing for the cli repo, so that may be why the latest build hasn't helped / is ignoring flags etc.

@shetzel
Copy link
Contributor

shetzel commented Mar 9, 2021

@gsbasso @CrownSeven If you've specifically installed a different version of the salesforcedx plugin then you won't get the update. If you run sfdx plugins --core and it doesn't have this as part of the output then that's why the config variable isn't working.

salesforcedx 51.2.2 (core)
├─ limits 1.0.4 (core)
├─ schema 1.0.4 (core)
├─ user 1.1.2 (core)
├─ apex 0.1.4 (core)
├─ custom-metadata 1.0.11 (core)
├─ templates 51.3.0 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
└─ salesforce-alm 51.2.1 (core)

To go back to the core version of salesforcedx (i.e., the version bundled with the CLI) run sfdx plugins:uninstall salesforcedx. It will then go back to the core version.

Alternatively you can try using the latest-rc version of the CLI since there were a few fixes made for REST in that version. E.g., npm install sfdx-cli@latest-rc -g for an npm install.

@hts-zhangdong
Copy link

The below is my version list in my local. They are all (core) version, but the below error has been caused.

  • sfdx plugins --core

@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.10.0 (core)
@oclif/plugin-update 1.4.0-2 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.8 (core)
auth 1.4.10 (core)
config 1.2.6 (core)
generator 1.1.5 (core)
salesforcedx 51.1.1 (core)
├─ user 1.1.2 (core)
├─ schema 1.0.4 (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.90.2 (core)
telemetry 1.1.1 (core)

  • sfdx force:source:push

(node:4768) Warning: The .forceignore file doesn't adhere to .gitignore format which will be the default behavior starting in Spring '21 release. More information on .gitignore format here: https://git-scm.com/docs/gitignore. Fix the following lines in your .forceignore and add '# .forceignore v2' to your .forceignore file to switch to the new behavior.
(Use node --trace-warnings ... to show where the warning was created)
(node:4768) Warning: Admin.profile-meta.xml
*** Deploying with REST ***
SyntaxError: Unexpected token < in JSON at position 1
at JSON.parse ()
at Request._callback (C:\Users\hts20\AppData\Local\sfdx\client\7.90.2-b8f9206a5c\node_modules\salesforce-alm\dist\lib\core\force.js:583:25)

@gsbasso
Copy link

gsbasso commented Mar 10, 2021

@shetzel My output for sfdx plugins --core is the same as for @hts-zhangdong. And I did not install a specific version of salesforcedx (this always fails for me due to some cert issue, but that's a whole other matter). How do I get to the 51.2.2 version you are showing?

@shetzel
Copy link
Contributor

shetzel commented Mar 10, 2021

I just did: npm install sfdx-cli -g

Output of sfdx plugins --core is:

@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.10.0 (core)
@oclif/plugin-update 1.4.0-2 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.8 (core)
auth 1.4.10 (core)
config 1.2.6 (core)
generator 1.1.5 (core)
salesforcedx 51.2.2 (core)
├─ limits 1.0.4 (core)
├─ schema 1.0.4 (core)
├─ user 1.1.2 (core)
├─ custom-metadata 1.0.11 (core)
├─ templates 51.3.0 (core)
├─ apex 0.1.4 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
└─ salesforce-alm 51.2.1 (core)
sfdx-cli 7.90.2 (core)
telemetry 1.1.1 (core)

And for latest-rc: npm install sfdx-cli@latest-rc -g

Output of sfdx plugins --core is:

@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.10.0 (core)
@oclif/plugin-update 1.4.0-2 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.8 (core)
auth 1.4.10 (core)
config 1.2.6 (core)
generator 1.1.5 (core)
salesforcedx 51.3.0 (core)
├─ limits 1.0.4 (core)
├─ schema 1.0.4 (core)
├─ user 1.1.2 (core)
├─ custom-metadata 1.0.11 (core)
├─ templates 51.3.0 (core)
├─ apex 0.1.4 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
└─ salesforce-alm 51.3.0 (core)
sfdx-cli 7.91.0 (core)
telemetry 1.1.1 (core)

@LuisKumruyanLoggi
Copy link

I also had this problem when using SFDX-CLI on CircleCI (clean install) - To resolve this issue, I simply specified the version I wanted to install to 7.85.1

Command used on CircleCI for a specific version:
npm install --global [email protected]

@ksingh-btig
Copy link

I did all the uninstalling and reinstalling of SFDX 7.85.1 version but when I run sfdx --version....I still get this : sfdx-cli/7.90.2-b8f9206a5c win32-x64 node-v14.15.4

I guess I cannot go back to 7.85 to do my deployments

@AllanOricil
Copy link
Author

I did all the uninstalling and reinstalling of SFDX 7.85.1 version but when I run sfdx --version....I still get this : sfdx-cli/7.90.2-b8f9206a5c win32-x64 node-v14.15.4

I guess I cannot go back to 7.85 to do my deployments

@ksingh-btig clear every node module you have on your computer. And do a clean installation. I'm sure that 7.85.1 is stable as I've been using for a few weeks already. You just need to make sure you dont have anything linked to old dependencies.

@gsbasso
Copy link

gsbasso commented Mar 11, 2021

@shetzel npm has never worked for me either. I tried installing the long-term support version of Node.js but that failed. Understand I have limited privileges on my company workstation. But why are we having to go through all these hoops to resolve this issue? Up until now I have managed with the regular/periodic updates to sfdx (either automatically downloaded or by running the sfdx update command). Something seems to be broken with the standard update process.

@shetzel
Copy link
Contributor

shetzel commented Mar 11, 2021

@gsbasso Pretty sure I was just answering your question of "How do I get to the 51.2.2 version you are showing?" There's more than one way to install the CLI and plugins and there's more than one way to update. That was one example. Running sfdx update is another, which uses the tar files rather than npm for the update. In fact I just did that too (sfdx update) and I was updated to the CLI version just published, 7.91.0 with salesforcedx plugin version 51.1.1.

@gsbasso
Copy link

gsbasso commented Mar 11, 2021

@shetzel As have I (just) upgraded to the 7.91.0 release and it seems to be honouring the sfdx config setting (so is now showing SOAP as the protocol when running force:source:deploy). I haven't tested with the environment variable, nor tried using REST to see if that issue has been sorted. Thanks.

@qwikag
Copy link

qwikag commented Mar 15, 2021

These bugs are getting out of control!

@qwikag
Copy link

qwikag commented Mar 15, 2021

This error is mostly a problem when deploying to Production. because it is when running tests and deploying code.

LETS GO!

When I add (apex and/or triggers), this:

	<types>
		<members>xyzsomecode</members>
		<name>ApexClass</name>
	</types>
	<types>
		<members>xyzsometrigger</members>
		<name>ApexTrigger</name>
	</types>

to my package.xml
and I run this command
$ sfdx force:source:deploy --manifest "manifest\package.xml" --json --loglevel fatal -l RunLocalTests --verbose
I get the above titled error:

here are my versions:
$ sfdx plugins --core
@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.10.0 (core)
@oclif/plugin-update 1.4.0-2 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.8 (core)
auth 1.4.10 (core)
config 1.2.6 (core)
generator 1.1.5 (core)
salesforcedx 51.2.2 (core)
├─ limits 1.0.4 (core)
├─ schema 1.0.4 (core)
├─ user 1.1.2 (core)
├─ custom-metadata 1.0.11 (core)
├─ apex 0.1.4 (core)
├─ templates 51.3.0 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
└─ salesforce-alm 51.2.1 (core)
sfdx-cli 7.90.2 (core)
telemetry 1.1.1 (core)

@qwikag
Copy link

qwikag commented Mar 15, 2021

I have upgraded, I really hope no bugs introduced again. Because this is driving me INSANE!

This is my latest version:
$ sfdx plugins --core
@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.10.0 (core)
@oclif/plugin-update 1.4.0-2 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.8 (core)
auth 1.4.10 (core)
config 1.2.6 (core)
generator 1.1.5 (core)
salesforcedx 51.3.0 (core)
├─ limits 1.0.4 (core)
├─ schema 1.0.4 (core)
├─ user 1.1.2 (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.3.0 (core)
sfdx-cli 7.91.0 (core)
telemetry 1.1.1 (core)

@RodEsp
Copy link
Contributor

RodEsp commented Mar 16, 2021

Closing this issue to reduce noise since it is a duplicate of #860 and the original problem with parsing JSON has now been resolved as well as providing a workaround by setting the SFDX_REST_DEPLOY environment variable to false as described in the 51.2.2 release notes.

Please follow along on #860 for further updates related to REST API issues.

@RodEsp RodEsp closed this as completed Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug
Projects
None yet
Development

No branches or pull requests