-
Notifications
You must be signed in to change notification settings - Fork 78
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
Comments
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. |
related #872 |
related #860 |
Hello ! |
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? |
As a temporary workaround you can use the mdapi commands directly with the --soapdeploy flag. # 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 |
To solve my problem, I uninstalled v7.88.4 and installed version v7.85.1
|
This might help someone, but I had to downgrade the salesforcedx plugin after reinstalling the plugin.
|
related #870 |
This solution works for me. |
<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. |
Not to lump on, but I'm seeing the same thing even after updating the CLI to 7.89.2-d1d2614d02:
|
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. |
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 !! |
@nvuillam downgrade your sfdx to 7.85.1 and it should work as before |
That's what i did, but i hope this bug will be solved soon :/ |
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. |
This issue has been linked to a new work item: W-8952401 |
This issue was resolved in the latest version of the CLI 7.89.2-d1d2614d02. Please update your CLI to the latest version. |
@shetzel @chintan9033 Thank you |
I suspect this is a related issue, so posting here: Running
Rolling back the salesforcedx version
|
Hi 👋 |
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 |
Same here, it was the force:source:push which was also crashing... I still have to downgrade sfdx-cli Maybe add |
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 |
Thanks @shetzel. |
@jamesmelville The most recent salesforcedx@latest-rc is 51.2.2 ( 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). |
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 . |
I have Tested the new Version, and Still Experiencing the same issues, Unfortunately they need to do this every time there is a new update
|
Well I give up... Have upgraded to the Even the hack to 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. |
@gsbasso just re authorize the org you are deploying to that will take care of the invalid session id error. |
@CrownSeven Re-authorizing worked - thanks so much for the suggestion. Still showing |
Yes it does seem to be ignoring the flag. Fortunately with the wait hack, and reauthorizing we’re still able to deploy for now.
From: gsbasso<mailto:[email protected]>
Sent: Friday, March 5, 2021 4:37 PM
To: forcedotcom/cli<mailto:[email protected]>
Cc: CrownSeven<mailto:[email protected]>; Mention<mailto:[email protected]>
Subject: Re: [forcedotcom/cli] SyntaxError: Unexpected token < in JSON at position 1 (#884)
@CrownSeven<https://github.com/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 (?).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#884 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA5LEB22D5LLTP7FLDO4523TCFMMBANCNFSM4YGKQL6A>.
|
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. |
@gsbasso @CrownSeven If you've specifically installed a different version of the
To go back to the core version of salesforcedx (i.e., the version bundled with the CLI) run 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., |
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)
(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. |
@shetzel My output for |
I just did: Output of
And for latest-rc: Output of
|
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: |
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. |
@shetzel |
@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 |
@shetzel As have I (just) upgraded to the |
These bugs are getting out of control! |
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 here are my versions: |
I have upgraded, I really hope no bugs introduced again. Because this is driving me INSANE! This is my latest version: |
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 Please follow along on #860 for further updates related to REST API issues. |
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
When deploying the same project without any changes, but using the vscode push command it worked.
I can deploy other projects using the terminal with no problem
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
The text was updated successfully, but these errors were encountered: