Comments (24)
Hi,
here is an example xml config.
Try to remove the scheme and host for the bucket name.
<sync type="amazons3">
<option name="key" value="KEY" />
<option name="secret" value="SECRET" />
<option name="bucket" value="phpbu" />
<option name="region" value="eu-central-1" />
<option name="path" value="/phpbu-backup/%Y" />
</sync>
What version of PHP are you using?
from phpbu.
Above 5.5 and using json.
And no, it threw other errors before that. Will try the xml version. But
nevertheless.
On Thursday, February 4, 2016, Sebastian Feldmann [email protected]
wrote:
Hi,
here is an example xml config.
Try to remove the scheme and host for the bucket name.What version of PHP are you using?
—
Reply to this email directly or view it on GitHub
#50 (comment)
.
Costin Moise aka necenzurat
Tel: +4 0726.459.188 | Github https://github.com/necenzurat | Linkedin
http://www.linkedin.com/in/necenzurat
from phpbu.
You can use json that shouldn't matter at all.
Have you tried to remove the scheme and host for your bucket value?
from phpbu.
Yea, it said it must have s3.amazon.
On Thursday, February 4, 2016, Sebastian Feldmann [email protected]
wrote:
You can use json that shouldn't matter at all.
Have you tried to remove the scheme and host for your bucket value?—
Reply to this email directly or view it on GitHub
#50 (comment)
.
Costin Moise aka necenzurat
Tel: +4 0726.459.188 | Github https://github.com/necenzurat | Linkedin
http://www.linkedin.com/in/necenzurat
from phpbu.
Hi, this configuration is working fine for me.
"syncs": [
{
"type": "amazons3",
"options": {
"key": "MYKEY",
"secret": "MYSECRET",
"bucket": "phpbu",
"region": "eu-central-1",
"path": "/phpbu-backup/%Y"
}
}
],
from phpbu.
nope, i'm getting this error
Exception 'phpbu\App\Backup\Sync\Exception' with message 'The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint: "s3.amazonaws.com".'
in phar:///usr/local/bin/phpbu/Backup/Sync/AmazonS3.php:130
from phpbu.
I found this on the web:
http://www.sitefinity.com/developer-network/forums/set-up-installation/amazon-s3---must-be-addressed-using-the-specified-endpoint
This isn't really up to date, but maybe it helps.
If the bucket isn't the problem I would encourage you to install phpbu via composer and install the latest version of the AWS SDK (2.8.*) via composer.
You can check the AWS version bundled within the PHAR with phpbu --manifest
If it works with your composer installed phpbu it's a problem with the bundled AWS version and I will release an update with the latest 2.* version.
from phpbu.
So, installed via composer
{
"require": {
"phpbu/phpbu": "^2.1",
"aws/aws-sdk-php": "2.8.*"
}
}
And then i get this gem
Exception 'phpbu\App\Backup\Sync\Exception' with message 'The difference between the request time and the current time is too large.'
in /app2/vendor/phpbu/phpbu/src/Backup/Sync/AmazonS3.php:130
ok, that was my fault, the time was 2 hours ahead, fixed that, but the bucket need's to be
bucket-name.s3.amazonaws.com
😢
from phpbu.
Please check your local system time.
Amazon is blocking requests with a time difference greater than 15 minutes.
from phpbu.
fixed that, but no good
from phpbu.
Still the time difference exception or back to "The request signature we calculated does not match the signature you provided. Check your key and signing method." ?
from phpbu.
back to The request signature we calculated does not match the signature you provided. Check your key and signing method.
from phpbu.
This is somehow the code phpbu executes to upload your backup to AWS S3.
<?php
use Aws\S3\S3Client;
require 'vendor/autoload.php';
$key = '';
$secret = '';
$localFile = ''; // test.txt
$region = ''; // aws region
$bucket = ''; // bucket name
$remoteFile = ''; // /foo/bar/test.txt
$s3 = S3Client::factory(
[
'signature' => 'v4',
'region' => $region,
'credentials' => [
'key' => $key,
'secret' => $secret,
]
]
);
$fh = fopen($localFile, 'r');
$s3->upload($bucket, $remoteFile, $fh, 'private');
This is nearly copy & paste of the AWS documentation.
With the code above you can test the AWS functionality without phpbu in your way.
This way you hopefully find your problem.
from phpbu.
The upper code says the same error. 😢
Ok, so i did a test with s3tools and it worked.
from phpbu.
This sounds more and more like a php environment problem.
Do you have the opportunity to test it on a different system?
Preferably one with a differently setup os and php version.
from phpbu.
tested it on another server, same problem, maybe it's the sdk?
error
PHP Fatal error: Uncaught Aws\S3\Exception\SignatureDoesNotMatchException: AWS Error Code: SignatureDoesNotMatch, Status Code: 403, AWS Request ID: 912A1E9FAC564353, AWS Error Type: client, AWS Error Message: The request signature we calculated does not match the signature you provided. Check your key and signing method., User-Agent: aws-sdk-php2/2.8.27 Guzzle/3.9.3 curl/7.38.0 PHP/5.6.9-0+deb8u1
thrown in /home/test-aws/vendor/aws/aws-sdk-php/src/Aws/Common/Exception/NamespaceExceptionFactory.php on line 91
from phpbu.
I find that hard to believe. The AWS sdk is a widely used framework and uploading a file is so basic that it's very unlikely that there is a bug that exists in version 2.7.x and still exists in 2.8.x
But nothin is impossible.
Don't know how I can help you from here :(
from phpbu.
I just released version 3.0.0 with the latest AWS SDK version.
Hopefull this fixes your problem.
Just execute
$ phpbu --self-update
to upgrade to the latest version
from phpbu.
Hi @necenzurat, I will close this ticket for now, if you have any further remarks feel free to reopen it.
from phpbu.
3.0.0
it's quite an improvement, now i get this gem of an error:
PHP Warning: fwrite() expects parameter 1 to be resource, boolean given in phar:///usr/local/bin/phpbu/Backup/Sync/AmazonS3v3.php on line 49
i get a successful upload but no file is in the s3 bucket
😢
from phpbu.
OK looks like the Amazon stream wrapper can't open a stream to the S3 bucket.
And I missed to validate that the stream was created successfuly. So you get a warning instead of an exception and phpbu thinks everything went fine.
It drives me crazy that this isn't working in your environment
I still have to fix the missing validation thingy
from phpbu.
it finally worked, on v.3, i had the old config with bucket-name.s3.amazonaws.com.
so yea, it was my fault. the correct settings for the v.3.0.1 and amazon with json sync are:
"syncs": [
{
"type": "amazons3",
"options": {
"key": "___KEY___",
"secret": "___SECRET___",
"bucket": "bucket-name",
"region": "us-east-1",
"path": "back/%Y"
}
}
Region: us-east-1 (region list)
as soon as i have some time, ill try to make some updates to the documentation :)
from phpbu.
😄 happy it works
from phpbu.
me too and thanks for this awesome tool
from phpbu.
Related Issues (20)
- Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in phar:///home/<site>/public_html/dbbackup/phpbu.phar/lib/symfony/process/Process.php on line 54 HOT 7
- Nextcloud support? HOT 1
- error HOT 3
- SSL decryption issue HOT 2
- Incomplete remote MySQL backups? HOT 1
- DropBox tokens expire after 4 hours HOT 4
- Webhook json template example? HOT 2
- Relative paths don't work for template? HOT 2
- Docker support HOT 2
- What will happen if the database is huge? HOT 1
- syntax error when selected pgdump HOT 1
- More information in the message HOT 1
- GPG encryption is not working
- Error with `xtrabackup8` source: `unknown argument` for target directory HOT 2
- Minor improvement regarding the manual and the use of OpenSSL (on Windows)
- syntax error, unexpected '|', expecting variable HOT 2
- Google Drive crypt failing HOT 2
- rsync with port
- PHP Parse error: syntax error, unexpected 'static' (T_STATIC) in phar (using phpbu-6.0.20.phar with php 7.4.33) HOT 1
- Consider adding support for MariaDB `mariabackup`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpbu.