CERT-Polska/Artemis

Installation fails on `git apply nuclei-rate-limiting.patch`: `error: corrupt patch at line 7`

Closed this issue · 6 comments

on v 2.3.0 with Artemis-modules-extra: docker compose -f docker-compose.yaml -f Artemis-modules-extra/docker-compose.yml up --build fails with

------
> [artemis_karton-shodan_vulns  7/14] RUN cd /nuclei && git apply nuclei-rate-limiting.patch  && cd v2/cmd/nuclei && go build && GOBIN=/usr/local/bin/ go install:
#85 2.234 error: corrupt patch at line 7
------
------
> [artemis_karton-port_scanner internal] load build context:
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c cd /nuclei && git apply nuclei-rate-limiting.patch  && cd v2/cmd/nuclei && go build && GOBIN=/usr/local/bin/ go install]: exit code: 128

Hello,

can you upgrade to 2.4.0, update Artemis-modules-extra to the latest version and provide the hash (e.g. sha256) of nuclei-rate-limiting.patch to make sure the file is not corrupted?

I upgraded to Artemis 2.4.0 and Artemis-modules-extra to 1.0.0, but the error persists.
nuclei-rate-limiting.patch file SHA256 is ff11a349dcc958762b8f0900461d843b57b5a05082271a52f51177bc3dc2d4e3

Hello,

unfortunately, this is not a correct checksum (the correct one is d65c2ac75e7960588482a22253023c6d2068c20ac330a4ff58529732fba4e279). This file never had the checksum you provided - can you describe how you obtained Artemis source code?

Here are the exact steps I took:

git clone https://github.com/CERT-Polska/Artemis.git --branch v2.4.0
cd Artemis
git clone https://github.com/CERT-Polska/Artemis-modules-extra.git --branch v1.0.0
cp env.example .env
docker compose -f docker-compose.yaml -f Artemis-modules-extra/docker-compose.yml up --build

... and then I checked SHA256 of Artemis/docker/patches/nuclei-rate-limiting.patch with CertUtil -hashfile docker/patches/nuclei-rate-limiting.patch SHA256

From what I observe in the commands you provided, you are using Windows. Is Git on Windows, by any chance, converting newlines (from \n to \r\n)?

If yes, disabling this feature (and cloning the repository once again) should help.

Please let me know whether this worked.

Indeed, after changing endline handling in Git, everything seems to work. Thank you!