You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SyntaxError: Unexpected token < in JSON at position 1 #884
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.
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.
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.
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) :
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?
Reacted by Allan Oricil, Connor J. Toth, WEIJIAN ZHU and moelalaoui
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
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
<html><body><tablecellspacing=10><tr><td><spanstyle="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 --><scripttype="text/javascript">functionbodyOnLoad(){if(window.PreferenceBits){window.PreferenceBits.prototype.csrfToken="null";};}functionbodyOnBeforeUnload(){}functionbodyOnFocus(){}functionbodyOnUnload(){}</script></body></html><!--............................................................................................................................................................................................................................................................................................................................................................................................................-->
This is happening randomly. I believe this is a Salesforce problem rather than an SFDX problem.
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)
@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.
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.
(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)
@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?
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]
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
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.
@shetzelnpm 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.
@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.
@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.
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:
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.
Activity
github-actions commentedon Feb 25, 2021
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 commentedon Feb 25, 2021
Another project I can no longer deploy using the windows 10 terminal
But I can with the extension push command
AllanOricil commentedon 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.
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.

AllanOricil commentedon Feb 25, 2021
related #872
AllanOricil commentedon Feb 25, 2021
related #860
MathieuGOLLNICK commentedon Feb 25, 2021
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) :
bowdi commentedon 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:
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 commentedon Feb 25, 2021
As a temporary workaround you can use the mdapi commands directly with the --soapdeploy flag.
i.e.
AllanOricil commentedon Feb 25, 2021
To solve my problem, I uninstalled v7.88.4 and installed version v7.85.1
npm i [email protected] -gpaulknebulaconsulting commentedon Feb 26, 2021
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 commentedon Feb 26, 2021
related #870
cjl58 commentedon Feb 26, 2021
This solution works for me.
I had the latest version v7.9x.x and got the error.
kenhuman-regions commentedon Feb 26, 2021
sfdx force:mdapi:deploy -u user -d .\delta\src -c --json --apiversion=50.0results in a post to https://regions--uat.my.salesforce.com/services/data/v50.0/metadata/deployRequest returningThis is happening randomly. I believe this is a Salesforce problem rather than an SFDX problem.
SCWells72 commentedon Feb 26, 2021
Not to lump on, but I'm seeing the same thing even after updating the CLI to 7.89.2-d1d2614d02:
30 remaining items
shetzel commentedon Mar 9, 2021
@gsbasso @CrownSeven If you've specifically installed a different version of the
salesforcedxplugin then you won't get the update. If you runsfdx plugins --coreand it doesn't have this as part of the output then that's why the config variable isn't working.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 -gfor an npm install.hts-zhangdong commentedon Mar 10, 2021
The below is my version list in my local. They are all (core) version, but the below error has been caused.
@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)
(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 commentedon Mar 10, 2021
@shetzel My output for
sfdx plugins --coreis the same as for @hts-zhangdong. And I did not install a specific version ofsalesforcedx(this always fails for me due to some cert issue, but that's a whole other matter). How do I get to the51.2.2version you are showing?shetzel commentedon Mar 10, 2021
I just did:
npm install sfdx-cli -gOutput of
sfdx plugins --coreis:And for latest-rc:
npm install sfdx-cli@latest-rc -gOutput of
sfdx plugins --coreis:LuisKumruyanLoggi commentedon Mar 11, 2021
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 commentedon Mar 11, 2021
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 commentedon Mar 11, 2021
@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 commentedon Mar 11, 2021
@shetzel
npmhas never worked for me either. I tried installing the long-term support version ofNode.jsbut 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 tosfdx(either automatically downloaded or by running thesfdx updatecommand). Something seems to be broken with the standard update process.shetzel commentedon 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 updateis 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 commentedon Mar 11, 2021
@shetzel As have I (just) upgraded to the
7.91.0release and it seems to be honouring the sfdx config setting (so is now showing SOAP as the protocol when runningforce:source:deploy). I haven't tested with the environment variable, nor tried using REST to see if that issue has been sorted. Thanks.qwikag commentedon Mar 15, 2021
These bugs are getting out of control!
qwikag commentedon 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:
to my package.xml
and I run this command
$ sfdx force:source:deploy --manifest "manifest\package.xml" --json --loglevel fatal -l RunLocalTests --verboseI 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 commentedon 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 commentedon 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_DEPLOYenvironment variable tofalseas described in the 51.2.2 release notes.Please follow along on #860 for further updates related to REST API issues.