question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

File not found (403) - Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.020761/windows/StaticSitesClient.exe@1.0.020761

See original GitHub issue

Before filing this issue, please ensure you’re using the latest CLI by running swa --version and comparing to the latest version on npm.

Are you accessing the CLI from the default port :4280 ?

  • No, I am using a different port number (--port) and accessing the CLI from that port
  • [ X] Yes, I am accessing the CLI from port :4280

Make sure you are accessing the URL printed in the console when running swa start!

ℹ️ NOTE: Make sure to enable debug logs when running any swa commands using --verbose=silly

Describe the bug A clear and concise description of what the bug is. Console output

Deploying to environment: production

Deploying project to Azure Static Web Apps...
StaticSitesClient is outdated! Expected 1.0.020761, got 1.0.019361
[swa] ✖ Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.020761/windows/StaticSitesClient.exe@1.0.020761
✖ 
✖ Deployment Failed :(
✖ Deployment Failure Reason: Failed to download StaticSitesClient binary. File not found (403)
✖ For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/azure/static-web-apps/

✖ If you believe this behavior is unexpected, please raise a GitHub issue at:
  https://github.com/Azure/static-web-apps-cli/issues/new/choose

To Reproduce Steps to reproduce the behavior:

  1. swa deploy ./dist/ -n NAME --env production --deployment-token TOKEN

The given url https://swalocaldeploy.azureedge.net/downloads/1.0.020761/windows/StaticSitesClient.exe@1.0.020761 gives me

<Error>
<Code>BlobNotFound</Code>
<Message>The specified blob does not exist. RequestId:5bc7a37a-201e-00a4-17d3-d3add7000000 Time:2022-09-29T07:16:06.4365437Z</Message>
</Error>

Expected behavior A clear and concise description of what you expected to happen.

Deployment succeeded

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows 10
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kunukncommented, Sep 30, 2022

Thank you very much. I can confirm it works on my Windows 10.

1reaction
manekinekkocommented, Sep 30, 2022

Hi @kunukn , here is a temporary manual process to install the binary and use the binary. We will simplify it in the future.

NOTE: This is how the SWA CLI automatically downloads and configures the deploy binary

  1. Visit https://swalocaldeploy.azureedge.net/downloads/versions.json
  2. Copy the stable JSON content, for eg:
{
    "version": "stable",
    "buildId": "1.0.020761",
    "publishDate": "2022-09-07T17:34:35.4261936Z",
    "files": {
      "linux-x64": {
        "url": "https://swalocaldeploy.azureedge.net/downloads/1.0.020761/linux/StaticSitesClient",
        "sha": "871ae9f154ddb8123e24c507e39dfc11c99f34815e59b178051a6e44a870e308"
      },
      "win-x64": {
        "url": "https://swalocaldeploy.azureedge.net/downloads/1.0.020761/windows/StaticSitesClient.exe",
        "sha": "360b76959c68cc0865b1aea144c8eb2aa413f4856e55c781a83bd7e1ad352362"
      },
      "osx-x64": {
        "url": "https://swalocaldeploy.azureedge.net/downloads/1.0.020761/macOS/StaticSitesClient",
        "sha": "1a90511003609af378ff3628feaf3115f9d7e335085a925045e9f206359fdb90"
      }
    }
  }
  1. Based on your operating system, download the right binary from the provided URLs:
    1. Linux: https://swalocaldeploy.azureedge.net/downloads/1.0.020761/linux/StaticSitesClient
    2. Windows: https://swalocaldeploy.azureedge.net/downloads/1.0.020761/windows/StaticSitesClient.exe
    3. macOS: https://swalocaldeploy.azureedge.net/downloads/1.0.020761/macOS/StaticSitesClient
  2. Copy this binary to $HOME/.swa/deploy/VERSION/StaticSiteClient (add .exe for Windows). For eg: /home/USER/.swa/deploy/1.0.020761/StaticSiteClient
  3. Create a file at $HOME/.swa/deploy/StaticSitesClient.json with the following content:
{
   "metadata": PASTE STABLE JSON CONTENT,
   "binary": ABSOLUTE PATH TO STATIC SITE CLIENT BINARY,
   "checksum": SH256 CHECKSUM OF THE BINARY SEE BELOW
}

For eg:

{
   "metadata": {
    "version": "stable",
    "buildId": "1.0.020761",
    ...
  },
   "binary":"/home/USER/.swa/deploy/1.0.020761/StaticSitesClient",
   "checksum": SH256 CHECKSUM OF THE BINARY SEE BELOW
}

IMPORTANT: Make sure the StaticSitesClient.json#checksum and StaticSitesClient.json#metadata.files.[OS].sha values match! 6. For Linux and macOS, run chmod +x /home/USER/.swa/deploy/1.0.020761/StaticSitesClient 7. Run swa deploy --verbose silly and make sure SWA_CLI_DEPLOY_BINARY is set correctly. If everything was configured correctly, the deploy should work.

How to compute SHA256 checksum:

  1. On Windows using Powershell:
PS C:\Users\USER> (Get-fileHash -Algorithm SHA256 .\.swa\deploy\VERSION\StaticSitesClient.exe).Hash.ToLower()
  1. On Linux:
➜ sha256sum ~/.swa/deploy/VERSION/StaticSitesClient | head -c 64
  1. On macOS:
➜ openssl sha256 ~/.swa/deploy/VERSION/StaticSitesClient | awk '{print $2}'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error 403 when you access Windows Update - Microsoft Learn
The Windows Update site control is missing or is damaged on your computer. The Hosts file is damaged or contains incorrect information.
Read more >
What Is the 403 Forbidden Error and How to Fix It (8 Methods ...
HTTP 403. Forbidden. Error causes, Missing index page ... Right-click on the file and select Download to create a backup. .htaccess file, showing...
Read more >
403 Forbidden error: What it is and how to fix it - Allconnect.com
It simply means that, for some predetermined reason, the website's content you're trying to access is being blocked. The reason might be within ......
Read more >
How to Fix a 403 Forbidden Error on Your WordPress Site
The 403 Forbidden error means that your server is working, but you no longer have permission to view all or some of your...
Read more >
“403 Forbidden” Error - What is It and How to Fix It? - SiteGround
The website domain is not pointed to the correct server; Wrong permissions for the website's files and folders; Missing index file; Restrictive ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found