Troubleshooting Dropbox Feed Processing

Troubleshooting Dropbox Feed Processing

RequirementsLoggingCommon IssuesBasic AuthenticationcURL Error 28

Requirements
For Dropbox feed processing to work the following requirements must be met:

See the Gravity Forms System Requirements article for more details.
The site needs to be able to send a post request to it』s admin-post.php URL using the WordPress HTTP API to trigger processing of the uploaded files.

Logging
Begin troubleshooting by:
(1) Enable logging on the Forms > Settings page
(2) On the Forms > Settings > Logging page, ensure that Gravity Forms Core and any add-ons are enabled and set to log all messages.
Check our logging and debugging documentation for additional help.
As logging statements are only recorded when the functions they are contained within are run, perform the steps needed to replicate the issue such as submitting the form.
Example logging statements to look for in the add-on log:

DEBUG –> GFFeedAddOn::maybe_process_feed(): Checking for feeds to process for entry #[entry id] for gravityformsdropbox.
DEBUG –> GFFeedAddOn::maybe_process_feed(): Starting to process feed (# – ) for entry #[entry id] for gravityformsdropbox
DEBUG –> GF_Dropbox::initialize_api(): Testing API credentials.
DEBUG –> GF_Dropbox::initialize_api(): API credentials are valid.
DEBUG –> GF_Dropbox::process_feed(): Adding feed #1 to the processing queue.
DEBUG –> GFFeedAddOn::maybe_process_feed(): Marking entry #[entry id] as fulfilled for gravityformsdropbox
DEBUG –> GF_Dropbox::maybe_process_feed_on_shutdown(): Sending processing request for feed #.
ERROR –> GF_Dropbox::maybe_process_feed_on_shutdown(): Aborting. [message here]
DEBUG –> GF_Dropbox::maybe_process_feed_on_post_request(): Nonce verified; preparing to process request.
ERROR –> GF_Dropbox::process_feed_files(): Feed was not processed because API was not initialized.
DEBUG –> GF_Dropbox::process_feed_files(): Checking form fields for files to process.
DEBUG –> GF_Dropbox::process_feed_files(): Processing field: GF_Field_[type] Object(…)
DEBUG –> GF_Dropbox::process_[type]_fields(): Not uploading [type] field #[field id] because field value is empty.
DEBUG –> GF_Dropbox::process_[type]_fields(): Beginning upload of [type] field #[field id].
ERROR –> GF_Dropbox::process_[type]_fields(): Unable to upload file: [file url]
ERROR –> GF_Dropbox::process_[type]_fields(): Unable to create shareable link for file: [message here]
DEBUG –> GF_Dropbox::process_fileupload_fields(): File for lead: [file url]
ERROR –> GF_Dropbox::upload_file(): Unable to upload file because destination folder could not be created.
ERROR –> GF_Dropbox::upload_file(): Unable to upload file because destination is not a folder.
DEBUG –> GF_Dropbox::upload_file(): File [file name] was successfully uploaded.
ERROR –> GF_Dropbox::upload_file(): Unable to upload file: [message here]
DEBUG –> GF_Dropbox::upload_file(): Preparing local file for deletion.
ERROR –> GF_Dropbox::upload_file(): Unable to create shareable link for file: [message here]
DEBUG –> GF_Dropbox::update_entry_links(): Updating entry value for field #[field id] to [file url].
DEBUG –> GF_Dropbox::maybe_delete_files(): Deleting local files => Array(…)

Common Issues
If you find feed processing ends with the following logging statement that indicates something is preventing the WordPress admin-post.php from processing the request.

DEBUG –> GF_Dropbox::maybe_process_feed_on_shutdown(): Sending processing request for feed #.

Basic Authentication
If your site is using basic authentication that would cause the request to fail with a 401 unauthorized error. To resolve this issue you can add the Authorization header to the request using the WordPress http_request_args filter e.g.
add_filter( 'http_request_args', 'http_request_args_basic_auth_admin_post', 10, 2 );
function http_request_args_basic_auth_admin_post( $args, $url ) {
if ( strpos( $url, admin_url( 'admin-post.php' ) ) === 0 ) {
$args['headers']['Authorization'] = 'Basic ' . base64_encode( USERNAME . ':' . PASSWORD );
}

return $args;
}

Note: The above example is based on USERNAME and PASSWORD being constants defined elsewhere (i.e. the wp-config.php file), if not, you can include the values within the quotes e.g. 'USERNAME:PASSWORD'.
cURL Error 28

ERROR –> GF_Dropbox::maybe_process_feed_on_shutdown(): Aborting. cURL error 28: Operation timed out after 1000 milliseconds with 0 bytes received

For assistance resolving cURL timeouts like this please see the cURL error 28 in WordPress article.

發表回覆

您的電子郵箱地址不會被公開。 必填項已用 * 標註