# Circle CI build failing only on PR builds

**URL:** <https://discuss.circleci.com/t/circle-ci-build-failing-only-on-pr-builds/39615>\
**Category:** Build Environment\
**Tags:** cache\
**Created:** [March 31, 2021, 11:40pm UTC](https://discuss.circleci.com/t/circle-ci-build-failing-only-on-pr-builds/39615 "2021-03-31T23:40:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaro0508](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/zaro0508/32/27068_2.png) [@zaro0508](https://discuss.circleci.com/u/zaro0508)\
**Post date:** [March 31, 2021, 11:40pm UTC](https://discuss.circleci.com/t/circle-ci-build-failing-only-on-pr-builds/39615/1 "2021-03-31T23:40:12Z")

</div>

I’m getting an “Error loading shared library libffi.so.6” only on builds triggered by PRs. I do not see this error when I pushed the exact same change to a branch and circle CI run a build on a branch.

build from PR:  
[https://app.circleci.com/pipelines/github/Sceptre/sceptre/313/workflows/f28a86b9-65cb-4c60-b8eb-4488ed1d5c6d/jobs/5131](https://app.circleci.com/pipelines/github/Sceptre/sceptre/313/workflows/f28a86b9-65cb-4c60-b8eb-4488ed1d5c6d/jobs/5131)

the exact same change pushed to a branch:  
[https://app.circleci.com/pipelines/github/Sceptre/sceptre/314/workflows/0aab2c60-4c8a-43a3-b606-ebae13436de2/jobs/5133](https://app.circleci.com/pipelines/github/Sceptre/sceptre/314/workflows/0aab2c60-4c8a-43a3-b606-ebae13436de2/jobs/5133)

Anybody know why this is happening? I thought it might be a cache issue since each branch has a separate cache. I have `{{ .Environment.CACHE_VERSION }}` in save\_cache key and have tried to clear the cache by changing the `CACHE_VERSION` value in circle ENV VAR but that didn’t fix build failure. I don’t know where or how to clear the cache for the environment that runs PR builds. Was wondering if anybody else would know?

---

<div class="post-metadata">

**Author:** ![Henna](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/henna/32/29402_2.png) [@Henna](https://discuss.circleci.com/u/Henna)\
**Post date:** [April 8, 2021, 8:35pm UTC](https://discuss.circleci.com/t/circle-ci-build-failing-only-on-pr-builds/39615/2 "2021-04-08T20:35:26Z")

</div>

Hi @zaro0508,

I had a look at your builds, it looks like your PR’s do not have access to your `sceptre-core` context. Therefore the PR does not have access to environment variables saved as context and the value set for the `CACHE_VERSION` environment variable.

You can read more about how contexts works [here](https://circleci.com/docs/2.0/contexts/)

You can save your `CACHE_VERSION` environment variable as an [environment variable](https://circleci.com/docs/2.0/env-vars/#overview) for the project.

Let me know if you have any additional questions.
