docker.errors.APIError: 400 Client Error

2024-11-28 09:51:58 [I 2024-11-28 01:51:58.275 JupyterHub log:192] 200 GET /hub/api/users/chenzw2-test-sa3gcq31/server/progress (binder@172.18.0.2) 7730.79ms
2024-11-28 09:51:58 [E 241128 01:51:58 builder:749] Retrying launch of https://gitlab.com/chenzw2/test.git after error (duration=10s, attempt=2): HTTPError()
2024-11-28 09:52:06 [I 241128 01:52:06 launcher:198] Creating user chenzw2-test-93dk11dd for image chenzw2-2dtest-d2d6b8:68a0a220d4b328ea76f971af6c4246ed18a1b116
2024-11-28 09:52:06 [D 2024-11-28 01:52:06.609 JupyterHub scopes:1010] Checking access to /hub/api/users/chenzw2-test-93dk11dd via scope admin:users!user=chenzw2-test-93dk11dd
2024-11-28 09:52:06 [D 2024-11-28 01:52:06.627 JupyterHub roles:326] Assigning default role to User chenzw2-test-93dk11dd
2024-11-28 09:52:06 [I 2024-11-28 01:52:06.642 JupyterHub roles:281] Adding role user for User: chenzw2-test-93dk11dd
2024-11-28 09:52:07 [I 2024-11-28 01:52:07.324 JupyterHub log:192] 201 POST /hub/api/users/chenzw2-test-93dk11dd (binder@172.18.0.2) 1044.15ms
2024-11-28 09:52:07 [I 241128 01:52:07 launcher:258] Starting server for user chenzw2-test-93dk11dd with image chenzw2-2dtest-d2d6b8:68a0a220d4b328ea76f971af6c4246ed18a1b116
2024-11-28 09:52:07 [W 2024-11-28 01:52:07.325 JupyterHub metrics:404] Event loop was unresponsive for at least 1.04s!
2024-11-28 09:52:07 [D 2024-11-28 01:52:07.332 JupyterHub scopes:1010] Checking access to /hub/api/users/chenzw2-test-93dk11dd/servers/ via scope servers!server=chenzw2-test-93dk11dd/
2024-11-28 09:52:07 [D 2024-11-28 01:52:07.347 JupyterHub user:496] Creating <class 'LocalContainerSpawner'> for chenzw2-test-93dk11dd:
2024-11-28 09:52:07 [D 2024-11-28 01:52:07.348 JupyterHub base:1095] Initiating spawn for chenzw2-test-93dk11dd
2024-11-28 09:52:07 [D 2024-11-28 01:52:07.348 JupyterHub base:1099] 0/100 concurrent spawns
2024-11-28 09:52:07 [D 2024-11-28 01:52:07.348 JupyterHub base:1104] 0 active servers
2024-11-28 09:52:08 [I 2024-11-28 01:52:08.091 JupyterHub provider:661] Creating oauth client jupyterhub-user-chenzw2-test-93dk11dd
2024-11-28 09:52:08 [D 2024-11-28 01:52:08.954 JupyterHub user:913] Calling Spawner.start for chenzw2-test-93dk11dd
2024-11-28 09:52:08 [D 241128 01:52:08 launcher:312] Requesting progress for chenzw2-test-93dk11dd: users/chenzw2-test-93dk11dd/server/progress
2024-11-28 09:52:08 [I 2024-11-28 01:52:08.957 JupyterHub log:192] 202 POST /hub/api/users/chenzw2-test-93dk11dd/servers/ (binder@172.18.0.2) 1630.28ms
2024-11-28 09:52:08 [W 2024-11-28 01:52:08.958 JupyterHub metrics:404] Event loop was unresponsive for at least 1.58s!
2024-11-28 09:52:08 [D 2024-11-28 01:52:08.965 JupyterHub scopes:1010] Checking access to /hub/api/users/chenzw2-test-93dk11dd/server/progress via scope read:servers!server=chenzw2-test-93dk11dd/
2024-11-28 09:52:08 [D 2024-11-28 01:52:08.982 JupyterHub dockerspawner:1027] Getting container 'jupyter-chenzw2-2dtest-2d93dk11dd'
2024-11-28 09:52:08 [I 2024-11-28 01:52:08.989 JupyterHub dockerspawner:1033] Container 'jupyter-chenzw2-2dtest-2d93dk11dd' is gone
2024-11-28 09:52:08 [D 2024-11-28 01:52:08.990 JupyterHub dockerspawner:1205] Starting host with config: {'auto_remove': True, 'binds': {}, 'links': {}, 'mounts': [], 'mem_limit': 0, 'cpu_period': 100000, 'cpu_quota': 0, 'port_bindings': {8888: ('host.docker.internal',)}, 'network_mode': 'bridge'}
2024-11-28 09:52:10 [I 2024-11-28 01:52:10.156 JupyterHub dockerspawner:1311] Created container jupyter-chenzw2-2dtest-2d93dk11dd (id: 1a7048e) from image chenzw2-2dtest-d2d6b8:68a0a220d4b328ea76f971af6c4246ed18a1b116
2024-11-28 09:52:10 [I 2024-11-28 01:52:10.156 JupyterHub dockerspawner:1335] Starting container jupyter-chenzw2-2dtest-2d93dk11dd (id: 1a7048e)
2024-11-28 09:52:15 [E 2024-11-28 01:52:15.141 JupyterHub user:1007] Unhandled error starting chenzw2-test-93dk11dd's server: 400 Client Error for http://host.docker.internal:2375/v1.47/containers/1a7048e1f4eec6e53caedf6764c1f9b79c307c282b222e55df634a6dab54ec0b/start: Bad Request ("failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/usr/local/bin/repo2docker-entrypoint": permission denied: unknown")
2024-11-28 09:52:15     Traceback (most recent call last):
2024-11-28 09:52:15       File "/usr/local/lib/python3.10/dist-packages/jupyterhub/user.py", line 920, in spawn
2024-11-28 09:52:15         await asyncio.wait_for(f, timeout=spawner.start_timeout)
2024-11-28 09:52:15       File "/usr/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
2024-11-28 09:52:15         return fut.result()
2024-11-28 09:52:15       File "/usr/local/lib/python3.10/dist-packages/dockerspawner/dockerspawner.py", line 1343, in start
2024-11-28 09:52:15         await self.start_object()
2024-11-28 09:52:15       File "/usr/local/lib/python3.10/dist-packages/dockerspawner/dockerspawner.py", line 1219, in start_object
2024-11-28 09:52:15         await self.docker("start", self.container_id)
2024-11-28 09:52:15       File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
2024-11-28 09:52:15         result = self.fn(*self.args, **self.kwargs)
2024-11-28 09:52:15       File "/usr/local/lib/python3.10/dist-packages/dockerspawner/dockerspawner.py", line 993, in _docker
2024-11-28 09:52:15         return m(*args, **kwargs)
2024-11-28 09:52:15       File "/usr/local/lib/python3.10/dist-packages/docker/utils/decorators.py", line 19, in wrapped
2024-11-28 09:52:15         return f(self, resource_id, *args, **kwargs)
2024-11-28 09:52:15       File "/usr/local/lib/python3.10/dist-packages/docker/api/container.py", line 1136, in start
2024-11-28 09:52:15         self._raise_for_status(res)
2024-11-28 09:52:15       File "/usr/local/lib/python3.10/dist-packages/docker/api/client.py", line 277, in _raise_for_status
2024-11-28 09:52:15         raise create_api_error_from_http_exception(e) from e
2024-11-28 09:52:15       File "/usr/local/lib/python3.10/dist-packages/docker/errors.py", line 39, in create_api_error_from_http_exception
2024-11-28 09:52:15         raise cls(e, response=response, explanation=explanation) from e
2024-11-28 09:52:15     docker.errors.APIError: 400 Client Error for http://host.docker.internal:2375/v1.47/containers/1a7048e1f4eec6e53caedf6764c1f9b79c307c282b222e55df634a6dab54ec0b/start: Bad Request ("failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/usr/local/bin/repo2docker-entrypoint": permission denied: unknown")
2024-11-28 09:52:15     
2024-11-28 09:52:15 [D 2024-11-28 01:52:15.141 JupyterHub user:1100] Stopping chenzw2-test-93dk11dd
2024-11-28 09:52:15 [D 2024-11-28 01:52:15.142 JupyterHub dockerspawner:1027] Getting container 'jupyter-chenzw2-2dtest-2d93dk11dd'
2024-11-28 09:52:15 [I 2024-11-28 01:52:15.148 JupyterHub dockerspawner:1033] Container 'jupyter-chenzw2-2dtest-2d93dk11dd' is gone
2024-11-28 09:52:15 [W 2024-11-28 01:52:15.148 JupyterHub dockerspawner:1008] Container not found: jupyter-chenzw2-2dtest-2d93dk11dd
2024-11-28 09:52:15 [D 2024-11-28 01:52:15.169 JupyterHub user:1122] Deleting oauth client jupyterhub-user-chenzw2-test-93dk11dd
2024-11-28 09:52:15 [D 2024-11-28 01:52:15.513 JupyterHub user:1125] Finished stopping chenzw2-test-93dk11dd
2024-11-28 09:52:16 [E 2024-11-28 01:52:16.061 JupyterHub gen:629] Exception in Future <Task finished name='Task-104' coro=<BaseHandler.spawn_single_user.<locals>.finish_user_spawn() done, defined at /usr/local/lib/python3.10/dist-packages/jupyterhub/handlers/base.py:1115> exception=APIError(HTTPError('400 Client Error: Bad Request for url: http://host.docker.internal:2375/v1.47/containers/1a7048e1f4eec6e53caedf6764c1f9b79c307c282b222e55df634a6dab54ec0b/start'))> after timeout
2024-11-28 09:52:16     Traceback (most recent call last):
2024-11-28 09:52:16       File "/usr/local/lib/python3.10/dist-packages/tornado/gen.py", line 624, in error_callback
2024-11-28 09:52:16         future.result()
2024-11-28 09:52:16       File "/usr/local/lib/python3.10/dist-packages/jupyterhub/handlers/base.py", line 1122, in finish_user_spawn
2024-11-28 09:52:16         await spawn_future
2024-11-28 09:52:16       File "/usr/local/lib/python3.10/dist-packages/jupyterhub/user.py", line 1021, in spawn
2024-11-28 09:52:16         raise e
2024-11-28 09:52:16       File "/usr/local/lib/python3.10/dist-packages/jupyterhub/user.py", line 920, in spawn
2024-11-28 09:52:16         await asyncio.wait_for(f, timeout=spawner.start_timeout)
2024-11-28 09:52:16       File "/usr/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
2024-11-28 09:52:16         return fut.result()
2024-11-28 09:52:16       File "/usr/local/lib/python3.10/dist-packages/dockerspawner/dockerspawner.py", line 1343, in start
2024-11-28 09:52:16         await self.start_object()
2024-11-28 09:52:16       File "/usr/local/lib/python3.10/dist-packages/dockerspawner/dockerspawner.py", line 1219, in start_object
2024-11-28 09:52:16         await self.docker("start", self.container_id)
2024-11-28 09:52:16       File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
2024-11-28 09:52:16         result = self.fn(*self.args, **self.kwargs)
2024-11-28 09:52:16       File "/usr/local/lib/python3.10/dist-packages/dockerspawner/dockerspawner.py", line 993, in _docker
2024-11-28 09:52:16         return m(*args, **kwargs)
2024-11-28 09:52:16       File "/usr/local/lib/python3.10/dist-packages/docker/utils/decorators.py", line 19, in wrapped
2024-11-28 09:52:16         return f(self, resource_id, *args, **kwargs)
2024-11-28 09:52:16       File "/usr/local/lib/python3.10/dist-packages/docker/api/container.py", line 1136, in start
2024-11-28 09:52:16         self._raise_for_status(res)
2024-11-28 09:52:16       File "/usr/local/lib/python3.10/dist-packages/docker/api/client.py", line 277, in _raise_for_status
2024-11-28 09:52:16         raise create_api_error_from_http_exception(e) from e
2024-11-28 09:52:16       File "/usr/local/lib/python3.10/dist-packages/docker/errors.py", line 39, in create_api_error_from_http_exception
2024-11-28 09:52:16         raise cls(e, response=response, explanation=explanation) from e
2024-11-28 09:52:16     docker.errors.APIError: 400 Client Error for http://host.docker.internal:2375/v1.47/containers/1a7048e1f4eec6e53caedf6764c1f9b79c307c282b222e55df634a6dab54ec0b/start: Bad Request ("failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/usr/local/bin/repo2docker-entrypoint": permission denied: unknown")
2024-11-28 09:52:16     

no one know how to solve it?

I had resovle this problem by remove docker image created by repo2image