You need to sign in to do that
Don't have an account?

Pushing source to scratch org fails: Illegal Request - You have sent us an Illegal URL or an improperly formatted request.
Have some code in VS Code, received from a scratch org with enabled Community(Digital Experiences). Want this to push to a new scratch org. "Push Source to Default Scratch Org" always fails with exit code 1
SfdxError:
<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>
Tried a lot, but still have no clue: minimal project-scratch-dev.json, CLI latest version (7.92) and also an older; Has someone an idea where to look for error reason? Any help would be greatly appreciated.
https://github.com/forcedotcom/cli/issues/860
As one the contributors commented, switching from REST to SOAP will help get past the issue -
sfdx config:set restDeploy=false
Else, you can also downgrade the plugin version to 50.13.3 (Works for me) -
sfdx plugins:install salesforcedx@50.13.3
All Answers
What is your sourceApiVersion? Can you try changing it to the latest version?
\sfdx-project.json => change "sourceApiVersion" to latest version
Also, can you please try executing the following command (below is an example) and also try pushing the code to different enviroment
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_push_md_to_scratch_org.htm
Let me know what you see
"sourceApiVersion" is "51.0"
I created several scratch orgs, code pushing did not work for any.
I just tried sfdx force:source:push --targetusername test-u5kme8owvned@example.com --loglevel=TRACE, which only givesme same HTML back
*** Deploying with REST ***
ERROR running force:source:push:
<html>
<body>...Illegal Request</span></td>...
https://github.com/forcedotcom/cli/issues/860
As one the contributors commented, switching from REST to SOAP will help get past the issue -
sfdx config:set restDeploy=false
Else, you can also downgrade the plugin version to 50.13.3 (Works for me) -
sfdx plugins:install salesforcedx@50.13.3
I tried the SOAP approach (restDeploy=false) and that worked for me, at least for now. Will need to find time to dig into the github bug thread to see the origins of the issue.
I had looked for a clue there in github, but obviously not thoroughly enough. I'm happy now!