Preinstall script and git ssh suddenly failing today

Hello,

I submitted two builds at 2:54pm (UTC+8), the first one (iOS) passed, and the second one (Android) failed when it ran about 20 minutes later.

The second one failed due to the preinstall script that runs to set up the SSH key for access to a private git repository. This is really strange since nothing has changed in between the runs. Retrying does nothing to solve the issue.

Here’s the log of the build step:

Script 'eas-build-pre-install' is present in package.json, running it...
> xx.xx@4.53.0 eas-build-pre-install
> ./init-ssh-key.sh
npm exited with non-zero code: 1

Contents of init-ssh-key.sh:

#!/usr/bin/env bash
mkdir -p ~/.ssh

echo "$ssh_key" | base64 -d > ~/.ssh/id_rsa
chmod 0600 ~/.ssh/id_rsa
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts

Putting echo "1" in between each line of the init-ssh-key.sh file makes the step pass, but the npm install step later just fails:

ssh: connect to host bitbucket.org port 22: Network is unreachable

Was something changed on the EAS servers? It doesn’t make sense for this to suddenly break, it has been working fine for months.

Edit: I submitted an iOS build again and it works. Android still fails. There shouldn’t be a difference between the iOS and Android builds at this point of the build stage, but somehow there is.

  • Managed workflow
  • eas-cli 2.1.0

Seems to have been fixed today. Thanks.

I assume they’re using different providers for the Mac and Linux VMs/containers. Maybe there was some networking issue affecting only one of them at the time you were having a problem. Although it’s weird that the ssh-keyscan supposedly worked if the later ssh failed. Was there no error message output by ssh-keyscan?

Yeah, I got some error 500s yesterday, I guess the EAS servers weren’t doing too well yesterday.

The logs for the preinstall step is in my initial post, that’s the full log. It just exits like that with no additional messages.

The full log with the echos in between each line is like this:

Script 'eas-build-pre-install' is present in package.json, running it...
> xx.xx@4.53.0 eas-build-pre-install
> ./init-ssh-key.sh
1
2
3
4
5
6

hmmm… That log doesn’t make much sense to me. The npm error can’t be from that script because there are no calls to npm in the script. Anyway, glad it’s working for you now.

We migrated android workers to different infrastructure, and one of the network policies disabled all ssh traffic, it was fixed yesterday. Sorry for the trouble.

@wodin

npm exited with non-zero code: 1

That log is from npm hook itself, because running npm run eas-build-pre-install failed there

3 Likes

Ah, thanks

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.