I am facing an intermittent issue with backup transport to Amazon S3. The majority of accounts copy across just fine, however one or two accounts fail with the error message:
After each failure the system retries the backup process for these accounts and fails each time. Every subsequent run of the backup process fails on the same accounts (though these are not the largest accounts). I can't work out specifically why these accounts are failing and others are succeeding.
I was able to trace this back to the MultiPart upload function `_do_multipart_upload` in `/usr/local/cpanel/Cpanel/Transport/Files/AmazonS3.pm`. It appears that one part of the MultiPart upload is failing for some reason, which is crashing the entire upload.
Below is an excerpt from one of the backup transport logs. This shows a successful transfer, followed by a failed transfer. This particular one recovered on the third try, however this is not always the case.
Note the timestamps. The backup appears to fail part-way through the transfer process, with the first attempt failing at 32 minutes, the second at 31 minutes and the final successful transfer taking 1:59.
I dug through the forums and feature requests and found this request: https://features.cpanel.net/topic/a...led-uploads-in-chunks-rather-than-entire-file which would help significantly here, though doesn't describe this exact issue.
I also logged by own feature request after digging though the code and discovering that transports are single-threaded, here: https://features.cpanel.net/topic/2...pport-concurrent-uploads-for-faster-transport Again, this won't resolve the problem, but would make it much faster.
Has anybody experienced a similar issue? Why are we seeing a 403 forbidden error on some of these requests?
Code:
Upload attempt failed: Amazon::S3: Amazon responded with 403 Forbidden
at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Amazon/S3/Bucket.pm line 136.
I was able to trace this back to the MultiPart upload function `_do_multipart_upload` in `/usr/local/cpanel/Cpanel/Transport/Files/AmazonS3.pm`. It appears that one part of the MultiPart upload is failing for some reason, which is crashing the entire upload.
Below is an excerpt from one of the backup transport logs. This shows a successful transfer, followed by a failed transfer. This particular one recovered on the third try, however this is not always the case.
Code:
[2020-07-07 01:46:19 +1000] info [cpbackup_transporter] Upload attempt #1 starting for /backup/weekly/2020-07-07/accounts/agedcareservices.tar.gz to /weekly/2020-07-07/accounts/agedcareservices.tar.gz for destination: Articuno Backup
[2020-07-07 01:46:31 +1000] info [cpbackup_transporter] Successful transfer of /backup/weekly/2020-07-07/accounts/agedcareservices.tar.gz to /weekly/2020-07-07/accounts/agedcareservices.tar.gz for destination Articuno Backup
[2020-07-07 01:46:31 +1000] info [cpbackup_transporter] The backup has been successfully uploaded at least once, now we will delete the local copy (/backup/weekly/2020-07-07/accounts/agedcareservices.tar.gz) since keeplocal (0) is disabled.
[2020-07-07 01:46:40 +1000] info [cpbackup_transporter] cpbackup_transporter - Processing next task
[2020-07-07 01:46:40 +1000] info [cpbackup_transporter] Instantiating Object
[2020-07-07 01:46:41 +1000] info [cpbackup_transporter] Starting a "copy" operation on the "Articuno Backup" destination ID "FM*****redacted*****BP8".
[2020-07-07 01:46:41 +1000] info [cpbackup_transporter] Validating destination path /weekly/2020-07-07/accounts/
[2020-07-07 01:46:42 +1000] info [cpbackup_transporter] Path exists
[2020-07-07 01:46:42 +1000] info [cpbackup_transporter] Uploading account backup /backup/weekly/2020-07-07/accounts/johnson1.tar.gz to /weekly/2020-07-07/accounts/johnson1.tar.gz (from weekly/2020-07-07/accounts/johnson1.tar.gz)
[2020-07-07 01:46:42 +1000] info [cpbackup_transporter] Attempting to upload /backup/weekly/2020-07-07/accounts/johnson1.tar.gz to /weekly/2020-07-07/accounts/johnson1.tar.gz for destination: Articuno Backup
[2020-07-07 01:46:42 +1000] info [cpbackup_transporter] Upload attempt #1 starting for /backup/weekly/2020-07-07/accounts/johnson1.tar.gz to /weekly/2020-07-07/accounts/johnson1.tar.gz for destination: Articuno Backup
[2020-07-07 02:18:49 +1000] warn [cpbackup_transporter] Upload attempt failed: Amazon::S3: Amazon responded with 403 Forbidden
at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Amazon/S3/Bucket.pm line 136.
at /usr/local/cpanel/Cpanel/LoggerAdapter.pm line 27.
Cpanel::LoggerAdapter::warn(Cpanel::LoggerAdapter=HASH(0x17183e0), "Upload attempt failed: Amazon::S3: Amazon responded with 403 "...) called at /usr/local/cpanel/Cpanel/Backup/Queue.pm line 658
Cpanel::Backup::Queue::transport_backup::attempt_to_upload_file(Cpanel::Backup::Queue::transport_backup=HASH(0x151a120), Cpanel::Transport::Files::AmazonS3=HASH(0x37bab98), "/backup/weekly/2020-07-07/accounts/johnson1.tar.gz", "/weekly/2020-07-07/accounts/johnson1.tar.gz", Cpanel::LoggerAdapter=HASH(0x17183e0)) called at /usr/local/cpanel/Cpanel/Backup/Queue.pm line 333
Cpanel::Backup::Queue::transport_backup::process_task(Cpanel::Backup::Queue::transport_backup=HASH(0x151a120), Cpanel::TaskQueue::Task=HASH(0x3fc3078), Cpanel::LoggerAdapter=HASH(0x17183e0)) called at /usr/local/cpanel/Cpanel/TaskQueue.pm line 635
eval {...} called at /usr/local/cpanel/Cpanel/TaskQueue.pm line 638
Cpanel::TaskQueue::__ANON__() called at /usr/local/cpanel/Cpanel/StateFile.pm line 241
eval {...} called at /usr/local/cpanel/Cpanel/StateFile.pm line 241
Cpanel::StateFile::Guard::call_unlocked(Cpanel::StateFile::Guard=HASH(0x3fdfb40), CODE(0x303db28)) called at /usr/local/cpanel/Cpanel/TaskQueue.pm line 643
Cpanel::TaskQueue::process_next_task(Cpanel::TaskQueue=HASH(0x25bf8f8)) called at /usr/local/cpanel/bin/cpbackup_transporter line 168
eval {...} called at /usr/local/cpanel/bin/cpbackup_transporter line 166
[2020-07-07 02:18:51 +1000] info [cpbackup_transporter] Upload attempt #2 starting for /backup/weekly/2020-07-07/accounts/johnson1.tar.gz to /weekly/2020-07-07/accounts/johnson1.tar.gz for destination: Articuno Backup
[2020-07-07 02:49:54 +1000] warn [cpbackup_transporter] Upload attempt failed: Amazon::S3: Amazon responded with 403 Forbidden
at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Amazon/S3/Bucket.pm line 136.
at /usr/local/cpanel/Cpanel/LoggerAdapter.pm line 27.
Cpanel::LoggerAdapter::warn(Cpanel::LoggerAdapter=HASH(0x17183e0), "Upload attempt failed: Amazon::S3: Amazon responded with 403 "...) called at /usr/local/cpanel/Cpanel/Backup/Queue.pm line 658
Cpanel::Backup::Queue::transport_backup::attempt_to_upload_file(Cpanel::Backup::Queue::transport_backup=HASH(0x151a120), Cpanel::Transport::Files::AmazonS3=HASH(0x37bab98), "/backup/weekly/2020-07-07/accounts/johnson1.tar.gz", "/weekly/2020-07-07/accounts/johnson1.tar.gz", Cpanel::LoggerAdapter=HASH(0x17183e0)) called at /usr/local/cpanel/Cpanel/Backup/Queue.pm line 333
Cpanel::Backup::Queue::transport_backup::process_task(Cpanel::Backup::Queue::transport_backup=HASH(0x151a120), Cpanel::TaskQueue::Task=HASH(0x3fc3078), Cpanel::LoggerAdapter=HASH(0x17183e0)) called at /usr/local/cpanel/Cpanel/TaskQueue.pm line 635
eval {...} called at /usr/local/cpanel/Cpanel/TaskQueue.pm line 638
Cpanel::TaskQueue::__ANON__() called at /usr/local/cpanel/Cpanel/StateFile.pm line 241
eval {...} called at /usr/local/cpanel/Cpanel/StateFile.pm line 241
Cpanel::StateFile::Guard::call_unlocked(Cpanel::StateFile::Guard=HASH(0x3fdfb40), CODE(0x303db28)) called at /usr/local/cpanel/Cpanel/TaskQueue.pm line 643
Cpanel::TaskQueue::process_next_task(Cpanel::TaskQueue=HASH(0x25bf8f8)) called at /usr/local/cpanel/bin/cpbackup_transporter line 168
eval {...} called at /usr/local/cpanel/bin/cpbackup_transporter line 166
[2020-07-07 02:49:55 +1000] info [cpbackup_transporter] Upload attempt #3 starting for /backup/weekly/2020-07-07/accounts/johnson1.tar.gz to /weekly/2020-07-07/accounts/johnson1.tar.gz for destination: Articuno Backup
[2020-07-07 04:50:09 +1000] info [cpbackup_transporter] Successful transfer of /backup/weekly/2020-07-07/accounts/johnson1.tar.gz to /weekly/2020-07-07/accounts/johnson1.tar.gz for destination Articuno Backup
[2020-07-07 04:50:09 +1000] info [cpbackup_transporter] The backup has been successfully uploaded at least once, now we will delete the local copy (/backup/weekly/2020-07-07/accounts/johnson1.tar.gz) since keeplocal (0) is disabled.
[2020-07-07 04:50:09 +1000] info [cpbackup_transporter] cpbackup_transporter - Processing next task
I dug through the forums and feature requests and found this request: https://features.cpanel.net/topic/a...led-uploads-in-chunks-rather-than-entire-file which would help significantly here, though doesn't describe this exact issue.
I also logged by own feature request after digging though the code and discovering that transports are single-threaded, here: https://features.cpanel.net/topic/2...pport-concurrent-uploads-for-faster-transport Again, this won't resolve the problem, but would make it much faster.
Has anybody experienced a similar issue? Why are we seeing a 403 forbidden error on some of these requests?