crowdsecurity / crowdsec

CrowdSec - the open-source and participative security solution offering crowdsourced protection against malicious IPs and access to the most advanced real-world CTI.
https://crowdsec.net
MIT License
9.02k stars 467 forks source link

After pull i get hash mismatch error #3186

Closed mourningsun75 closed 2 months ago

mourningsun75 commented 2 months ago

What happened?

I always update by calling the following steps:

docker compose stop docker compose pull docker compose up -d

Since today i got the following error

level=fatal msg="error while installing 'crowdsecurity/traefik': while downloading crowdsecurity/http-cve: while downloading crowdsecurity/http-cve to https://hub-cdn.crowdsec.net/master/collections/crowdsecurity/http-cve.yaml: hash mismatch: expected dd2e8debbba19d19646b9a8010baf9bd901a4eec84a53a0cb62294b8da3e91ef, got b974f20dc2cf23c292eede422c1c6e0008297f8b3397e3851bb6a988866f3e34"

What did you expect to happen?

No error. An updated environment.

How can we reproduce it (as minimally and precisely as possible)?

docker compose stop docker compose pull docker compose up -d

if necessarry i will post the docker compose yaml

I am not so deep in technical details

Anything else we need to know?

No response

Crowdsec version

In the cocker compose file there "latest" ```console $ cscli version # paste output here ```

OS version

```console # On Linux: $ cat /etc/os-release # paste output here $ uname -a # paste output here # On Windows: C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture # paste output here ```

Enabled collections and parsers

```console $ cscli hub list -o raw # paste output here ```

Acquisition config

```console # On Linux: $ cat /etc/crowdsec/acquis.yaml /etc/crowdsec/acquis.d/* # paste output here # On Windows: C:\> Get-Content C:\ProgramData\CrowdSec\config\acquis.yaml # paste output here

Config show

```console $ cscli config show # paste output here ```

Prometheus metrics

```console $ cscli metrics # paste output here ```

Related custom configs versions (if applicable) : notification plugins, custom scenarios, parsers etc.

github-actions[bot] commented 2 months ago

@mourningsun75: Thanks for opening an issue, it is currently awaiting triage.

In the meantime, you can:

  1. Check Crowdsec Documentation to see if your issue can be self resolved.
  2. You can also join our Discord.
  3. Check Releases to make sure your agent is on the latest version.
Details I am a bot created to help the [crowdsecurity](https://github.com/crowdsecurity) developers manage community feedback and contributions. You can check out my [manifest file](https://github.com/crowdsecurity/crowdsec/blob/master/.github/governance.yml) to understand my behavior and what I can do. If you want to use this for your project, you can check out the [BirthdayResearch/oss-governance-bot](https://github.com/BirthdayResearch/oss-governance-bot) repository.
LaurenceJJones commented 2 months ago

Hey šŸ‘‹šŸ»

We pushed an update to the collection, but if your compose has recently been brought up with mounted volumes you may experience this.

The best way is to run a temporary container to update the index and then quit.

docker run --rm -it --entrypoint cscli -v $MountPath:/etc/crowdsec/ -v $MountPath:/var/lib/crowdsec/data/ crowdsecurity/crowdsec:latest hub update

In the example above I have used $MountPath as place holders for you to update where the mounts are if they are relative via your compose then launch the run within the compose directory with the values updated, if they are named volumes then replace with the named volumes. The names are volumes may have a prefix so check via docker volume ls for the actual names.

This will run a temporary container to update the index, then you should be able to launch the normal compose stack via docker compose up -d

Edit: we are working on updating this, as docker is very susceptible to this issue when we update collections and the user re pulls or restarts the container within 24 hours of us updating the collection.

mourningsun75 commented 2 months ago

Thank you so much, this fixed the problem.

AlexMelnykov commented 2 months ago

I have the same problem and proposed solution fixed it. @LaurenceJJones please consider to add it to troubleshooting documentation.

LaurenceJJones commented 2 months ago

I have the same problem and proposed solution fixed it. @LaurenceJJones please consider to add it to troubleshooting documentation.

Already on it šŸ‘šŸ»