I just upgraded CiviCRM on a test version of my Drupal 7.54 site from 4.7.15 to 4.7.23 and get the following (edited) error when going to system status in CiviCRM.

Warning: mkdir(): Permission denied in Civi\Core\AssetBuilder->build() (line 167 of sites/all/modules/contrib/civicrm/Civi/Core/AssetBuilder.php). Warning: file_put_contents(sites/default/files/civicrm/persist/contribute/dyn/angular-modules.eef75e30334ca152b0d58bf58d4xxxxx.js): failed to open stream: No such file or directory in Civi\Core\AssetBuilder->build() (line 171 of sites/all/modules/contrib/civicrm/Civi/Core/AssetBuilder.php)

I made sure that I deleted templates_c and made it and all CiviCRM files writeable to the server.

  • I've had the same issue with an upgrade of CiviCRM database in Wordpress. I think the database must have some references to old resource files as I have also deleted caches.
    – FGiorlando
    Commented Jun 13, 2019 at 15:31

2 Answers 2


This suggests a file permission issue on the relevant folder - which is sites/default/files/civicrm/persist/contribute/dyn/.

First, ensure the parent folders exist - both sites/default/files/civicrm/persist/contribute/dyn/ and sites/default/files/civicrm/persist/contribute/. If both exist, check the permission AND owner of the dyn folder. Is the owner the same user as the webserver user? Likewise, if dyn doesn't exist do the same for contribute. If you're not sure how to check owner/permissions, or how to interpret them, please either a) hop on https://chat.civicrm.org, or b) update the question with your operating system (including the distribution, if Linux) and webserver software (most likely Apache or nginx).

  • What's interesting is that the dyn directory didn't exist. Since it was on a test site, I undid the upgrade for now but will revisit the issue when I upgrade officially and see if it's still an issue. It was probably a caching issue since it was asking for a file that doesn't exist.
    – Christia
    Commented Sep 3, 2017 at 23:37
  • CiviCRM will create the dyn directory, but it may not have had the permissions to do so. Which is odd - there's a permission check that runs daily that will flag if there's an issue. Since it's a test site, I suspect that either a) the check didn't have a chance to run, or b) your Directories settings are different. Commented Sep 4, 2017 at 0:31

I had a similar issue in WordPress. I believe the issue is caused because the upgrade script requires resource files to be in their expected place from the old version. So, if you've created a new install and are just migrating a database, then the error may be triggered.

The resource locations have changed between database versions, so the update script fails if it can't find the old resource files.

I fixed this by copying the old resource files to the expected location (as they are listed in the error - in my case this was plugins/files/civicrm).

For reference, I was updating the CiviCRM database from 4.7.9 to 5.13.5 on Wordpress 5.11. Once the files are available, the update should run (In my case, I needed to retrigger the update with http://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.