-
-
Notifications
You must be signed in to change notification settings - Fork 772
Using S3, not possible to write direct to bucket #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've made a fix for this in de dev-master version of this package. Could you try if this fix solves the problem? |
I copied the revised function getBackupDestinationFilename Line 192, I had to add a semi-colon I then set path to empty string. AWS is throwing an error;
I'll research this further but not today. |
The IllegalLocationConstraintException seems like a bug at AWS. There is very little online about this and the error is not one of those listed in the S3 API. After some testing, I tracked the problem to the first two lines of the copyFile function in BackupCommand.php
When specifying a path in the config, dirname returns the name of the folder and makeDirectory ensures that this folder exists. When the destination.path is empty, dirname returns a period When makeDirectory is called with period as the directory name, AWS throws the exception. A workaround is to skip the makeDirectory call when dirname returns a period.
This should not affect other filesystems and I have tested with local and this is fine. |
I had the same issue but the fix proposed by @snapey doesn't solve it in my case. If When makeDirectory is called with slash as the directory name, AWS throws the exception.
A workaround is to skip the makeDirectory call when dirname returns a slash.
I have tested with local on homestead and forge with local and s3 filesystems. |
I create S3 bucket dedicated for the backup and use IAM to provide permission to write to bucket.
Unfortunately it is not possible to set path='' to tell laravel-backup to write to the root of the bucket. Any slashes are removed and key is detected as being 0 characters long.
All works ok if folder is named but it mandates an extra folder level that otherwise is not required.
The text was updated successfully, but these errors were encountered: