Skip to content

Issue running make site-server from build directory  #3885

@aallbrig

Description

@aallbrig

What happened:
I tried setting up a local instance of the agones site locally by following instructions found on agones website to make site-server from the build directory. I see that it's ultimately running a hugo server that will bind to port 1313 but from inside a container.

I encountered some issues with set up. I tried resolving the issue myself (read more in "what I tried" section) but it was late at night.

Below is log output central to the issue. To highlight a couple things before the output wall:

  1. docker run --privileged --rm tonistiigi/binfmt:qemu-v6.2.0 --install arm64 followed up by installing: arm64 cannot register "/usr/bin/qemu-aarch64" to /proc/sys/fs/binfmt_misc/register: write /proc/sys/fs/binfmt_misc/register: no such file or directory
  2. ERROR Failed to read Git log: fatal: detected dubious ownership in repository at '/go/src/agones.dev/agones'
λ ~/src/agones/build/ make site-server
mkdir -p /Users/$USER/.kube/
mkdir -p /Users/$USER/src/agones/build//.gocache
mkdir -p /Users/$USER/src/agones/build//.config/gcloud
mkdir -p ~/.config/helm
mkdir -p ~/.cache/helm
docker run --privileged --rm tonistiigi/binfmt:qemu-v6.2.0 --install arm64
installing: arm64 cannot register "/usr/bin/qemu-aarch64" to /proc/sys/fs/binfmt_misc/register: write /proc/sys/fs/binfmt_misc/register: no such file or directory
{
  "supported": [
    "linux/arm64",
    "linux/amd64",
    "linux/riscv64",
    "linux/ppc64le",
    "linux/s390x",
    "linux/386",
    "linux/mips64le",
    "linux/mips64",
    "linux/arm/v7",
    "linux/arm/v6"
  ],
  "emulators": [
    "arm",
    "i386",
    "mips64",
    "mips64le",
    "ppc64le",
    "riscv64",
    "rosetta",
    "rosetta-wrapper",
    "s390x",
    "x86_64"
  ]
}
/Applications/Xcode.app/Contents/Developer/usr/bin/make ensure-image IMAGE_TAG=agones-build:5bab735929 BUILD_TARGET=build-build-image
docker run --user 501:20 --rm -v /Users/$USER/src/agones/build//.config/gcloud:/root/.config/gcloud -v /Users/$USER/.kube/:/root/.kube -v ~/.config/helm:/root/.config/helm -v ~/.cache/helm:/root/.cache/helm -v /Users/$USER/src/agones:/go/src/agones.dev/agones -v /Users/$USER/src/agones/build//.gomod:/go/pkg/mod -v /Users/$USER/src/agones/build//.gocache:/root/.cache/go-build --workdir=/go/src/agones.dev/agones/site --platform linux/x86_64 -p 1313:1313 agones-build:5bab735929 bash -c \
        "RELEASE_VERSION="1.42.0" RELEASE_BRANCH=main hugo server --watch --baseURL=http://localhost:1313/ --bind=0.0.0.0 -F"
hugo: downloading modules …
hugo: collected modules in 27202 ms
Watching for changes in /go/src/agones.dev/agones/site/{assets,content,layouts,static}
Watching for config changes in /go/src/agones.dev/agones/site/config.toml, /go/src/agones.dev/agones/site/go.mod
Start building sites …
hugo v0.118.2-da7983ac4b94d97d776d7c2405040de97e95c03d+extended linux/amd64 BuildDate=2023-08-31T11:23:51Z VendorInfo=gohugoio

ERROR Failed to read Git log: fatal: detected dubious ownership in repository at '/go/src/agones.dev/agones'
To add an exception for this directory, call:

        git config --global --add safe.directory /go/src/agones.dev/agones
WARN  Shortcode "tabpane": duplicate language "yaml" detected, disabling persistance of language to avoid multiple tab display. Position: "/go/src/agones.dev/agones/site/content/en/docs/Guides/fleet-updates.md:95:1"
WARN  Shortcode "tabpane": duplicate language "yaml" detected, disabling persistance of language to avoid multiple tab display. Position: "/go/src/agones.dev/agones/site/content/en/docs/Reference/gameserverallocation.md:19:1"
Built in 4059 ms
Error: error building site: logged 1 error(s)
make: *** [site-server] Error 1

What you expected to happen:
I am able to navigate to http://localhost:1313 and see a development version of the agones site to validate website changes.

How to reproduce it (as minimally and precisely as possible):

cd build
make site-server

It seems likely this might be an arm issue, so running arm hardware may also be a prerequisite?

Anything else we need to know?:

Some relevant ARM parts of agones codebase are found here:

I was able to move passed this issue using the following steps.

I set WITH_ARM64=0 to (air quotes) "resolve" the arm64 cannot register "/usr/bin/qemu-aarch64" to /proc/sys/fs/binfmt_misc/register issue.

I see git config --global --add safe.directory /go/src/agones.dev/agones in output so I tried prepending $(git_safe) && to build/includes/website.mk#L34 because that makefile variable exactly to that command. I get a Permission denied error.

λ ~/src/agones/build/ add-gamenetcode-resource-to-agones-documentation* make site-server
mkdir -p /Users/$USER/.kube/
mkdir -p /Users/$USER/src/agones/build//.gocache
mkdir -p /Users/$USER/src/agones/build//.config/gcloud
mkdir -p ~/.config/helm
mkdir -p ~/.cache/helm
/Applications/Xcode.app/Contents/Developer/usr/bin/make ensure-image IMAGE_TAG=agones-build:5bab735929 BUILD_TARGET=build-build-image
docker run --user 501:20 --rm -v /Users/$USER/src/agones/build//.config/gcloud:/root/.config/gcloud -v /Users/$USER/.kube/:/root/.kube -v ~/.config/helm:/root/.config/helm -v ~/.cache/helm:/root/.cache/helm -v /Users/$USER/src/agones:/go/src/agones.dev/agones -v /Users/$USER/src/agones/build//.gomod:/go/pkg/mod -v /Users/$USER/src/agones/build//.gocache:/root/.cache/go-build --workdir=/go/src/agones.dev/agones/site --platform linux/x86_64 -p 1313:1313 agones-build:5bab735929 bash -c \
	"git config --global --add safe.directory /go/src/agones.dev/agones && RELEASE_VERSION="1.42.0" RELEASE_BRANCH=main hugo server --watch --baseURL=http://localhost:1313/ --bind=0.0.0.0 -F"
error: could not lock config file //.gitconfig: Permission denied
make: *** [site-server] Error 255

Permission issue, eh? Next thing is to remove --user $(UID):$(GID) from the docker run command. This moves me passed the issue and I'm able to see the development website.

Environment:

  • Agones version: 1.42.0
  • Kubernetes version (use kubectl version): v1.28.6
  • Cloud provider or hardware configuration: M2 Macbook Pro
  • Install method (yaml/helm): helm
  • Troubleshooting guide log(s):
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions