Brand New Trellis Provisioned Server with Deployed Site load-scripts Issue

I provisioned a Trellis server on Hetzner ARM Ubuntu 24.0.4. I replaced my-site.test by my-site.com, imported the database, uploaded media and updated urls:

wp db import img-13-02-2025.sql 
wp search-replace http://my-site.test https://my-site.com --dry-run
wp search-replace http://my-site.test https://my-site.com
wp search-replace my-site.test my-site.com --dry-run
wp search-replace my-site.test my-site.com

Also did flush cache and rewrite rules:

wp cache flush
wp rewrite flush

It is loading, but backend has issues. Slow and WordPress on hover sidebar menu items in dashboard do not load. I see

[Error] Failed to load resource: the server responded with a status of 500 () (load-scripts.php, line 0)
[Error] Failed to load resource: the server responded with a status of 500 () (load-scripts.php, line 0)
[Error] Refused to execute https://my-site.com/wp/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=wp-hooks,jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-tooltip&ver=6.7.2 as script because "X-Content-Type-Options: nosniff" was given and its Content-Type is not a script MIME type.
[Error] ReferenceError: Can't find variable: jQuery
	Global Code (tooltip_init.min.js:1:1316)
[Error] Refused to execute https://my-site.com/wp/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=hoverIntent,wp-dom-ready&ver=6.7.2 as script because "X-Content-Type-Options: nosniff" was given and its Content-Type is not a script MIME type.
[Error] TypeError: undefined is not an object (evaluating 'window.wp.hooks')
	(anonymous function) (i18n.min.js:2:8814)
	(anonymous function) (i18n.min.js:2:9068)
	Global Code (i18n.min.js:2:9105)

Post start up there were some PHP complaints about too few child processes

tail -f /var/log/php8.2-fpm.log 
[13-Feb-2025 04:41:29] WARNING: [pool wordpress] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 0 idle, and 6 total children
[13-Feb-2025 04:41:30] WARNING: [pool wordpress] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 7 total children
[13-Feb-2025 04:41:31] WARNING: [pool wordpress] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 8 total children

but that seems fine now:

ps -ylC php-fpm --sort:rss -u www-data
S   UID     PID    PPID  C PRI  NI   RSS    SZ WCHAN  TTY          TIME CMD
S    33   31228   30685  0  80   0  6640  9247 ep_pol ?        00:00:00 nginx
S    33   31227   30685  0  80   0 13204  9641 ep_pol ?        00:00:02 nginx
S    33   31226   30685  0  80   0 14704 10054 ep_pol ?        00:00:02 nginx

Nginx logs are also minimal

tail -f /var/log/nginx/error.log 
2025/02/13 02:31:11 [error] 30943#30943: *15 "/etc/nginx/html/index.html" is not found (2: No such file or directory), client: 216.24.87.112, server: www.my-site.com, request: "GET / HTTP/1.0", host: "188.245.200.144:80"

How can I remedy this with Trellis? Should I perhaps deploy again? Second provision with second server in two days already cause I did not start out with Let’s Encrypt SSL properly the first time around - do now:

# Created by trellis-cli v1.13.0
# Documentation: https://roots.io/trellis/docs/wordpress-sites/

wordpress_sites:
  site.com:
    site_hosts:
    - canonical: site.com
      redirects:
      - www.site.com
    local_path: ../site
    branch: main
    repo: git@github.com:site/site.com.git
    repo_subtree_path: site
    multisite:
      enabled: false
    ssl:
      enabled: true
      provider: letsencrypt
    cache:
      enabled: false

repository with trellis , site including sage here.
so I hope we can remedy this properly without too much of a hassle.

Never mind. Just that that. I redeployed and that seems to solve matters

trellis deploy production
Running command => ansible-playbook deploy.yml -e env=production -e site=domain.com

PLAY [Ensure necessary variables are defined] **********************************

TASK [Ensure environment is defined] *******************************************
skipping: [localhost]

PLAY [Test Connection] *********************************************************

TASK [connection : Require manual definition of remote-user] *******************
skipping: [XXX.XXX.XXX.XXX]

TASK [connection : Check whether Ansible can connect as web] *******************
ok: [XXX.XXX.XXX.XXX -> localhost]

TASK [connection : Warn about change in host keys] *****************************
skipping: [XXX.XXX.XXX.XXX]

TASK [connection : Set remote user for each host] ******************************
skipping: [XXX.XXX.XXX.XXX]

TASK [connection : Announce which user was selected] ***************************
skipping: [XXX.XXX.XXX.XXX]

TASK [connection : Load become password] ***************************************
skipping: [XXX.XXX.XXX.XXX]

PLAY [Deploy WP site] **********************************************************

TASK [Gathering Facts] *********************************************************
[WARNING]: Platform linux on host XXX.XXX.XXX.XXX is using the discovered
Python interpreter at /usr/bin/python3.12, but future installation of another
Python interpreter could change the meaning of that path. See
https://docs.ansible.com/ansible-
core/2.17/reference_appendices/interpreter_discovery.html for more information.
ok: [XXX.XXX.XXX.XXX]

TASK [Ensure site is valid] ****************************************************
skipping: [XXX.XXX.XXX.XXX]

TASK [Ensure repo is valid] ****************************************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Check if deploy_before scripts exist] ***************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : include_tasks] **************************************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Check if deploy_initialize_before scripts exist] ****************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : include_tasks] **************************************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Initialize] *****************************************************
ok: [XXX.XXX.XXX.XXX]

TASK [deploy : Check if deploy_initialize_after scripts exist] *****************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : include_tasks] **************************************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Check if deploy_update_before scripts exist] ********************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : include_tasks] **************************************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Add known_hosts] ************************************************
changed: [XXX.XXX.XXX.XXX] => (item=github.com)
ok: [XXX.XXX.XXX.XXX] => (item=github.com)
ok: [XXX.XXX.XXX.XXX] => (item=bitbucket.org)
ok: [XXX.XXX.XXX.XXX] => (item=bitbucket.org)
ok: [XXX.XXX.XXX.XXX] => (item=gitlab.com)
ok: [XXX.XXX.XXX.XXX] => (item=gitlab.com)

TASK [deploy : Clone project files] ********************************************
ok: [XXX.XXX.XXX.XXX]

TASK [deploy : Failed connection to remote repo] *******************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Remove untracked files from project folder] *********************
ok: [XXX.XXX.XXX.XXX]

TASK [deploy : Check if deploy_update_after scripts exist] *********************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : include_tasks] **************************************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Check if deploy_prepare_before scripts exist] *******************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : include_tasks] **************************************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Check for project repo subtree] *********************************
ok: [XXX.XXX.XXX.XXX]

TASK [deploy : Fail if repo_subtree_path is set incorrectly] *******************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Create new release dir] *****************************************
changed: [XXX.XXX.XXX.XXX]

TASK [deploy : Run git archive to populate new build dir] **********************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Run git archive with subdirectory to populate new build dir] ****
changed: [XXX.XXX.XXX.XXX]

TASK [deploy : write unfinished file] ******************************************
changed: [XXX.XXX.XXX.XXX]

TASK [deploy : Check if deploy_prepare_after scripts exist] ********************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : include_tasks] **************************************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Check if deploy_build_before scripts exist] *********************
ok: [XXX.XXX.XXX.XXX -> localhost] => (item=/Users/user/code/domain.com/trellis/deploy-hooks/build-before.yml)

TASK [deploy : include_tasks] **************************************************
included: /Users/user/code/domain.com/trellis/deploy-hooks/build-before.yml for XXX.XXX.XXX.XXX => (item=/Users/user/code/domain.com/trellis/deploy-hooks/build-before.yml)

TASK [deploy : Install npm dependencies] ***************************************
changed: [XXX.XXX.XXX.XXX -> localhost]

TASK [deploy : Install Composer dependencies] **********************************
changed: [XXX.XXX.XXX.XXX]

TASK [deploy : Compile assets for production] **********************************
changed: [XXX.XXX.XXX.XXX -> localhost]

TASK [deploy : Check for entrypoints] ******************************************
ok: [XXX.XXX.XXX.XXX -> localhost]

TASK [deploy : Entrypoints missing] ********************************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Copy production assets] *****************************************
changed: [XXX.XXX.XXX.XXX]

TASK [deploy : Copy project templates] *****************************************
changed: [XXX.XXX.XXX.XXX] => (item=.env config)

TASK [deploy : Check if project folders exist] *********************************
ok: [XXX.XXX.XXX.XXX] => (item=vendor)

TASK [deploy : Copy project folders] *******************************************
changed: [XXX.XXX.XXX.XXX] => (item=vendor)

TASK [deploy : Check if deploy_build_after scripts exist] **********************
ok: [XXX.XXX.XXX.XXX -> localhost] => (item=/Users/user/code/domain.com/trellis/roles/deploy/hooks/build-after.yml)
ok: [XXX.XXX.XXX.XXX -> localhost] => (item=/Users/user/code/domain.com/trellis/deploy-hooks/build-after.yml)

TASK [deploy : include_tasks] **************************************************
included: /Users/user/code/domain.com/trellis/roles/deploy/hooks/build-after.yml for XXX.XXX.XXX.XXX => (item=/Users/user/code/domain.com/trellis/roles/deploy/hooks/build-after.yml)
included: /Users/user/code/domain.com/trellis/deploy-hooks/build-after.yml for XXX.XXX.XXX.XXX => (item=/Users/user/code/domain.com/trellis/deploy-hooks/build-after.yml)

TASK [deploy : Check for composer.json in project root or project_subtree_path] ***
ok: [XXX.XXX.XXX.XXX]

TASK [deploy : Fail if composer.json not found] ********************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Setup composer authentications (HTTP Basic)] ********************
ok: [XXX.XXX.XXX.XXX] => (item=None)
ok: [XXX.XXX.XXX.XXX]

TASK [deploy : Setup composer authentications (BitBucket OAuth)] ***************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Setup composer authentications (Other Tokens)] ******************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Run composer check] *********************************************
changed: [XXX.XXX.XXX.XXX]

TASK [deploy : Install Composer dependencies] **********************************
changed: [XXX.XXX.XXX.XXX]

TASK [deploy : Check if deploy_share_before scripts exist] *********************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : include_tasks] **************************************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Ensure shared sources are present -- directories] ***************
ok: [XXX.XXX.XXX.XXX] => (item=web/app/uploads)

TASK [deploy : Ensure shared sources are present -- files' parent directories] ***
skipping: [XXX.XXX.XXX.XXX] => (item=web/app/uploads) 
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Ensure shared sources are present -- files] *********************
skipping: [XXX.XXX.XXX.XXX] => (item=web/app/uploads) 
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Ensure parent directories for shared paths are present] *********
ok: [XXX.XXX.XXX.XXX] => (item=web/app/uploads)

TASK [deploy : Ensure shared paths are absent] *********************************
changed: [XXX.XXX.XXX.XXX] => (item=web/app/uploads)

TASK [deploy : Create shared symlinks] *****************************************
changed: [XXX.XXX.XXX.XXX] => (item=web/app/uploads)

TASK [deploy : Check if deploy_share_after scripts exist] **********************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : include_tasks] **************************************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Check if deploy_finalize_before scripts exist] ******************
ok: [XXX.XXX.XXX.XXX -> localhost] => (item=/Users/user/code/domain.com/trellis/roles/deploy/hooks/finalize-before.yml)

TASK [deploy : include_tasks] **************************************************
included: /Users/user/code/domain.com/trellis/roles/deploy/hooks/finalize-before.yml for XXX.XXX.XXX.XXX => (item=/Users/user/code/domain.com/trellis/roles/deploy/hooks/finalize-before.yml)

TASK [deploy : Clean up unused, temporary PHP file with multisite constants that had been used for WordPress Installed checks.] ***
ok: [XXX.XXX.XXX.XXX]

TASK [deploy : Invoke 'wp core is-installed' command] **************************
ok: [XXX.XXX.XXX.XXX]

TASK [deploy : Set "WordPress installed?" result variable (from non-multisite)] ***
ok: [XXX.XXX.XXX.XXX]

TASK [deploy : Set variables used in "WordPress Installed (multisite)?" check] ***
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Invoke 'wp core is-installed' command] **************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Set "WordPress installed?" result variable (from multisite)] ****
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Get WP theme template and stylesheet roots] *********************
ok: [XXX.XXX.XXX.XXX] => (item=template_root)
ok: [XXX.XXX.XXX.XXX] => (item=stylesheet_root)

TASK [deploy : Finalize the deploy] ********************************************
changed: [XXX.XXX.XXX.XXX]

TASK [deploy : Check if deploy_finalize_after scripts exist] *******************
ok: [XXX.XXX.XXX.XXX -> localhost] => (item=/Users/user/code/domain.com/trellis/roles/deploy/hooks/finalize-after.yml)

TASK [deploy : include_tasks] **************************************************
included: /Users/user/code/domain.com/trellis/roles/deploy/hooks/finalize-after.yml for XXX.XXX.XXX.XXX => (item=/Users/user/code/domain.com/trellis/roles/deploy/hooks/finalize-after.yml)

TASK [deploy : Remove WordPress transient containing old release path] *********
changed: [XXX.XXX.XXX.XXX]

TASK [deploy : Update WP theme paths] ******************************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Warn about updating network database.] **************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : Update WP database] *********************************************
changed: [XXX.XXX.XXX.XXX]

TASK [deploy : Reload php-fpm] *************************************************
changed: [XXX.XXX.XXX.XXX]

TASK [deploy : debug] **********************************************************
ok: [XXX.XXX.XXX.XXX] => {
    "msg": "main@2ae7132 deployed as release 20250213053936"
}

TASK [deploy : Check if deploy_after scripts exist] ****************************
skipping: [XXX.XXX.XXX.XXX]

TASK [deploy : include_tasks] **************************************************
skipping: [XXX.XXX.XXX.XXX]

PLAY RECAP *********************************************************************
XXX.XXX.XXX.XXX            : ok=44   changed=18   unreachable=0    failed=0    skipped=41   rescued=0    ignored=0   
localhost                  : ok=0    changed=0    unreachable=0    failed=0    skipped=1   

No error 500s now. Only complaint in health section I should use persistent object cache so perhaps I need to provision with it turned on in trellis/group_vars/production/wordpress_sites.yml

1 Like