ActiveStorage::IntegrityError only in Bitbucket Pipelines

On Bitbuckets pipelines, whenever I try to run a bundle exec rspec that contains rspec test that uses Active Storage I get the following error, for every of these tests:

ActiveStorage::IntegrityError:
ActiveStorage::IntegrityError
# ./spec/requests/api/v1/spa_clients/identity_providers/update_spec.rb:127:in block (3 levels) in <top (required)>'
# ./spec/requests/api/v1/spa_clients/identity_providers/update_spec.rb:135:in block (3 levels) in <top (required)>'


This is weird since:

• If I run the tests locally everything runs smoothly;
• The same pipeline with the same pipeline image version a few days ago run without errors;

I am really struggling to get more ideas to how to find a solution.

Source: Docker Questions