pipeline failing since it can not download maven repo cache
Asked by Peter Yang:

we have a pipeline works before ,but recently it keeps fail due to the timeout issue.

Comparing the logs , seems the previous successful build can download the maven cache in the **Build Setup** step

    Cache "maven: ~/.m2/repository": Downloading
    Cache "maven: ~/.m2/repository": Downloaded 103.9 MiB in 6 seconds
    Cache "maven: ~/.m2/repository": Extracting
    Cache "maven: ~/.m2/repository": Extracted in 1 seconds

`and now in the `**Build Setup**` , it has this instead, so in the pipeline it will need download all the dependency and eventually cause the pipeline failed due to timeout.`  

    Cache "maven: ~/.m2/repository": Downloading
    Cache "maven: ~/.m2/repository": Not found

anyone know why it can not download the repo cache now?


Answers:
author: Ben
body: Hi Peter,

How much time has passed between the build where the cache was able to download and the build where the cache had failed to download?

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: Peter Yang
body: hi Ben

Thanks for replying.

when the build can download the m2 cache, it takes less than 30 mins . now since it can not download the caches, it will take 2hrs and still not finished, so it's failed with "Exceeded build time limit of 120 minutes" error message.


author: Ben
body: Hi Peter,

If there was a 7 day period between builds, the cache would have been expired and this would explain why it needed to be downloaded again fresh.

May I know how large the cache is that needs to be downloaded? Is there any chance that this could be reduced or compressed?

Cheers!

- Ben (Bitbucket Cloud Support)


author: Peter Yang
body: hi Ben,

Thanks for replying. I am actually not sure how large the cache needs to be downloaded or where the cache downloads from. from our pipeline.yml file, it just configured this caches as **maven** , I am not sure where the cache stores

![screenshot-pipeline.png](https://community.atlassian.com/t5/image/serverpage/image-id/308801i5F92D3BE81A69269/image-size/large?v=v2&px=999 "screenshot-pipeline.png")


author: Ben
body: Hey Peter,

The cache can be found at the location below as per its [default location](https://support.atlassian.com/bitbucket-cloud/docs/cache-dependencies/):  
**\~/.m2/repository**

Are you able to check the size of this location?

Cheers!

- Ben (Bitbucket Cloud Support)


author: Peter Yang
body: hi Ben,

I am not sure on which server should I check **\~/.m2/repository**, is it configured somewhere in the bitbucket settings?


author: Ben
body: Hi [@Peter Yang](/t5/user/viewprofilepage/user-id/5434506)

This should be created in the build itself, so you should be able to check the size with the following command executed in the build:

```
du -sh?~/.m2/repository
```

If the size is similar (ie 100mb) I do not believe that cache is causing the issue entirely and may only be a small contributing factor, in which case I'd suggest reviewing our documentation for build timeouts and performing troubleshooting based on this:

* <https://confluence.atlassian.com/bbkb/troubleshooting-bitbucket-pipelines-1141505226.html#TroubleshootingBitbucketPipelines-scenario4>

Please let me know if this helps.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

bitbucket-pipelines

cloud