Fix git HTTP 408 errors in Docker builds
I cannot build the Docker image anymore using the latest changes since we introduced treesitter; the git-https remote regularly hangs up with error: RPC failed; HTTP 408 curl 22 The requested URL returned error: 408
:
19.57 error: RPC failed; HTTP 408 curl 22 The requested URL returned error: 408
19.57 fatal: error reading section header 'shallow-info'
19.57 Traceback (most recent call last):
19.57 File "/app/scripts/build-tree-sitter-lib.py", line 81, in <module>
19.57 sys.exit(main())
19.57 File "/app/scripts/build-tree-sitter-lib.py", line 60, in main
19.57 with working_directory(vendor_dir / "tree-sitter-typescript"):
19.57 File "/usr/local/lib/python3.9/contextlib.py", line 119, in __enter__
19.58 return next(self.gen)
19.58 File "/app/scripts/build-tree-sitter-lib.py", line 33, in working_directory
19.58 os.chdir(path)
19.58 FileNotFoundError: [Errno 2] No such file or directory: '/app/scripts/vendor/Linux-6.3.12-200.fc38.x86_64-x86_64-with-glibc2.31/tree-sitter-typescript'
------
Dockerfile:39
--------------------
37 | # Build tree-sitter library for the grammars supported
38 | COPY scripts /app/scripts
39 | >>> RUN poetry run python /app/scripts/build-tree-sitter-lib.py
40 |
41 | ##
--------------------
ERROR: failed to solve: process "/bin/sh -c poetry run python /app/scripts/build-tree-sitter-lib.py" did not complete successfully: exit code: 1
ERROR: Service 'api' failed to build : Build failed
make: *** [Makefile:17: develop-local] Error 1
I searched for this problem and apparently it can be an issue when using HTTP/2. Forcing git-https calls to use HTTP/1.1 instead fixes this problem: https://github.com/orgs/community/discussions/55820
Edited by Matthias Käppler