Invalid drush.yaml

Hi All,
I’m running a Drupal 8 project, standard composer setup. I have few Drush commands running on the deployment hook and they were working fine for a long time, after adding varnish cache, I start getting the r=error below:

Executing deploy hook for application APP_NAME
Failed to find a site URL
The file exists but may be invalid: /app/.drush/drush.yml

Is that a side effect of using varnish, Is there a way around that.

Thanks

0

Comments

2 comments
Date Votes
  • Official comment

    A bit of a late reply but nice to have if you google upon it. 
    The problem is most likely that no upstream routes are going into the app. Possible the use of redirectionio agent or varnish.

    the `platformsh_generate_drush_yml.php` script can't deal with that. 

    But you can kinda make it work by just getting the first upstream route yourself and writing that to the yml

    deploy: |
        set -e
        # we're using redirectionio, so this won't work, turn it off and generate the thing manually.
        #    php ./drush/platformsh_generate_drush_yml.php
        # use this to get the actual upstream url:    
        
        UPSTREAM=$(echo "$PLATFORM_ROUTES" | base64 -d | jq -r 'to_entries[] | select(.value.type=="upstream") | .key' | head -n1)
        echo "Upstream url = $UPSTREAM"
        
        # and then, write the drush.yml file
        cat > /app/.drush/drush.yml <<EOF
    options:
      # Set the default site URL.
      uri: "$UPSTREAM"
    EOF
        
        drush -y cache-rebuild
        drush -y updatedb
        
  • That doesn’t sound like usual behavior. You’re best off filing a support ticket and letting them take a look.

    0

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post