Files are not uploaded to Google Drive

Snapshot backup files are not uploading backups files to Google Drive destination. It shows "Uploading" message but nothing is uploaded to the Google Drive

  • Kasia Swiderska
    • Support nomad

    Hello Jack,

    I'm sorry to hear that Snapshot is not working correctly on your site.

    Further checking of the server logs you gave us didn't show any errors related to Google Drive that would tell us more about nature of the issue.

    I will escalate this to our Second Line Support Developers and consult also with Snapshot developer to see what is causing this issue. As soon there will be a feedback from them, we will update thread.

    kind regards,
    Kasia

  • Leonidas
    • Developer

    Hello there Jack Lavender ,

    I hope you're having a great day :slight_smile:

    Regarding your reported issue with snapshots not being uploaded to Google Drive, I tried a snapshot at your site, with a different Google Drive account just to see if the issue is account-related or site-related. It didn't get uploaded as well, so now I want to do a deeper investigation in your site to identify the root of this problem.

    A big part of the debugging process is the default WP debug.log that is created and updated during that process. When I tried to check the debug.log after one of my debugging tries, I noticed that it won't get created in the /wp-content directory as it normally would and odds are that this is because of your hosting configuration.

    Could you maybe contact with your hosting provider and let them know that we need to turn on the creation/updating of the debug.log, in order to resolve this particular issue? You can reply at this thread when this is dealt with and we can resume with our debugging process.

    Best regards,
    Leonidas

  • Jack Lavender
    • Site Builder, Child of Zeus

    Leonidas,

    I'm hosting at Flywheel. Their console has an option to "Enable WP_DEBUG" and it is currently enabled. I requested the logs from the last two days. They are attached.

    Let me know if this is enough or if you need something more.

    Thanks,

    Jack

  • Leonidas
    • Developer

    Hi Jack Lavender ,

    actually the php_error.txt you attached is exactly what I need for my debugging tries, but I'll need to have constant access to it. Meaning every time the file is updated, I need to check its newest entries in order to properly follow what exactly is going on at your setup, during the backup upload to Google Drive.

    Could you maybe ask your hosting provider to make it available in the FTP, so I'll be able to check it during the backup process? If this is not possible, but the file can be instantly available via cPanel, we can check it out from there. If we go that route, to give us access to your cPanel, you can do the following:

    Please visit the Contact page and complete the form with the following information:

    https://premium.wpmudev.org/contact/#i-have-a-different-question

    Option: I have a different Question

    Subject: "Attn: Leonidas Milosis"

    In the Message box, please provide the following:

    - link back to this thread for reference
    - any other relevant urls

    - Hosting Control Panel Login
    Admin username
    Admin password
    Login url

    Best regards,
    Leonidas

  • Jack Lavender
    • Site Builder, Child of Zeus

    Okay. They've enabled WP_DEBUG and pointed the logging to the root of the site.

    HOWEVER, the site we did it on is my company site, controlgen.com. I'd rather be working on it there instead of on my production client site. It's also smaller...

    Credentials remain the same.

  • Leonidas
    • Developer

    Hey Jack Lavender ,

    yes of course, I can debug wherever is most convenient for you.

    I can see that I can log in with the same FTP credentials but I do need WP access as well for the co******en.com site and in order to not be dependent on support access, I think it's best if you can send us the WP admin credentials. As above, to send us those you can do the following:

    Please visit the Contact page and complete the form with the following information:

    https://premium.wpmudev.org/contact/#i-have-a-different-question

    Option: I have a different Question

    Subject: "Attn: Leonidas Milosis"

    In the Message box, please provide the following:

    - link back to this thread for reference
    - any other relevant urls

    - Admin login:
    Admin username
    Admin password
    Login url

    Best regards,
    Leonidas

  • Leonidas
    • Developer

    Hello there Jack Lavender ,

    after some debugging on your site's end, I was able to identify the root of the issue.

    The problem is that, in order for Snapshot to send the backup to a remote destination, it uses this PHP function:
    getmypid();
    Unfortunately, it seems that your hosting provider has disabled this particular function, thus preventing Snapshot to send the created backup to your Google Drive.

    If your hosting provider was to enable this function, odds are that snapshots would be smoothly uploaded to your Google Drive.

    Best regards,
    Leonidas

  • Jack Lavender
    • Site Builder, Child of Zeus

    Evidently, that function is disabled intentionally. They suggested I just switch to a different backup plugin. I pointed out that Snapshot worked in conjunction with the Automate process so swapping it out wasn't really the best approach for me.

    Here is their explanation/recommendation:

    "The reason is mostly that PIDs aren't unique necessarily, which presents a potential attack vector. Short of switching plugins, the alternative would be for the plugin developer to check if the function is disabled, and if so, substitute it with something like mt_rand(0, 32000) instead. This is a plugin level fix, which would mean suggesting this to the plugin developer, or forking the plugin yourself and updating any mention of getmypid() to mt_rand(0, 32000) instead."

    Thoughts?

  • Leonidas
    • Developer

    Hi there Jack Lavender ,

    simply finding and replacing the getmypid() function with the one your hosting provider suggested, would indeed quite possibly fix your issue with the failed uploads. However, as this fix is not properly tested, we wouldn't recommend it yet, in fear of unwanted side-effects.

    It is really worth mentioning that, just because security is of course a big priority for us, we are implementing all sorts of processes during plugin development in order to ensure it. In fact, the very next Snapshot version (which is currently in beta) will be compliant to the official WordPress Coding Standards that take security into big account. Even according to those standards, getmypid() is not considered a threat, and that's why this function exists in the current beta as well.

    Having said that, after some internal discussion between the dev team of Snapshot, we realize that this could be really inconvenient for users on hosts that disable this function, like yourself, and decided for its replacement, especially since its functionality can be replaced relatively seamlessly. In fact we are adding this solution in the current beta, so when the next version of Snapshot comes out, getmypid() will not be in the plugin code.

    Best regards,
    Leonidas

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.