kinu-garage / docker_vcs

Tool to support building Container/Images using VCS
Apache License 2.0
2 stars 0 forks source link

Docker image build failure with "'docker build' failed: 500 Server Error" #20

Open 130s opened 1 year ago

130s commented 1 year ago

Observed and stuck with this issue during the dev of https://github.com/kinu-garage/docker_vcs/pull/17

Issue

$ export DOCKERIMG=moveit/moveit2:$ROS_DISTRO-release
$ export WORKSPACE_ON_HOST=/home/noodler/cws
$ docker_vcs --dockerfile Dockerfile_ros-galactic --debug   --docker_base_img $DOCKERIMG     --workspace_on_host WORKSPACE_ON_HOST  

:

DEBUG:urllib3.connectionpool:http://localhost:None "POST /v1.43/build?t=.&q=True&nocache=False&rm=False&forcerm=False&pull=False&dockerfile=Dockerfile_ros-galactic&buildargs=%7B%22BASE_DIMG%22%3A+%22moveit%2Fmoveit2%3Ahumble-release%22%2C+%22ENTRY_POINT%22%3A+%22%22%2C+%22WS_IN_CONTAINER%22%3A+%22%2Fcws%22%7D&networkmode=bridge HTTP/1.1" 500 39
ERROR:root:'docker build' failed: 500 Server Error for http+docker://localhost/v1.43/build?t=.&q=True&nocache=False&rm=False&forcerm=False&pull=False&dockerfile=Dockerfile_ros-galactic&buildargs=%7B%22BASE_DIMG%22%3A+%22moveit%2Fmoveit2%3Ahumble-release%22%2C+%22ENTRY_POINT%22%3A+%22%22%2C+%22WS_IN_CONTAINER%22%3A+%22%2Fcws%22%7D&networkmode=bridge: Internal Server Error ("invalid reference format")
130s commented 1 year ago

docker engine seems to be running.

$ systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-09-28 10:59:06 EDT; 5 days ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 2614 (dockerd)
      Tasks: 24
     Memory: 705.7M
        CPU: 1min 26.133s
     CGroup: /system.slice/docker.service
             └─2614 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
130s commented 1 year ago
Found Docker's Python api was old but with the newest version on `pip`, I still get the same error. ``` $ pip3 show docker Name: docker Version: 5.0.3 $ pip3 install --force-reinstall docker $ pip3 show docker Name: docker Version: 6.1.3 $ docker_vcs --dockerfile src/template/ros/Dockerfile_ros-galactic --debug --docker_base_img $DOCKERIMG --workspace_on_host WORKSPACE_ON_HOST [0/2870] WARNING:root: Entrypoint executable not passed, nor any files with commonly used names are not found. This doesn't mean the tool should fail, e.g. if entrypoint is not used in Dockerfile, this won't cause any error. Limitation tracked: https://github.com/130s/docker_vcs/issues/5 DEBUG:root:Paths: ['src/template/ros/Dockerfile_ros-galactic', ''] DEBUG:root:Paths path_root_backup: /tmp/docker_vcs_20231003122559 src_rootdir = src/template/ros src_leaf_name = Dockerfile_ros-galactic dest_abs_path = /tmp/docker_vcs_20231003122559/Dockerfile_ros-galactic INFO:root:Saving from 'src/template/ros/Dockerfile_ros-galactic', to '/tmp/docker_vcs_20231003122559/Dockerfile_ros-galactic' WARNING:root:Path '' was not copy-able. Continuing. Exception from lower mod: 'NoneType' was passed as a path. DEBUG:root:path_dockerfile: src/template/ros/Dockerfile_ros-galactic, base_docker_img: moveit/moveit2:humble-release, path_repos_file: None INFO:root:Current dir before docker build: /home/n130s/data/Dropbox/pg/myDevelopment/git_repo/ROS/cws_utakata/130s/docker_vcs, dockerfile: Dockerfile_ros-galactic DEBUG:docker.utils.config:Trying paths: ['/home/n130s/.docker/config.json', '/home/n130s/.dockercfg'] DEBUG:docker.utils.config:Found file at path: /home/n130s/.docker/config.json DEBUG:docker.auth:Found 'auths' section DEBUG:docker.auth:Found entry (registry='https://index.docker.io/v1/', username='d130s') DEBUG:urllib3.connectionpool:http://localhost:None "GET /version HTTP/1.1" 200 818 DEBUG:docker.api.build:Looking for auth config DEBUG:docker.api.build:Sending auth config ('https://index.docker.io/v1/') DEBUG:urllib3.connectionpool:http://localhost:None "POST /v1.43/build?t=.&q=True&nocache=False&rm=False&forcerm=False&pull=False&dockerfile=Dockerfile_ros-galactic&buildargs=%7B%22BASE_DIMG%22%3A+%22moveit%2Fmoveit2%3Ahumble-release%22%2C+%22ENTRY_POINT%22%3A+%22%22%2C+%22WS_IN_CONTAINER%22%3A+%22%2Fcws%22%7D&networkmode=bridge HTTP/1.1" 500 39 ERROR:root:'docker build' failed: 500 Server Error for http+docker://localhost/v1.43/build?t=.&q=True&nocache=False&rm=False&forcerm=False&pull=False&dockerfile=Dockerfile_ros-galactic&buildargs=%7B%22BASE_DIMG%22%3A+%22moveit%2Fmoveit2%3Ahumble-release%22%2C+%22ENTRY_POINT%22%3A+%22%22%2C+%22WS_IN_CONTAINER%22%3A+%22%2Fcws%22%7D&networkmode=bridge: Internal Server Error ("invalid reference format") WARNING:root:It's likely that something didn't go well. Docker API didn't return a valid log. ```
130s commented 1 year ago

Attempted things that didn't resolve the issue

130s commented 1 year ago

stackoverflow.com#45682010 and some others suggest ill-formatted CLI input, but I doubt that's the case with me. I'm inclined to look into the commands that are executed inside the docker API's build command.

130s commented 1 year ago

With 0.1.0 the following worked, so it's likely docker_vcs has regressed.

$ export DOCKER_BASEIMG=ros:galactic-ros-base-focal
$ export REPOS_FILE=/home/noodlegg/link/ws/130s/hut_utakata/2023.repos
$ ./docker_builder_vcs.py  --debug --rm_intermediate   \
  --docker_base_img $DOCKER_BASEIMG \
  --dockerfile Dockerfile_ros-noetic \
  --path_repos $REPOS_FILE \
DEBUG:root:path_dockerfile: Dockerfile_ros-noetic, base_docker_img: ros:galactic-ros-base-focal, path_repos: /home/noodlegg/link/ws/130s/hut_utakata/2023.repos
DEBUG:root:File to be copied: 'Dockerfile_ros-noetic'
DEBUG:root:File to be copied: '/home/noodlegg/link/ws/130s/hut_utakata/2023.repos'
DEBUG:root:File to be copied: 'entry_point.bash'
INFO:root:Files are copied into a temp dir: '['2023.repos', 'Dockerfile_ros-noetic', 'entry_point.bash']'
: