Updating Trellis issues and errors

I would have opened up an old topic on this but they’re all closed.

Ran vagrant up on a project I was working on last week and my browser says it can’t be reached. This just happened out of nowhere it seems. I’m able to boot up other instances of other projects just fine but this one particular project won’t run.

So I went ahead and destroyed the instance and tried again. Vagrant up completes the process without issues or errors and virtual box says the instance is running but I get nothing.

I ran vagrant reload --provision and it runs through the process and spits out the following error:

ERROR! Unexpected Exception, this is probably a bug: 'PlaybookCLI' object has no attribute 'options'

Nothing has changed since last week when I was working on it.
Running Ansible 2.8

I decided to update Trellis to latest version based on the response posted by @MWDelaney, here:

Now that I’ve done that, the original error on this post is gone but now I’m getting the following error with no clear indication of what the problem is:

TASK [wordpress-install : Setup composer authentications - project.com] ***
System info:
  Ansible 2.9.5; Vagrant 2.2.4; Darwin
  Trellis Head
---------------------------------------------------
fatal: [default]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}

PLAY RECAP *********************************************************************
default                    : ok=104  changed=10   unreachable=0    failed=1    skipped=38   rescued=0    ignored=0   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

If there’s any details I need to provide to help sort this out, please let me know.

With zero success overcoming these issue, I started from scratch and spooled up a new instance locally and all is well.

I copied over the bedrock directory and synced down the database from staging as well.

Now I’m attempting to get the staging and production servers provisioned with the latest version of trellis so that lets encrypt will auto renew on it’s own.

This is the error I’m receiving now:

Failed to update apt cache: W:This must be accepted explicitly before updates
for this repository can be applied. See apt-secure(8) manpage for details.,
E:Repository 'http://ppa.launchpad.net/nginx/development/ubuntu bionic
InRelease' changed its 'Label' value from 'NGINX Mainline' to 'NGINX Mainline
(1.15.x)'
fatal: [staging.project.com]: FAILED! => {"changed": false}

I found this post, which is a similar issue:

So I began to perform the steps from the included article:

https://ahelpme.com/linux/ubuntu/ubuntu-apt-inrelease-is-not-valid-yet-invalid-for-another-151d-18h-5min-59s/

Here’s the response:

# apt update
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:2 http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.2/ubuntu bionic InRelease    
Hit:3 http://ppa.launchpad.net/nginx/mainline/ubuntu bionic InRelease                   
Hit:4 http://archive.ubuntu.com/ubuntu bionic InRelease                                 
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]               
Hit:6 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease                       
Get:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]          
Fetched 252 kB in 1s (232 kB/s)    
Reading package lists... Done
Building dependency tree       
Reading state information... Done
221 packages can be upgraded. Run 'apt list --upgradable' to see them.
# date
Tue Feb 25 20:22:50 UTC 2020
# 

The data appears to be correct except for the time. I attempted to update the time but that didn’t stick. I’m not really sure where to go from here.

Here’s the full output:

<staging.project.com> Failed to connect to the host via ssh: 
System info:
  Ansible 2.9.5; Darwin
  Trellis Head
---------------------------------------------------
Failed to update apt cache: W:This must be accepted explicitly before updates
for this repository can be applied. See apt-secure(8) manpage for details.,
E:Repository 'http://ppa.launchpad.net/nginx/development/ubuntu bionic
InRelease' changed its 'Label' value from 'NGINX Mainline' to 'NGINX Mainline
(1.15.x)'
fatal: [staging.project.com]: FAILED! => {
    "changed": false, 
    "invocation": {
        "module_args": {
            "allow_unauthenticated": false, 
            "autoclean": false, 
            "autoremove": false, 
            "cache_valid_time": 0, 
            "deb": null, 
            "default_release": null, 
            "dpkg_options": "force-confdef,force-confold", 
            "force": false, 
            "force_apt_get": false, 
            "install_recommends": null, 
            "only_upgrade": false, 
            "package": null, 
            "policy_rc_d": null, 
            "purge": false, 
            "state": "present", 
            "update_cache": true, 
            "upgrade": null
        }
    }
}

PLAY RECAP ******************************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0   
staging.project.com  : ok=8    changed=0    unreachable=0    failed=1    skipped=12   rescued=0    ignored=0

You’re using Ansible 2.9.5 which is not supported. Try downgrading to 2.8.x and hopefully it will solve some (or all) of these issues :smile:

Are you getting the warning about the supported Ansible version? The latest “tested” version of 2.8.4 and it should warn you.

Something must have been corrupt on the droplet because I created a new droplet and was able to provision and deploy just fine AND that was using Ansible 2.9.5???

ALSO, I just now finished provisioning the production droplet with 2.9.5 also?

PLAY RECAP *************************************************************************************************************************************************************************************************************************************************************************************************************************
project.com          : ok=125  changed=26   unreachable=0    failed=0    skipped=49   rescued=0    ignored=0   
localhost                  : ok=0    changed=0    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0   

[trellis] ansible --version
ansible 2.9.5

If it works then that’s great! We just haven’t tested 2.9 so that’s why it’s not supported; not that we know it doesn’t work.

1 Like

Hi @swalkinshaw do you know the command for downgrading ansible? I’ve found loads to install and update but not for downgrading to specific version(s).

Never mind, for those interested, this was the command:

sudo pip install ansible==2.8

This uninstalled my 2.9.6 version and installed 2.8.0

1 Like

I am doing exactly the same as you right now, updating my trellis.

I also followed the advice found here: Let's Encrypt: Certificate expired - #23 by MWDelaney

My OS: macOS High Sierra

Steps taken:

  1. Copy the following files from my existing /trellis
.vault_pass
ansible.cfg
/group_vars
/deploy-hooks
/hosts
  1. Destroy existing machine: vagrant destroy
  2. Delete /trellis
  3. Clone new trellis: git clone --depth=1 git@github.com:roots/trellis.git && rm -rf trellis/.git
  4. Copy config files as listed above into the new /trellis
  5. Run vagrant provision

I’ve got this error:

TASK [wordpress-install : Setup composer authentications - mydomain.co.uk]
System info:
  Ansible 2.8.0; Vagrant 2.2.5; Darwin
  Trellis Head
---------------------------------------------------
fatal: [default]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}

RUNNING HANDLER [common : restart memcached] ***********************************
changed: [default]

RUNNING HANDLER [common : reload php-fpm] **************************************
changed: [default]

RUNNING HANDLER [common : reload nginx] ****************************************
changed: [default]

RUNNING HANDLER [common : perform nginx reload] ********************************
changed: [default]

RUNNING HANDLER [fail2ban : restart fail2ban] **********************************
changed: [default]

RUNNING HANDLER [ferm : restart ferm] ******************************************
[DEPRECATION WARNING]: evaluating ferm_enabled as a bare variable, this
behaviour will go away and you might need to add |bool to the expression in the
 future. Also see CONDITIONAL_BARE_VARS configuration toggle.. This feature
will be removed in version 2.12. Deprecation warnings can be disabled by
setting deprecation_warnings=False in ansible.cfg.
skipping: [default]

RUNNING HANDLER [ntp : restart ntp] ********************************************
changed: [default]

RUNNING HANDLER [sshd : restart ssh] *******************************************
changed: [default]

RUNNING HANDLER [mariadb : restart mysql server] *******************************
changed: [default]

PLAY RECAP *********************************************************************
default                    : ok=123  changed=86   unreachable=0    failed=1    skipped=28   rescued=0    ignored=0

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Some further notes:
My version of Bedrock isn’t the latest, I’m updating only Trellis currently, is there often a requirement to update bedrock at the same time?

Update
I have now even deleted my old site (bedrock) directories and replaced with latest copy too.

Did a vagrant destroy, updated the site directory with a fresh bedrock clone, tried a vagrant up and it failed again, same error.

This topic was automatically closed after 42 days. New replies are no longer allowed.