1

I am trying to setup DDEV on a Drupal 10 project pulled from Acquia Cloud Platform. Following the docs related to Acquia integration, I got to the point where the DB is imported as expected, but I get an error when pulling the files:

Obtaining files...
+ set -eu -o pipefail
+ ls /var/www/html/.ddev
+ pushd /var/www/html/.ddev/.downloads
+ drush -r docroot rsync --exclude-paths=styles:css:js '--alias-path=~/.drush' -q -y @mysite.dev:%files ./files

In BackendPathEvaluator.php line 88:
                                                                  
  Cannot evaluate path alias %files for site alias @mysite.dev  
                                                                  

Pull failed: Failed to exec set -x   # You can enable bash debugging output by uncommenting
set -eu -o pipefail
ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible
pushd /var/www/html/.ddev/.downloads >/dev/null;
drush -r docroot rsync --exclude-paths='styles:css:js' --alias-path=~/.drush -q -y @${project_id}:%files ./files
 on web: exit status 1

Do you have any suggestions on overcoming this error? Do I need to add an aliases file somewhere (although this is not mentioned in the docs)?

Later edit: I have added an aliases file under drush/sites/ folder in the project with the content that can be seen below, but the error is still thrown.

# Application 'mysite', environment 'dev'.
dev:
    root: /var/www/html/docroot
    ac-site: mysite
    ac-env: ...
    ac-realm: ...
    uri: mysite.prod.acquia-sites.com
    host: mysite.ssh.prod.acquia-sites.com
    user: mysite.dev
    paths:
        - drush-script: drush9
        - files: sites/default/files

Also tried "%files": sites/default/files but had the same behavior.

Using ddev drush sa command I get the following output:

'@mysite.dev':
  root: /var/www/html/docroot
  ac-site: mysite
  ac-env: ...
  ac-realm: ...
  uri: mysite.prod.acquia-sites.com
  host: mysitedev.ssh.prod.acquia-sites.com
  user: mysite.dev
  paths:
    -
      drush-script: drush9
    -
      files: sites/default/files

After further investigation, I found out that the aliases file that was added in drush/sites/ folder is not used because the drush rsync command is reading aliases from a different location (--alias-path=~/.drush). At that location are the aliases files downloaded from Acquia Cloud Platform, in which there is no files path alias defined.

Alex_Dms
  • 157
  • 3
  • 11
  • The standard Acquia integration is tested automatically and daily, so this works with a trivial Acquia Drupal9 site. The way to debug this is to manually do the steps in the acquia.yaml inside the web container, https://github.com/ddev/ddev/blob/8e78edd95ec407111780fb4abb3efd36c9cb8e61/pkg/ddevapp/dotddev_assets/providers/acquia.yaml.example#L56-L60 - it looks like drush is failing, and it looks like whatever @dev_env is may be wrong, maybe that's an acquia thing. – rfay Jul 05 '23 at 12:20
  • 1
    @rfay I have enabled bash debugging output, hoping that we can see more details, but we don't get much more info. I am thinking more and more that an aliases file is missing from the project deployed on Acquia's platform. – Alex_Dms Jul 05 '23 at 13:00
  • @rfay after adding the above aliases file, I have used "ddev drush sa" command and it returns the correct site alias. (edited the original message and added the output of this command). However, the path alias error is still reproducing and I cannot import files with the pull command as described in docs. – Alex_Dms Jul 24 '23 at 15:04
  • If you want to look at this further, you can come over to Discord and we can work on it; you can also share the site with me if you can get permission to do that. SO is definitely not a place we can chase it very easily. If you can get permission we can do a live debugging session on Discord as well. https://discord.gg/hCZFfAMc5k – rfay Jul 24 '23 at 16:12

1 Answers1

0

As mentioned in the update made to the question, the error is generated by the fact that drush rsync command is called with --alias-path=~/.drushparamter. In that folder are located the aliases files downloaded from Acquia Cloud Platform, but in those files there are no path aliases defined for files. The aliases file added in the project is not used when --alias-path=~/.drush parameter is specified.

I was not able to determine what is wrong in the overall process (since I am following docs and I suppose those steps are tested and verified). Maybe there is some configuration that needs to be done on Acquia Cloud Platform to include a path alias for files, or maybe aliases files from Acquia Cloud Platform should not define a path alias for files and that should be resolved somehow automatically when default folders are used, but didn't find an answer for these assumptions.

However, I was able to find a workaround by adding an aliases file in the project in which is defined a path alias for files and after that modify the drush rsync command to not specify the --alias-path=~/.drush parameter anymore.

Alex_Dms
  • 157
  • 3
  • 11