• Resolved msolovyov

    (@msolovyov)


    I have a bitnami wordpress install on aws.
    I have setup git in the /home/bitnami/apps/wordpress/htdocs directory.

    When I click to backup the database I get the “Failed to backup the database.” message.

    Can you help me troubleshoot the issue?

    https://wordpress.org/plugins/revisr/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Expanded Fronts

    (@expandedfronts)

    Hello,

    It sounds like you’ll need to set the path to MySQL in the database settings tab. The setting for this will depend on the system, and can be found by typing “which mysql” in command line.

    Is the database on the same server as the WordPress install?

    Thread Starter msolovyov

    (@msolovyov)

    I have added the path ‘/opt/bitnami/mysql/bin/mysql’ to the revisr database settings. It still fails.

    Yes it is on the same server.

    Thread Starter msolovyov

    (@msolovyov)

    I’m also having an issue pushing changes to remote.

    I can create the commit through revisr and then through commandline I can push it fine. But I can’t push the commit through the revisr dashboard.

    Could this be related to the mysql issue?

    Plugin Author Expanded Fronts

    (@expandedfronts)

    Hi,

    It looks like it may be something to do with how Bitnami handles the environment.

    I’m currently testing on a Bitnami server I just spun up and will report back shortly.

    I was able to get the database to backup by changing the wp-config from Bitnami’s default host of ‘localhost:3306’ to just ‘localhost’. Fair warning- I’m not sure if Bitnami added the port to the default WordPress database host for a particular reason, so I’m not sure if changing that would affect any of their other services. 3306 is the default port though.

    Looking into the other issue you’re having and will keep you posted on my findings.

    Plugin Author Expanded Fronts

    (@expandedfronts)

    Also in this case, the MySQL path to put in the Revisr settings would be as follows (without quotes): ‘/opt/bitnami/mysql/bin/’

    Still looking into the other issue. I suspect that Apache is using a different environment path, which is why it would work in SSH but not in the browser.

    Plugin Author Expanded Fronts

    (@expandedfronts)

    Hi,

    Just following up to let you know I looked into this further and confirmed that the issue is that Bitnami is using a different environment path variable for Apache then it is for command line.

    I was able to confirm this by hard coding the following path into the front of the main Git call:
    ‘/opt/bitnami/git/bin/’

    Your best bet is to contact them to find out how to include that environment path for Apache. I will also look into making it an optional setting similar to the MySQL path for a future release.

    Once that’s resolved, Bitnami also changes the default permissions for the “.git” directory in a repository as well. You will need to run the following commands in the directory containing your WordPress install and Git repository (for me it was: ‘~/app/wordpress/htdocs’) :

    sudo chown -R daemon .git/
    sudo chmod -R 755 .git/

    Once that’s done, you’ll just need to save your Git username and email address in the Revisr General Settings tab so that the settings are applied to Git. That should get everything working.

    I’m marking this as resolved as the issue has to do with the server as opposed to Revisr. However as mentioned, we will look into a customizable Git path for the next release in case a server does not have that environment variable set.

    Please let me know if you run into any further issues. Thank you.

    Thread Starter msolovyov

    (@msolovyov)

    Thanks for looking into it.

    As for the git push you recommend just putting in the username/password into the url in the revisr settings?

    I was hoping to avoid that as I’m using a deploy key of the id_rsa.pub in that repo.

    Plugin Author Expanded Fronts

    (@expandedfronts)

    I was able to get the permissions to work with only the two following commands:

    bitnami@hostname:~/apps/wordpress/htdocs$ sudo chown -R daemon .git/
    bitnami@hostname:~/apps/wordpress/htdocs$ sudo chmod -R 755 .git/

    Did you run the chown command? It seems that the ‘daemon’ user is running the Apache processes, which doesn’t have permissions to the ‘.git/config’ which is owned by the bitnami user.

    Thread Starter msolovyov

    (@msolovyov)

    I’ve since resolved it. Yes that was the case. I’ve instead just made the permissions 775 and 665 to account for the bitnami:daemon grouping.

    Plugin Author Expanded Fronts

    (@expandedfronts)

    And to address the git push/remote config – you can use the SSH / public key method of authenticating to a remote repository as well. You will just need to make sure that the server’s id_rsa.pub has been added to bitbucket or github. You can then define the remote URL as an SSH URL like so:

    Bitbucket:
    git@bitbucket.org:YOUR_USERNAME/YOUR_REPO.git

    GitHub:
    git@github.com:YOUR_USERNAME/YOUR_REPO.git

    The HTTPS method with including the password is just a fallback if one doesn’t have access to the public_key.

    This is dependent on the permissions being resolved, as Revisr needs to be able to write to the config file in order to set the Remote URL in the settings, otherwise you would have to update the config file manually.

    Just out of curiosity, did you create this repository with “git init .” ?

    Plugin Author Expanded Fronts

    (@expandedfronts)

    Also forgot to add, once Revisr has access to the .git/config file, it should pull any existing config for the remote url. So if you’re able to do a git push from command line, once the permissions are resolved, it should work in Revisr as well.

    Thread Starter msolovyov

    (@msolovyov)

    That’s how I have it set up. id_rsa.pub is added as a deploy key in github for the repo.

    The url is set up that way inside revisr.

    revisr has permissions to the .git/config file.

    The way I created the repo is by following the process here: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

    I still get errors on push through revisr but I can push through commandline fine.

    Thread Starter msolovyov

    (@msolovyov)

    I’m not sure if the issue is just adding ‘/opt/bitnami/git/bin/’ to the env. I have added it to the /opt/bitnami/scripts/setenv.sh file and did a reboot but I still have it failing to push.

    Plugin Author Expanded Fronts

    (@expandedfronts)

    Yes, the push issue looks like a separate issue and I think it’s due to the “daemon” user not having ownership of the id_rsa.pub file as HTTPS pushes are working fine for me. Looking into it further and will keep you posted.

    Thread Starter msolovyov

    (@msolovyov)

    Thanks. As a workaround I have created a new user dedicated just to doing backups and have set it up using the https method in revisr.

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘"Failed to backup the database."’ is closed to new replies.