GithubHelp home page GithubHelp logo

trellis-backup-role's People

Contributors

jillro avatar mkaski avatar morcth avatar raph-topo avatar robyurkowski avatar rutger1140 avatar smaboshe avatar xilonz avatar yvalentin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trellis-backup-role's Issues

Check credentials - fresh install

Hello,

Sorry to open another issue but you made the other only open to collaborators. I did actually collab with this role around a year and a half ago. Anyway...

Expected Behavior

Backups should run without error

Actual Behavior

Credentials error - msg #31

Steps to Reproduce the Problem.

I followed the instructions on this repo exactly. I have other servers where all backups still work correctly so I know nothing changed for S3 login on digital oceans. The only things that have changed over the last 18 months or so are this repo and https://github.com/lafranceinsoumise/ansible-backup

  1. Setup a new trellis/bedrock site
  2. Follow this repo to setup backup role for S3 bucket
  3. Check logs for local and/or staging sites at /var/log/duply and see if any errors

Specifications

  • Version: backup v2.1.5 - lafranceinsoumise.backup v5.1.3
  • Platform: Trellis

my vault file:

vault_wordpress_sites:
  site.com:
    env:
      db_password: "password"
      # Generate your keys here: https://roots.io/salts.html
      auth_key: "xxx"
      secure_auth_key: "xxx"
      logged_in_key: "xxx"
      nonce_key: "xxx"
      auth_salt: "xxx"
      secure_auth_salt: "xxx"
      logged_in_salt: "xxx"
      nonce_salt: "xxx"
      backup_target_user: "XXXXXXXXXXXXX"
      backup_target_pass: "XXXXXXXXXXXXX"

When you have time, please try creating a new vanilla trellis site and see that something is not working correctly... you can recreate on your local box as well. I believe the backup target will need to be an AWS S3 or DigitalOcean Spaces. Please try before closing.

Thank you,
Josh

Add backup_mysql_host to tasks

In the current version of the role it isn't possible to use external MySQL host servers.

I've submitted a PR to the role (lafranceinsoumise.backup) that is being used to run the backup. That was approved and merged.

There are two small improvements I want to suggest for the trellis-backup-role.

  1. Adding the backup_mysql_host
  2. Adding the max_full_backups

I'll work out a PR for you, I hope you can approve it.

Errors on restore

Hello!

I'm setting trellis-backup-role on a test site using Google Cloud Storage.
The backup is ok (uploads/database), but when i try restore i get this errors:

sudo duply example.com_uploads restore

Start duply v1.9.1, time is 2017-09-25 11:31:53.
Using profile '/etc/duply/example.com_uploads'.
Using installed duplicity version 0.7.06, python 2.7.12, gpg 1.4.20 (Home: ~/.gnupg), awk 'GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.4, GNU MP 6.1.0)', bash '4.3.48(1)-release (x86_64-pc-linux-gnu)'.
Checking TEMP_DIR '/tmp' is a folder (OK)
Checking TEMP_DIR '/tmp' is writable (OK)
TODO: reimplent tmp space check
Test - En/Decryption skipped. (GPG disabled)

--- Start running command RESTORE at 11:31:53.333 ---
Restore destination directory /srv/www/example.com/shared/uploads already exists.
Will not overwrite.
11:31:53.586 Task 'RESTORE' failed with exit code '11'.
--- Finished state FAILED 'code 11' at 11:31:53.586 - Runtime 00:00:00.253 ---

sudo duply example.com_database restore

Start duply v1.9.1, time is 2017-09-25 11:34:32.
Using profile '/etc/duply/example.com_database'.
Using installed duplicity version 0.7.06, python 2.7.12, gpg 1.4.20 (Home: ~/.gnupg), awk 'GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.4, GNU MP 6.1.0)', bash '4.3.48(1)-release (x86_64-pc-linux-gnu)'.
Checking TEMP_DIR '/tmp' is a folder (OK)
Checking TEMP_DIR '/tmp' is writable (OK)
TODO: reimplent tmp space check
Test - En/Decryption skipped. (GPG disabled)

--- Start running command RESTORE at 11:34:32.604 ---
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: Sat Sep 23 10:57:13 2017
Running '/etc/duply/example.com_database/restore' - OK
Output: ERROR 1142 (42000) at line 22: DROP command denied to user 'backup'@'localhost' for table 'wp_commentmeta'
--- Finished state OK at 11:34:35.868 - Runtime 00:00:03.263 ---

Paramiko installation check fails without setuptools

I'm not sure if this is a standard thing or just a 'me and my personal dev environment setup' thing, but when I try to provision a remote server, installation fails because the setuptools python module can't be found and therefore paramiko can't be installed.

What I did to resolve it was simply SSH in to the box, and run a sudo pip install setuptools, but if others experience this, there's obviously a superior ansible-based solution to this. Just wanted to document this (other keywords that I hunted for: trellis setuptools paramiko) in case someone else bumps into it.

S3 Buckets With V4 Signatures Fail (NoSuchBucket)

I've been trying to get my backups to work for quite a while and I finally figured it out.

The reason it wasn't working is because I'm using ca-central-1 for my region, which only accepts Signature Version 4 for authentication. Duply (and boto) were not happy about this, and I kept getting NoSuchBucket errors.

I did find a solution. This is documented here (basically add export S3_USE_SIGV4="True" to the config file) and I can confirm that this solution works, but only when added to the duply conf file. The problem is we don't really have a way to pass additional confirmation to duply.

The backup role has a way to add configuration to the conf file. Maybe we can piggy-back off of that?

debugging

Hello,

Is there a way to debug and see if the backups are working?

I set it up for google cloud storage, but it doesn't seem to backup, and can't seem to find any cronjobs running.

No package matching 'python-boto' is available

Hi there,

In my latest project using Trellis version 1.21.0 and trellis-backup-role 2.1.7, I'm getting the following error while provisioning my remote servers running ubuntu 22.04:

TASK [lafranceinsoumise.backup : Install backup profile dependencies] **********
failed: [xxx.xxx.xx.xx] (item={'name': 'example.com_uploads', 'schedule': '0 4 * * *', 'source': '/srv/www/example.com/shared/uploads', 'target': 's3://ams3.digitaloceanspaces.com/backups/example.com/uploads', 'target_user': False, 'target_pass': False, 'max_age': '3M', 'full_max_age': '1M', 'max_full_backups': '3', 'params': ['export S3_USE_SIGV4="True"'], 'action': 'purge_backup --force'}) => {"ansible_loop_var": "item", "changed": false, "item": {"action": "purge_backup --force", "full_max_age": "1M", "max_age": "3M", "max_full_backups": "3", "name": "example.com_uploads", "params": ["export S3_USE_SIGV4=\"True\""], "schedule": "0 4 * * *", "source": "/srv/www/example.com/shared/uploads", "target": "s3://ams3.digitaloceanspaces.com/backups/example.com/uploads", "target_pass": false, "target_user": false}, "msg": "No package matching 'python-boto' is available"}
failed: [xxx.xxx.xx.xx] (item={'name': 'example.com_database', 'schedule': '0 4 * * *', 'source': 'mysql://example_production', 'target': 's3://ams3.digitaloceanspaces.com/backups/example.com/database', 'target_user': False, 'target_pass': False, 'max_age': '3M', 'full_max_age': '1M', 'max_full_backups': '3', 'params': ['export S3_USE_SIGV4="True"'], 'action': 'purge_backup --force'}) => {"ansible_loop_var": "item", "changed": false, "item": {"action": "purge_backup --force", "full_max_age": "1M", "max_age": "3M", "max_full_backups": "3", "name": "example.com_database", "params": ["export S3_USE_SIGV4=\"True\""], "schedule": "0 4 * * *", "source": "mysql://example_production", "target": "s3://ams3.digitaloceanspaces.com/backups/example.com/database", "target_pass": false, "target_user": false}, "msg": "No package matching 'python-boto' is available"}

Locally I'm running Python 3.10.10
The provisioned server is running Python 3.10.12.

Am I supposed to install the package python3-boto3 or python3-boto myself now in Trellis?
Anyone else having this issue?

I tried adding both the python3-boto as well as the python3-boto3 package manually like this:

In group_vars/all/main.yml:

apt_packages_custom:
  python-is-python3: "{{ apt_package_state }}"
  python3-boto: "{{ apt_package_state }}"

But same error occurs?
I'm using the exact same configuration/credentials in other running projects, so I'm sure those are correct.

Thanks!

Backup all "project_shared_children"

By default trellis only shares the upload folder with other releases, but you can can change that based on your needs using "project_shared_children". These folders shouldn't be in git, so it should be backupped, right?

FTP backup issue - BackendException: Error running 'lftp -c "

so I'm trying to backup to FTP.

I added user and password variables to all/vault.yml When I had them in production vault I get an error that these variables were not set.

 backup_target_user: user
 backup_target_pass: password

my target is

target: ftp://{{ backup_target_user }}[:{{ backup_target_pass }}]@xyz.ftp.dhosting.pl[:21]

When I get to the server logs at var/log/duply/ is see the following error

--- Start running command BKP at 19:45:03.879 ---
LFTP version is 4.8.4
Reading globbing filelist /etc/duply/marcinkujanek.pl_uploads/exclude
Attempt 1 failed. BackendException: Error running 'lftp -c "source /tmp/duplicity-etq94hg0-tempdir/mkstemp-umg8ffmk-1; ( cd uploads/ && ls ) || ( mkdir -p uploads/ && cd uploads/ && ls )"': returned 1, with output:

open: Not connected
cd: Not connected
mkdir: Not connected


Attempt 2 failed. BackendException: Error running 'lftp -c "source /tmp/duplicity-etq94hg0-tempdir/mkstemp-umg8ffmk-1; ( cd uploads/ && ls ) || ( mkdir -p uploads/ && cd uploads/ && ls )"': returned 1, with output:

open: Not connected
cd: Not connected
mkdir: Not connected


Attempt 3 failed. BackendException: Error running 'lftp -c "source /tmp/duplicity-etq94hg0-tempdir/mkstemp-umg8ffmk-1; ( cd uploads/ && ls ) || ( mkdir -p uploads/ && cd uploads/ && ls )"': returned 1, with output:

open: Not connected
cd: Not connected
mkdir: Not connected


Attempt 4 failed. BackendException: Error running 'lftp -c "source /tmp/duplicity-etq94hg0-tempdir/mkstemp-umg8ffmk-1; ( cd uploads/ && ls ) || ( mkdir -p uploads/ && cd uploads/ && ls )"': returned 1, with output:

open: Not connected
cd: Not connected
mkdir: Not connected


Giving up after 5 attempts. BackendException: Error running 'lftp -c "source /tmp/duplicity-etq94hg0-tempdir/mkstemp-umg8ffmk-1; ( cd uploads/ && ls ) || ( mkdir -p uploads/ && cd uploads/ && ls )"': returned 1, with output:

open: Not connected
cd: Not connected
mkdir: Not connected


19:47:05.072 Task 'BKP' failed with exit code '50'.
--- Finished state FAILED 'code 50' at 19:47:05.072 - Runtime 00:02:01.193 ---

It's looks like we have to update lftp
Solution 1

Restore Error on DigitalOcean

Hello... there is a closed issue very similar to the one I am having but I am not able to fix like he did.

Backing up works flawlessly but restoring gave me:
Output: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I then tried installing auth_socket like this guy did: #17 and the error changed to:
ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded

I changed the root users plugin to auth_socket in the mysql.user table and restarted the server and still the same error. So I do not know how to activate the plugin.

I also added 'plugin-load-add = auth_socket.so' to /etc/mysql/conf.d/mariadb.cnf right below the lastr commented line and restarted service with no change.

Any idea what I can do here?

Thanks,
Josh

Dropbox Not Supported (Out of Box)

I had to enter the following commands to get Dropbox working:

  1. Install pip: apt install pip
  2. Upgrade pip (optional): pip install --upgrade pip
  3. Install Dropbox module pip install dropbox

This was in additional to the additional setup steps which the documentation (both here and in duplicity) could not have made any less clear. Maybe there could be a flag for what the user is going to use that could install additional dependencies like this?

Full documentation for Dropbox:

Create dropbox application

  1. Go to https://www.dropbox.com/developers/apps/create
  2. Choose an API, type of access, and name the app (doesn't matter what you pick)

vault.yml

Add target data to vault file:

vault_wordpress_sites:
  example.com:
    env:
      backup_target_user: <App key>
      backup_target_pass: <App secret>

wordpress_sites.yml

Add backup info to wordpress_sites file:

wordpress_sites:
  example.com:
    env:
      backup:
        <insert other role variables from example in documentation>
        params:
        - 'export DPBX_ACCESS_TOKEN="<Generate Access Token from inside Dropbox App Settinngs>"'

Edit:
Without adding the pip commands you get scheme not supported in url: dpbx:///

'vault_mysql_backup_password' is undefined

Hello!

Deployments have broken from me in the last few days. Is this related to the commits that add mysql_backup_user (Commit a8cae40)?

The error I'm getting is ...

the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'vault_mysql_backup_password' is undefined

The error appears to have been in '/<path to site>/trellis/vendor/roles/trellis-backup/tasks/main.yml': line 16, column 3, but may be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Create backup mysql user
  ^ here

fatal: [default]: FAILED! => {"failed": true}

This stops the Ansible tasks to build the development machine from completing:

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

Errors installing paramiko

Hello!

I have just updated to using the Ansible 2.4 compatible version of Trellis. During vagrant up --provision #--debug, I get the following error:

TASK [trellis-backup : Ensure paramiko is installed] ***************************
System info:
  Ansible 2.4.0.0; Vagrant 2.0.0; Linux
  Trellis at "Normalize `apt` tasks"
---------------------------------------------------
stdout: Collecting paramiko
  Using cached paramiko-2.3.1-py2.py3-none-any.whl
Collecting pynacl>=1.0.1 (from paramiko)
  Using cached PyNaCl-1.1.2-cp27-cp27mu-manylinux1_x86_64.whl
Collecting cryptography>=1.5 (from paramiko)
  Using cached cryptography-2.1-cp27-cp27mu-manylinux1_x86_64.whl

:stderr: Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in
main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 328,
in run
    wb.build(autobuilding=True)
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 748, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in
prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 647, in
_prepare_file
    set(req_to_install.extras) - set(dist.extras)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
2670, in extras
    return [dep for dep in self._dep_map if dep]
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
2713, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
2723, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
2781, in parse_requirements
    yield Requirement(line)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
2790, in __init__
    raise RequirementParseError(str(e))
RequirementParseError: Invalid requirement, parse error at "'; python'"
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

fatal: [default]: FAILED! => {"changed": false, "cmd": "/usr/bin/pip2 install paramiko", "failed": true}

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

RUNNING HANDLER [common : perform nginx reload] ********************************
changed: [default]
        to retry, use: --limit @/home/silumesii/example.com/trellis/dev.retry

PLAY RECAP *********************************************************************
default                    : ok=104  changed=7    unreachable=0    failed=1   

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

Help?

Check your credentials issue

Hello,

A few days ago, I had to reprovision a server that's been working fine with trellis backup for 2 years and was getting errors due to the duply or duplicity repo moving. I also saw that this role had changed a bit... mostly usage names... and the lafranceinsoumise/ansible-backup had a bunch of updates as well.

So I deleted both roles from trellis folder and changed trellis-backup to backup and ran galaxy install and provisioning worked fine. But, backups are no longer running.

--- Start running command BKP at 12:15:09.047 ---
Traceback (innermost last):
  File "/usr/bin/duplicity", line 1581, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1567, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1406, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1140, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1015, in set_backend
    globals.backend = backend.get_backend(bend)
  File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 223, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 209, in get_backend_object
    return factory(pu)
  File "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line 166, in __init__
    self.resetConnection()
  File "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line 188, in resetConnection
    self.conn = get_connection(self.scheme, self.parsed_url, self.storage_uri)
  File "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line 99, in get_connection
    is_secure=(not globals.s3_unencrypted_connection))
  File "/usr/lib/python2.7/dist-packages/boto/storage_uri.py", line 117, in connect
    **connection_args)
  File "/usr/lib/python2.7/dist-packages/boto/s3/connection.py", line 191, in __init__
    validate_certs=validate_certs, profile_name=profile_name)
  File "/usr/lib/python2.7/dist-packages/boto/connection.py", line 569, in __init__
    host, config, self.provider, self._required_auth_capability())
File "/usr/lib/python2.7/dist-packages/boto/auth.py", line 995, in get_auth_handler
    'Check your credentials' % (len(names), str(names)))
 NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['S3HmacAuthV4Handler'] Check your credentials

I did see that the lafranceinsoumise removed back_target_user and pass and wrote to use:

backup_env:
AWS_ACCESS_KEY_ID: aws_access_key
AWS_SECRET_ACCESS_KEY: aws_secret

instead but saw no changes here to reflect that and from what I see.. it should still I did try adding the above to my vault but there was no change.

The last thing I saw was my serve is using duplicity 0.7.19 and i saw that 0.8 is out and not sure if I should maybe upgrade.

I would love to get this working without having to provision about 12 servers from scratch. Any ideas why the authentication error would have popped up after reinstalling the backup and lafranceinsoumise roles?

Thanks!
Josh

Maintenance of trellis-backup-role

@jillro not sure what you are looking for an a maintainer but my team and I would be happy to pick this project up from you. Hope you don't mind helping us through the transition.

Let me know what you need.

could a more simplier docs be added?

i know most of those things my sounds very obvious and easy to you, but I'm totally baffled by the docs
everythings start great and easy, once you get to the vault section nothing is obvious

    backup_target_user: user
    backup_target_pass: password

i suppose I should use those values in target value in wordpress sites right?

sudo duply website_name_database restore
sudo duply website_name_uploads restore

where should I run those commands? vagrant, local pc, server?
should I provision my local vagrant, should I provision the servers?
what value should I use for website_name_database and website_name_uploads, should I install duply as well?

Trouble using b2 backends without upgrading duplicity

I ran into an issue where backups to b2/backblaze were failing with a 404 error in the BKP step. After doing some research, discovered that this is a known issue that was fixed in duplicity 0.7.07. Unfortunately, the default in Ubuntu Trusty is 0.7.06. To upgrade, we need to add a new apt repo and then upgrade the package. As this is specific to the OS used in Trellis, I thought it better to include those steps in this plugin rather than in lafranceinsoumise/ansible-backup. Pull request coming momentarily with a suggested fix.

trellis-backup-role fails to install dependencies

Hello, @guilro!

Hope you are well.

I am provisioning a server with a newer version of Trellis than I have used before. It's the first time I'll be using this setup with an Ubuntu 18.04 box. Provisioning fails when dependencies for lafranceinsoumise.backup (by @lafranceinsoumise) need to be installed:

TASK [lafranceinsoumise.backup : Install dependencies] **************************************************************************************************************************************************************************
System info:
  Ansible 2.7.5; Linux
  Trellis version (per changelog): "Fix Vagrant trigger path"
---------------------------------------------------
'/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options
::=--force-confold"     install 'python-boto' 's3cmd' 'duply'' failed: E:
Error, pkgProblemResolver::Resolve generated breaks, this may be caused by
held packages.

E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by
held packages.

fatal: [turquoise.pcsvps]: FAILED! => {"cache_update_time": 1545969942, "cache_updated": false, "changed": false, "rc": 100, "stderr_lines": ["E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages."], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nSome packages could not be installed. This may mean that you have\nrequested an impossible situation or if you are using the unstable\ndistribution that some required packages have not yet been created\nor been moved out of Incoming.\nThe following information may help to resolve the situation:\n\nThe following packages have unmet dependencies:\n duply : Depends: duplicity (>= 0.4.11) but it is not going to be installed\n libssl1.1 : Breaks: python-boto (< 2.44.0-1.1) but 2.44.0-1ubuntu2 is to be installed\n python-boto : Depends: python-requests but it is not going to be installed\n               Depends: python:any (< 2.8)\n               Depends: python:any (>= 2.7.5-5~)\n               Depends: python-six but it is not going to be installed\n s3cmd : Depends: python3-dateutil but it is not going to be installed\n         Depends: python3-magic but it is not going to be installed\n         Depends: python3-distutils but it is not going to be installed\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "Some packages could not be installed. This may mean that you have", "requested an impossible situation or if you are using the unstable", "distribution that some required packages have not yet been created", "or been moved out of Incoming.", "The following information may help to resolve the situation:", "", "The following packages have unmet dependencies:", " duply : Depends: duplicity (>= 0.4.11) but it is not going to be installed", " libssl1.1 : Breaks: python-boto (< 2.44.0-1.1) but 2.44.0-1ubuntu2 is to be installed", " python-boto : Depends: python-requests but it is not going to be installed", "               Depends: python:any (< 2.8)", "               Depends: python:any (>= 2.7.5-5~)", "               Depends: python-six but it is not going to be installed", " s3cmd : Depends: python3-dateutil but it is not going to be installed", "         Depends: python3-magic but it is not going to be installed", "         Depends: python3-distutils but it is not going to be installed"]}

I'm filing the issue here but let me know if I should post it on ansible-backup instead.

What do I need to do to resolve this dependency problem?

Invalid data passed to 'loop', it requires a list

Hi there,

We've been using your excellent backup role for all of our production servers and it works great!
In my latest project using these versions:

  1. Ansible 2.13.3 (system 2.10.17)
  2. Trellis 1.16.0
  3. backup 2.1.7
  4. lafranceinsoumise.backup 5.5.0

I am suddenly getting an ansible error while re-provisioning:

TASK [lafranceinsoumise.backup : Install backup profile dependencies] **********
System info:
  Ansible 2.13.3; Darwin
  Trellis 1.16.0: July 18th, 2022
---------------------------------------------------
Invalid data passed to 'loop', it requires a list, got this instead:
[{'name': 'example.com_uploads', 'schedule': '0 4 * * *', 'source':
'/srv/www/example.com/shared/uploads', 'target':
's3://ams3.digitaloceanspaces.com/backups/example.com//uploads',
'target_user': False, 'target_pass': False, 'max_age': '3M', 'full_max_age':
'1M', 'max_full_backups': '3', 'params': ['export S3_USE_SIGV4="True"'],
'action': 'purge_backup --force'}] + [{'name': 'example.com_database',
'schedule': '0 4 * * *', 'source': 'mysql://example.com_production', 'target':
's3://ams3.digitaloceanspaces.com/backups/example.com//database',
'target_user': False, 'target_pass': False, 'max_age': '3M', 'full_max_age':
'1M', 'max_full_backups': '3', 'params': ['export S3_USE_SIGV4="True"'],
'action': 'purge_backup --force'}]. Hint: If you passed a list/dict of just
one element, try adding wantlist=True to your lookup invocation or use
q/query instead of lookup.
fatal: [159.223.217.50]: FAILED! => {}

I'm using the exact same variables as in my other projects which provisioned without any errors?
In my wordpress_sites.yml:

    backup:
      enabled: true
      auto: true
      target: s3://ams3.digitaloceanspaces.com/backups/example.com/
      schedule: '0 4 * * *'
      purge: true
      max_age: 3M
      full_max_age: 1M
      max_full_backups: 3
      params:
        - 'export S3_USE_SIGV4="True"'

In my vault.yml:

backup_env:
  AWS_ACCESS_KEY_ID: XXXXXXXX
  AWS_SECRET_ACCESS_KEY: XXXXXXXX

I can see the {{ backup_profiles }} variable being constructed here as:

[{...}] + [{...}]

But the error states this is not a valid ansible list syntax?
I'm guessing this has to do with my project's ansible version since the other projects run fine?

Anyone else bumped into this?
Thanks!

Error Provisioning a Trellis site

While setting up trellis-backup-role on a test site, I get the following error during provisioning:

TASK [trellis-backup : List backup jobs] ***************************************
 [WARNING]: when statements should not include jinja2 templating delimiters
such as {{ }} or {% %}. Found: {{ item.value.backup is defined and
item.value.backup.enabled | default(false) }}

System info:
  Ansible 2.3.2.0; Vagrant 1.9.7; Linux
  Trellis at "Option to install WP-CLI packages"
---------------------------------------------------
the field 'args' has an invalid value, which appears to include a variable
that is undefined. The error was: 'dict object' has no attribute
'backup_target_user'

The error appears to have been in '/home/silumesii/sites/example.com/trellis/vendor/roles/trellis-backup/tasks/main.yml': line
15, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: List backup jobs
  ^ here

fatal: [default]: FAILED! => {"failed": true}

Additional background is available on the Roots forum.

Any idea what might be happening here?

Database restore fails

On a fresh Trellis install, the restore command fails with the following message:
Output: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I have configured vault_mysql_backup_password as per the README, but it appears to have no effect. If I modify the restore command in /etc/duply/website.com_database/restore to prompt for a password (mysql -p), the restore works once I enter the root password.

"'item' is undefined" when trying to provision

I'm using the latest version of this role and tried both with B2 and S3 targets, only to find this error when provisioning:

TASK [lafranceinsoumise.backup : backup-configure | Ensure backup directories exist] *********
System info:
  Ansible 2.7.10; Linux
  Trellis 1.0.3: April 30th, 2019
---------------------------------------------------
'item' is undefined
fatal: [000.my.ip.000]: FAILED! => {}

Here's the last version I tried of my 'wordpress_sites.yml' file:

    cache:
      enabled: false
    backup:
      enabled: true
      auto: true
      target: s3://my.bucket.url/
      schedule: '30 17 * * *'
      purge: false
      max_age: 1M
      full_max_age: 1M
      params:
       - 'export S3_USE_SIGV4="True"'

Duply TypeError

When I run this command:
sudo duply /etc/duply/domain.com_database/ backup

I get this error:
Attempt 1 failed. TypeError: list_file_names() takes from 4 to 6 positional arguments but 7 were given

Here is the full log:

Start duply v2.2, time is 2020-12-13 17:09:08.
Using profile '/etc/duply/domain.com_database'.
Using installed duplicity version 0.8.12, python 3.8.5 (/usr/bin/python3), gpg 2.2.19 (Home: /root/.gnupg), awk 'GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.2.0)', grep 'grep (GNU grep) 3.4', bash '5.0.17(1)-release (x86_64-pc-linux-gnu)'.
Checking TEMP_DIR '/tmp' is a folder and writable (OK)
Test - En/Decryption skipped. (GPG disabled)

--- Start running command PRE at 17:09:08.691 ---
Running '/etc/duply/domain.com_database/pre' - OK
--- Finished state OK at 17:09:08.913 - Runtime 00:00:00.222 ---

--- Start running command BKP at 17:09:08.960 ---
Reading globbing filelist /etc/duply/domain.com_database/exclude
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: none
Last full backup is too old, forcing full backup
Attempt 1 failed. TypeError: list_file_names() takes from 4 to 6 positional arguments but 7 were given
Attempt 2 failed. TypeError: list_file_names() takes from 4 to 6 positional arguments but 7 were given
Attempt 3 failed. TypeError: list_file_names() takes from 4 to 6 positional arguments but 7 were given
Attempt 4 failed. TypeError: list_file_names() takes from 4 to 6 positional arguments but 7 were given
Attempt 5 failed. TypeError: list_file_names() takes from 4 to 6 positional arguments but 7 were given
--------------[ Backup Statistics ]--------------
StartTime 1607879351.00 (Sun Dec 13 17:09:10 2020)
EndTime 1607879351.21 (Sun Dec 13 17:09:11 2020)
ElapsedTime 0.22 (0.22 seconds)
SourceFiles 1
SourceFileSize 6301933 (6.01 MB)
NewFiles 1
NewFileSize 6301933 (6.01 MB)
DeletedFiles 0
ChangedFiles 0
ChangedFileSize 0 (0 bytes)
ChangedDeltaSize 0 (0 bytes)
DeltaEntries 1
RawDeltaSize 6301933 (6.01 MB)
TotalDestinationSizeChange 1231613 (1.17 MB)
Errors 0
-------------------------------------------------

--- Finished state OK at 17:11:18.453 - Runtime 00:02:09.493 ---

--- Start running command POST at 17:11:18.515 ---
Running '/etc/duply/domain.com_database/post' - OK
--- Finished state OK at 17:11:18.544 - Runtime 00:00:00.029 ---

I'm doing something wrong or it's a bug?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.