Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] rsync: change_dir "/usr/local/existdb/backup/existdb/exist.last/exist/" failed: No such file or directory #48

Open
gabicavalcante opened this issue Nov 29, 2021 · 3 comments

Comments

@gabicavalcante
Copy link

Describe the bug
I'm trying to use the backup feature, but I got an error message related to a non-existent file (exist.last)

TASK [existdb-ansible-role : Restore data directory from previous installation] ***
fatal: [default -> default]: FAILED! => {"changed": false, "cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --out-format='<>%i %n%L' /usr/local/existdb/backup/existdb/exist.last/exist//data /usr/local/existdb/exist/", "msg": "rsync: change_dir "/usr/local/existdb/backup/existdb/exist.last/exist/" failed: No such file or directory (2)\nrsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.0]\n", "rc": 23}

I tried to find where this directory is created/defined, but I didn't find the code for this.

To Reproduce
My playbook file

---
- hosts: all
  gather_facts: yes
  environment:
    JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64
    PATH: /usr/lib/jvm/java-11-openjdk-amd64/bin:{{ ansible_env.PATH }}
  roles:
    - role: gantsign.maven
      maven_version: '3.6.0'
  tasks:
    - name: Add specified repository into sources list
      ansible.builtin.apt_repository:
        repo: ppa:openjdk-r/ppa
        state: present
    - name: Update Repository cache
      apt:
        upgrade: dist
        update_cache: true
        cache_valid_time: 3600
        force_apt_get: true
    - name: Install git
      apt:
        name: git
        state: present
        update_cache: yes
    - name: Install unzip
      apt:
        name: unzip
        state: present
        update_cache: yes
    - name: Install OpenJDK Java
      apt:
        name: "{{ item }}"
        state: present
      with_items:
        openjdk-11-jdk
    - name: Ensure exist instance apps5test is setup
      include_role:
        name: existdb-ansible-role
      vars:
        exist_instdescription: "eXist database instance for Alt Legal"
        # basic config settings, exist gets installed into $exist_home/$exist_dir
        exist_user: existdb
        exist_group: existdb
        exist_home: /usr/local/existdb
        exist_dir: existdb
        # for multiple eXist-db instances on a single host, assign an individual
        # instance name to each one. No spaces, umlauts or special chars!
        # if you're not running multiple instances the default is fine
        exist_instname: 'exist'
        exist_instuser: 'existdb'
        # exist_instdns: 'apps5test.example.com'
        exist_major_version: 5
        # exist install method: "source", "remote_archive", "local_archive", "none"
        exist_install_method: source
        # git settings (for exist_install_method == "source")
        exist_repo: https://github.com/eXist-db/exist.git
        exist_repo_version: eXist-5.3.0
        exist_repo_update: yes
        exist_repo_force: yes
        # for reference, but don't force anyone to localhost by default
        exist_http_host: '0.0.0.0'
        exist_ssl_host: '0.0.0.0'
        exist_http_port: 8080
        exist_ssl_port: 8443
        # memory settings
        exist_mem_init_heap: 2048
        exist_mem_max_heap: 2048
        # special memory/GC settings
        exist_mem_gcdebug_enable: yes
        exist_mem_strdedup_enable: yes
        exist_mem_nmt_enable: yes
        exist_mem_niocachetune_enable: yes
        exist_install_custom_xars: no
        exist_webxml_from_template: no
        exist_logconf_from_template: yes
        # enable and define loghost for logging to a central syslog server,  default
        # logging to local files only.
        exist_syslog_enable: yes
        exist_syslog_loghost: 0.0.0.0
        # how many days should local log files be kept before they are deleted
        exist_log_retention_days: 30
        exist_kerneltune_enable: yes
        # # whether to backup the previous exist installation
        exist_backup_previnstall: yes
        # # whether to restore the previous data directory after re-installation
        exist_restore_prevdata: yes
        # how long to wait for exist to come up before raising an error
        # exist_startup_timeout: 300
        exist_adminpass:
          default:
            exist: MySecretPass
        exist_userpass_map:
          default:
            exist: 
              "guest": "guestpass"
      tags:
        - existdb5 

Context (please always complete the following information):

  • OS: Ubuntu 20.04
  • eXist-db Version: 5.3.0
  • Java Version: OpenJDK 11
@gabicavalcante
Copy link
Author

For me, the data directory from previous installation is in {{ exist_home }}/backup/{{ exist_instname }}/exist/{{ exist_confpaths[exist_major_version]['data_basedir'] }}/data"

@chakl
Copy link
Collaborator

chakl commented Dec 4, 2021

@gabicavalcante Sorry to let you hang on with this issue!
Confirm that this is a bug (a refactoring victim). I will provide a fix shortly.

For a workaround, since you know the location of the backed-up data directory (from your post above), you could edit tasks/postinstall.yml at line 313 (src attribute in task "Restore data directory from previous installation"), replacing the bogus line containing "exist.last" with your known location string.

Thanks for reporting, and please continue if you hit other issues, this is much appreciated! We try to respond in a reasonable timeframe, unless priorities interrupt :(

@gabicavalcante
Copy link
Author

hey @chakl, no problem, I missed your comment too, sorry for that. I forked the repo and made a few changes :D I gonna open a PR so you can check if it brings improvement to the project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants