Help! Sage Autoloader Errors after activating theme after seemingly successful deploy

I’m using digital ocean as my host. I was able to get the server provisioned and to do an initial deploy. Going in I’m presented with the WP setup screen. I go through it and it works when i go to activate the sage theme however the entire site becomes broken showing this error at any and every url. Can’t get back in to even the admin side…

Sage › Error
Autoloader not found.
You must run composer install from the Sage directory.

Attempts to deploy again show this following error in the console.

TASK [deploy : Get WP theme template root] ******************************************************************************************************************************************
System info:
  Ansible 2.3.1.0; Darwin
  Trellis at "Option to install WP-CLI packages"
---------------------------------------------------
Error: Sage › ErrorAutoloader not found.. You must run `composer install`
from the Sage directory.
fatal: [104.236.2.159]: FAILED! => {"changed": false, "cmd": ["wp", "option", "get", "template_root", "--skip-plugins"], "delta": "0:00:00.256090", "end": "2017-07-14 06:56:07.552051", "failed": true, "failed_when_result": true, "rc": 1, "start": "2017-07-14 06:56:07.295961", "stderr": "Error: Sage › ErrorAutoloader not found.. You must run `composer install` from the Sage directory.", "stderr_lines": ["Error: Sage › ErrorAutoloader not found.. You must run `composer install` from the Sage directory."], "stdout": "", "stdout_lines": []}
	to retry, use: --limit @/Users/username/project/trellis/deploy.retry

I’ve tried adding a composer install to the build_before.yml and the build_after deploy hooks to no avail. I’ve even tried manually running
composer install
in the current & latest of releases directories.

I’m at a total loss any help would be greatly appreciated.

1 Like

I’ve tried adding a composer install to the build_before.yml and the build_after deploy hooks to no avail. I’ve even tried manually running
composer install
in the current & latest of releases directories.

Are you perhaps confusing the composer install location in Bedrock i.e. site/ or srv/www/yourdomain/current/ with that in your theme directory?

When deploying you should either run a yarn run build:production locally, and allow the dist, vendor and node_modules folders within your .gitignore for your theme (not best practice).

Or alternatively configure the build and composer install process in your build_before.yml - as found here: https://github.com/roots/trellis/blob/master/deploy-hooks/build-before.yml being sure to uncomment and following the instructions of replacing the theme name

8 Likes

Thank you so much. It was late and you are right I was conflating the 2 in my mind. I uncommented all of the lines in the build-before.yml and also discovered a typo there with my themes folder name. After fixing that the deploy finally succeeded. Thanks so much.

1 Like