Extend: imagex_push failing both with and without root privileges

@vincentab has additional details, but I’m currently unable to get imagex_push to work running from WSL2. Docker requires it be run as root, and executing “make imagex_push” without root privileges gives:

“ERROR: no builder “grpc-plugin-server-builder” found
ERROR: failed to initialize builder grpc-plugin-server-builder (grpc-plugin-server-builder0): permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get “http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/buildx_buildkit_grpc-plugin-server-builder0/json”: dial unix /var/run/docker.sock: connect: permission denied”

…however when I run “make imagex_push” as root, I get:
“ERROR: failed to solve: failed to push xxxxx.dkr.ecr.us-west-2.amazonaws.com/foundations/justice/dev/extend/ext-rpm-6fbbd/player-profile-service:v0.0.1.test: unexpected status from HEAD request to https://xxxxx.dkr.ecr.us-west-2.amazonaws.com/v2/foundations/justice/dev/extend/ext-rpm-6fbbd/player-profile-service/blobs/sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1: 401 Unauthorized”

Hi @njupshot! I’m from the Extend team.

We’ve made attempts to replicate the reported issue but were unsuccessful. However, we noticed a potential factor: the requirement to run Docker as root.

Can you try following these steps first and try again?

To be specific these specific set of commands:

  1. Create the docker group.

    sudo groupadd docker
    

  1. Add your user to the docker group.

    sudo usermod -aG docker $USER
    

  1. Log out and log back in so that your group membership is re-evaluated.

    If you’re running Linux in a virtual machine, it may be necessary to restart the virtual machine for changes to take effect.

    wsl.exe --shutdown
    wsl.exe
    

  1. Verify that you can run docker commands without sudo.

    make imagex_push ...
    

Cheers!

edit2: add specific commands to run

1 Like

Unfortunately that did not help, however I’ve seen articles mentioning that adding the user to the group does not fix the need to run Docker as root on WSL2. Either way, I’m very confused as to why running docker as root would result in the AB back-end returning an HTTP 401 unless make_imagex is attempting to read something it doesn’t have access to or something which doesn’t make a whole lot of sense either since I’m running make as root.

It looks like I can temporarily get past this issue using

sudo su

…but now I’ve run into another issue.

Hi @njupshot , I’m Eric, an SE from the Extend team.

For further investigation, could you help answer the following questions?

  1. What version of WSL, and which distro+version of Linux was installed?
  2. Docker initial installation. Was it over Windows, or WSL? Or potentially do you have a mixed of both now?
  3. What version of Docker did you install?
  4. I’ve noticed that your source code is probably on Windows C drive that’s why it’s at “/mnt/c/Upshot…”. To minimize other variables, is it possible to try to download your code to under your user’s folder within WSL and retry?
  5. which version of GitHub - AccelByte/extend-service-extension-csharp: A sample Extend Service Extension app written in C# is your service extension project based on?

Update: added bullet #4 and #5 above

Thank you!
Eric