Sometimes when a concourse pipeline is getting build, it tries to use the previous version of resource, not the latest one. I could confirm this because the resource hash don't match. Please let me know a solution to flush the resource hash.
5 Answers
Concourse v7.4.0 (released August 2021) adds the command
fly clear-resource-cache -r <pipeline>/<resource>
which will do what you are looking for.
See:
- the documentation for clear-resource-cache.
- the release notes for v7.4.0

- 4,573
- 2
- 26
- 41
-
1Any idea on how to do this for earlier versions? My company is on an older version so I can't use this command. – rup Nov 17 '21 at 03:21
-
@rup: see the other answer to the question. – marco.m Nov 17 '21 at 19:29
-
For the older version I was able to use fly -t ci clear-task-cache – Artan M. Jul 14 '23 at 16:12
The only way to flush the resource cache is to restart all the workers, as this will clear your ephemeral disks.

- 1,054
- 7
- 15
The fly clear-resource-cache -r <pipeline>/<resource>
command doesn't work for older versions.
To achieve similar results, you can use
fly -t ci clear-task-cache -j <pipeline>/<resource> -s <step-name>
Check the help command for more info:
Usage:
fly [OPTIONS] clear-task-cache [clear-task-cache-OPTIONS]
Application Options:
-t, --target= Concourse target name
-v, --version Print the version of Fly and exit
--verbose Print API requests and responses
--print-table-headers Print table headers even for redirected output
Help Options:
-h, --help Show this help message
[clear-task-cache command options]
-j, --job= Job to clear cache from
-s, --step= Step name to clear cache from
-c, --cache-path= Cache directory to clear out
-n, --non-interactive Destroy the task cache(s) without confirmation

- 817
- 1
- 11
- 16
For resources:
fly -t example clear-resource-cache -r my-pipeline/my-resource
Corresponding documenation link.
For tasks: I've tested this on 7.9.1 (fairly recently as of this post - about 3 weeks ago).
fly -t demo clear-task-cache --job java-api-pipeline/compile-app-task --step task1
To see this in action see the online course " Getting Started with Concourse CI" on Pluralsight, Module 4: Composing and Managing Pipelines, Clip 4: Demo: Running and Managing Pipelines.

- 438
- 4
- 8
As of the time of this writing 2023-06-21, the command to clear the cache requires a target, so:
fly -t <target> clear-resource-cache -r <pipeline>/<resource>
Sample:
fly -t demo destroy-pipeline -p java-api-pipeline

- 438
- 4
- 8