Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
323 stars 55 forks source link

Creating a static web app for React app raises "Host key verification failed." error #859

Open borseno opened 2 years ago

borseno commented 2 years ago

Describe the bug

I have created a static web app. Chose there /src and build for react. Then I changed script to / and build. This is the YML file: https://github.com/RedDuck-Software/Undas.Frontend/blob/main/.github/workflows/azure-static-web-apps-mango-pebble-0fb617803.yml

The pipeline never succeeds. One example is: https://github.com/RedDuck-Software/Undas.Frontend/runs/7446967548?check_suite_focus=true

It also happens with other react repositories that I'm trying to make work.

The error that it gives is: yarn install v1.22.15 [1/4] Resolving packages... [2/4] Fetching packages... info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. error Command failed. Exit code: 128 Command: git Arguments: ls-remote --tags --heads ssh://git@github.com/ethereumjs/ethereumjs-abi.git Directory: /github/workspace Output: Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

I have opened the link https://github.com/ethereumjs/ethereumjs-abi and the repository indeed exists and I can access it even if I don't have an account.

A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Azure Portal'
  2. Click on 'Static Web Apps'
  3. Create a Static Web App
  4. Use "React" preset, SRC: "/", Build: "build"
  5. Connect the following repository (or a clone of it): https://github.com/RedDuck-Software/Undas.Frontend/

Expected behavior A normal repository would be deployed without a problem.

Additional context The same way this project failed as well: https://github.com/RedDuck-Software/ProtagonistPad.Frontend As you can see there, there is also SRC "/", Build: "build", preset React, and it's a normal React app.

borseno commented 2 years ago

I believe you guys should mark this as high priority because really no-one whom I know has been able to create a react app static website. Users are now going to netlify instead, because this is broken.

cormacpayne commented 2 years ago

@borseno Hey Mark, sorry for the delayed response and apologies for the less-than-ideal experience here. I pulled your repository down to my machine and did some testing to figure out what's going on here and found the culprit:

For some reason, the Yarn lock file you generated (or that was generated for you) produced a link to the GitHub repository for ethereumjs/ethereumjs-abi that was not formatted correctly. I found this comment that explains what change needs to be made (along with the rest of that GitHub issue which may have some more useful information), but ultimately you'd be looking at the following change:

This line would need to change to the following:

"ethereumjs-abi" "git+https://git@github.com/ethereumjs/ethereumjs-abi.git"

(Notice this is just adding git@ before github.com)

I made this change locally to your repository and was able to get a successful oryx build execution (the command being ran in your Static Web App GitHub Action), so I think that should be all that's needed from your side. Please feel free to @ me if you have any additional comments or questions about this change.