-1

I am trying to auto sync between amazon s3 bucket and a local folder.

But when i run the command :

$source = $s3 | Select-CloudFolder -path TestAutoSync/backup

I am getting the below error :

Select-CloudFolder : The remote server returned an error: (400) Bad Request.
At line:1 char:35
+ $source = $s3 | Select-CloudFolder <<<<  -path TestAutoSync/backup
+ CategoryInfo          : NotSpecified: (:) [Select-CloudFolder], BadRequestException
+ FullyQualifiedErrorId :   CloudBerryLab.Base.Exceptions.BadRequestException,CloudBerryLab.Explorer.PSSnapIn.Comman
 ds.SelectCloudFolder

The bucket "TestAutoSync" does exist in my s3 account, and i have cross verified the "key" and "secret". They work perfectly fine when connecting through cloud-berry ui interface.

Below is the complete code executed till the above statement

Add-PSSnapin CloudBerryLab.Explorer.PSSnapIn
Set-CloudOption -ProxyAddress xxxx -ProxyPort xxxx
$key = "xxxx"
$secret = "xxxx"
$s3 = Get-CloudS3Connection -Key $key -Secret $secret
$source = $s3 | Select-CloudFolder -path TestAutoSync/backup

Please provide your opinions if you have worked around such scenarios earlier.

Agnes Simpson
  • 303
  • 1
  • 3
  • 13

1 Answers1

0

Ok, here you go

Get-CloudS3Connection should contain host/path request style setting, that should help you!

Please do the following. Before your line "Get-CloudS3Connection" inject this:

set-cloudoption -PathStyle Path

So your full code should be something like the below

Add-PSSnapin CloudBerryLab.Explorer.PSSnapIn
Set-CloudOption -ProxyAddress xxxx -ProxyPort xxxx -PathStyle Path
$key = "xxxx"
$secret = "xxxx"
$s3 = Get-CloudS3Connection -Key $key -Secret $secret
$source = $s3 | Select-CloudFolder -path TestAutoSync/backup
evgeny
  • 1,039
  • 1
  • 9
  • 26