moveit2_tutorials icon indicating copy to clipboard operation
moveit2_tutorials copied to clipboard

Unauthorized from pulling Docker rolling-tutorial image from ghcr.io (GitHub container registry)

Open ukicomputers opened this issue 1 year ago • 4 comments

Description

Hi! This is my first time to try MoveIt 2 for myself! As now, I use Docker for almost anything, because it keeps dependencies and software clean, working and OK like ROS 2. I started with tutorial on How to Set Up MoveIt 2 Docker Containers in Ubuntu. I got the Docker Compose script, executed command docker compose run ..., and Docker started pulling from ghcr.io (GitHub container registry). After few seconds, I got error: Head unauthorized (please see console output). Did anyone encountered this problem, or it is just me? Thanks!

Your environment

  • ROS Distro: Rolling (but also, I tried with Jazzy, and it is not working)
  • OS Version: Ubuntu 24.04 (codename noble)
  • Using moveit2_container with image rolling-tutorial binary build from ghcr.io (Docker compose script)
  • Rolling

Steps to reproduce

wget https://raw.githubusercontent.com/ros-planning/moveit2_tutorials/main/.docker/docker-compose.yml
DOCKER_IMAGE=rolling-tutorial docker compose run --rm --name moveit2_container cpu

Expected behaviour

While pulling image, I got Error response from daemon: Head unauthorized (see console output).

Backtrace or Console output

When running docker compose run (see steps to reproduce):

[+] Running 1/1
 ✘ cpu Error Head "https://ghcr.io/v2/moveit/moveit2_tutorials/manifests/rolling-tutorial": unauthorized                                      1.8s 
Error response from daemon: Head "https://ghcr.io/v2/moveit/moveit2_tutorials/manifests/rolling-tutorial": unauthorized

ukicomputers avatar Jul 03 '24 10:07 ukicomputers

I just saw, (https://github.com/moveit/moveit2/issues/1895) is probably related to this issue.

ukicomputers avatar Jul 03 '24 10:07 ukicomputers

Also, when logged in with GitHub API token for ghcr.io in Docker, I get this (different) error now:

[+] Running 1/1
 ✘ cpu Error denied                                                                                                                           3.1s 
Error response from daemon: denied

ghcr.io credentials are not the problem

ukicomputers avatar Jul 03 '24 14:07 ukicomputers

+1, I tried to go through tutorials using Docker (because manually built nodes crashed on startup despite the successful build) and got unauthorized error.

Update: I found a workaround. There is a working humble-tutorial image available in Dockerhub, so you can just update image section of docker-compose.yml:

# Example command:
#   Humble on a Nvidia system:
#   DOCKER_IMAGE=humble-tutorial docker compose run gpu
#   Rolling without discrete graphics:
#   DOCKER_IMAGE=rolling-tutorial docker compose run cpu

services:
  cpu:
    image: rakeshshrestha/moveit2_tutorials:humble-tutorial
    container_name: moveit2_container
    privileged: true
    network_mode: host
    command: /bin/bash
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
    environment:
      QT_X11_NO_MITSHM: 1
      DISPLAY: $DISPLAY
  gpu:
    image: rakeshshrestha/moveit2_tutorials:humble-tutorial
    container_name: moveit2_container
    privileged: true
    network_mode: host
    command: /bin/bash
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
    environment:
      QT_X11_NO_MITSHM: 1
      DISPLAY: $DISPLAY
      NVIDIA_VISIBLE_DEVICES: all
      NVIDIA_DRIVER_CAPABILITIES: all

Note that I have removed XAUTHORITY part as I did not have such variable set (possibly because I use WSL2). I also could not start gpu container due to some error, despite going through Nvidia drivers for Docker tutorial. CPU container works as expected, and successfully runs rviz.

Update 2: Rviz main screen is black. Cannot get it to work.

Update 3: Got the workaround to work by creating a different user in the container.

MartinsSmirnovs avatar Jul 12 '24 20:07 MartinsSmirnovs

+1, experiencing the same behavior as the issue initiator @ukicomputers.

pta-janssen avatar Jul 31 '24 20:07 pta-janssen

+1, facing the same unauthorized request

sbcrvl avatar Nov 11 '24 08:11 sbcrvl

Fixed in https://github.com/moveit/moveit2_tutorials/pull/989

sea-bass avatar Nov 17 '24 20:11 sea-bass