[Plugin Backup] Error: Failed to upload archive to Google Drive
-
Using the manual backup URL I see:
2012-05-25 11:03:18 ERROR Unable to request file from https://docs.google.com/feeds/upload/create-session/default/private/full/folder%<folder hash here>/contents?convert=false /home/<username>/public_html/wp-content/plugins/backup/backup.php 427
2012-05-25 11:03:18 ERROR Failed to upload archive to Google Drive!
The <folder hash here> does not match what I put under the plugin settings. The hash is correct with respect to Google Drive.
-
Sorry what I meant to say is the hash that I saved in the Backup plugin settings matches Google. However, the <folder hash here> is a different string (I say this because the code seems to be fetching the option in the code on L427 but it was a quick cursory look this morning).
Hi pisymbol,
Did you manage to figure out the error_log problem? Care to share?
As for the current problem. First make sure you’re running version 1.1.4 of the plugin. Then please tell me if what you’re seeing in the folder field on the Backup settings page after saving is indeed what you entered.
On the relevant log entry that you pasted above you should be seeing
folder%3A<folder hash>.Yes hel.io, when the plugin installed, it made the backup/ folder 640, I changed it to 740 so the apache user could write to it (probably “nobody”). For some odd reason I originally thought you were writing to plugins/backup, not backup/. My mistake.
I am running 1.1.4.
I am seeing the correct folder hash (checked for that already).
Okay, my mistake. I am indeed seeing %3A<folder hash> and it is the correct hash. But it still doesn’t work?!
I just tried again, and I still see:
ERROR Unable to request file from …
ERROR Failed to upload archive to Google Drive!Not sure what I am doing wrong? Yhe site is definitely authorized by the Google API.
The function file_get_contents is failing for some reason and we need to see the error it generates. To see this error please remove the
@symbol preceding the function call on line 393. Depending on your setup you might see the error on screen or in a error log file.Warning: file_get_contents(https://docs.google.com/feeds/upload/create-session/default/private/full/folder%3A<correct hash of gdrive folder>/contents?convert=false) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in backup.php 393
Warning: Cannot modify header information – headers already sent by (output started at /home/pisymbol/public_html/wp-content/plugins/backup/backup.php:393) in backup.php 294
Hmm, 404.
I tried a blank folder ID, so just root. Same problem. I revoked the auth and copied the secret again (double checked the redirect URI under “Client ID for web applications” and its correct). It authorized my key without a hiccup.
So why 404? Is the URL to the GDrive API correct?
That is so weird. The URI is correct. It’s working on my end without a problem. There might be different URLs for different users.
I will have to look into it. Problem is the documentation Google provides is so inaccurate. They write something in the docs and then implement it differently.
The plugin actually uses the Docs List API because the GDrive API requires the creation of a Chrome app at the time being. But what most people don’t know is that Google Docs = Google Drive.
I am too a bit confused by the doc. It took me 20 minutes to figure out that docs is now drive and the Gdata protocol is what you are using.
But this doesn’t work for me which sucks….
Two things I don’t understand after reading some more:
https://developers.google.com/drive/v1/reference/files/update#examples
Shouldn’t you be using the Google Drive API.
Btw, there is a Python API included in zend.
I meant PHP.
The Google Drive API is for apps that can be used to open files from inside Drive (right click > open with) and the apps need to be Chrome apps that show up in the Chrome Web Store, so no, I shouldn’t be using the Drive API.
Please update to version 1.1.5 of the plugin and tell me if there’s any difference.
Still doesn’t work. What’s weird is if I paste the link directly in the browser (https://docs.google.com/feeds/etc.) it does indeed connect and establish an encrypted connection to Google. So the 404 error is really throwing me off.
About the APIs, hmmm, yeah, you were not kidding, the Google API docs are a bit confusing…I am taking a look myself now to understand why I am the only person who can’t seem to get your plugin to work.
Is your name Alex?
Your $result !== @file_get_contents() check is not right. If I array_shift the response code I see “HTTP/1.0 200 OK” which is exactly right.
My $responses during the upload_chunk() loo are:
2012-05-26 12:00:24 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:25 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:25 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:26 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:27 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:28 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:29 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:30 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:31 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:31 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:32 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:33 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:34 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:36 INFO HTTP/1.0 308 Resume Incomplete
2012-05-26 12:00:38 INFO HTTP/1.0 201 CreatedAnd the new file is generated.
The check at the end of upload_chunk() gives me an exception on L486 since the $result is not in XML format.
Can you take a look?
The topic ‘[Plugin Backup] Error: Failed to upload archive to Google Drive’ is closed to new replies.