Fatal: couldn't find remote ref master

Hi,
I tried to setup a buildkite plan for my repo in github. When I run a new build , I see this error:

git fetch -v --prune – origin master
POST git-upload-pack (317 bytes)
fatal: couldn’t find remote ref master
:warning: Warning: Checkout failed! exit status 128 (Attempt 3/3)
:rotating_light: Error: exit status 128

Not sure why I am getting this error. Please could you help?

Thanks
Sathya

Hi Sathya!

Taking a look here it seems the build couldn’t find the master branch. It is possible your GitHub repo has another default branch (such as main) which is why the build is not finding master.

If you’re using the UI to run a build, in the drop down when starting a new build you get the option to select a branch.

You’ll want to make sure this branch selection matches what exists in your GitHub repo. Also, in your Pipeline settings under General you can select a Default Branch, so there you’ll also want to change that to whatever default branch you use on GitHub as well. This will prevent you having to change the default branch every new build.

Cheers

Hi Jared,

Thanks for your reply, it worked after selecting main.

I have a folder .buildkite/test.sh and - command: '.buildkite/test.sh' in my pipeline.yml

I see this error while running a build.

|Running script|0s|
| --- | --- |
||$ ./.buildkite/test.sh|
||Sorry, home directories outside of /home are not currently supported.|
||See https://forum.snapcraft.io/t/11209 for details.|
||🚨 Error: The command exited with status 1|
||user command error: exit status 1|

Please could you have a look and let me know why I get this error.

Hi Sathya!

Happy my suggestion worked for you. Let me take a crack at this next one.

So looking at the error message, this looks to not be on Buildkites side but on the side of Snapcraft. The error below is letting you know that home directories outside of /home are not currently supported.

There is a direct link for some solutions in the error as seen here: Support for non /home homedirs - snapd - snapcraft.io
But, also I found this link from Snapcraft for you that might be a bit more helpful: https://snapcraft.io/docs/home-outside-home

You’ll have to follow the instructions in either of those links I sent to clear up that error message.

I hope this helps!

Cheers

Hi Jared,

I tried to follow the post you linked, but it doesn’t work for me. I keen to understand a simple issue which I am seeing here.

  1. I have a test.sh with below below contents.

echo “Testing my build…”
docker run hello-world

  1. When I trigger a buildkite build, it has prepared a working directory as shown below:

Preparing working directory
$ cd /var/lib/buildkite-agent/builds/********/test-806/rubydocker


Running script
$ ./test.sh
Testing my build…
Sorry, home directories outside of /home are not currently supported.

  1. The first line seems to have executed, but the second line which is a simple docker run hello-world is not.

I tried to follow the post you linked on the issue, but not successful.

  1. When I print echo $HOME on my ubuntu agent, I get this /home/user

Could you please have a look and let me know what could be wrong.

Thanks
Sathya

Hello, @Sathya! I’m jumping in for @jared here. Can you please send a link to the build where you see the issue to support@buildkite.com?
Many thanks.
Best!

Karen

Hi Karen

I emailed the link to support@buildkite.com. Could you please have a look ?

Thanks
Sathya