Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

InvalidLocationConstraint when creating bucket #202

Closed
kishore25kumar opened this issue Mar 14, 2017 · 4 comments
Closed

InvalidLocationConstraint when creating bucket #202

kishore25kumar opened this issue Mar 14, 2017 · 4 comments

Comments

@kishore25kumar
Copy link
Contributor

We are using s3proxy to connect to azure storage. When we are creating a bucket using nodejs sdk I am getting InvalidLocationConstraint error. Here is the stack trace

{ InvalidLocationConstraint: The specified location constraint is not valid. For more information about Regions, see How to Select a Region for Your Buckets.
    at Request.extractError (/Users/battula/eloise/foundational-services/node-s3proxy/node_modules/aws-sdk/lib/services/s3.js:538:35)
    at Request.callListeners (/Users/battula/eloise/foundational-services/node-s3proxy/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/Users/battula/eloise/foundational-services/node-s3proxy/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/Users/battula/eloise/foundational-services/node-s3proxy/node_modules/aws-sdk/lib/request.js:668:14)
    at Request.transition (/Users/battula/eloise/foundational-services/node-s3proxy/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/battula/eloise/foundational-services/node-s3proxy/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/battula/eloise/foundational-services/node-s3proxy/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/battula/eloise/foundational-services/node-s3proxy/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/battula/eloise/foundational-services/node-s3proxy/node_modules/aws-sdk/lib/request.js:670:12)
    at Request.callListeners (/Users/battula/eloise/foundational-services/node-s3proxy/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
  message: 'The specified location constraint is not valid. For more information about Regions, see How to Select a Region for Your Buckets.',
  code: 'InvalidLocationConstraint',
  region: null,
  time: 2017-03-14T09:40:15.509Z,
  requestId: null,
  extendedRequestId: undefined,
  cfId: undefined,
  statusCode: 400,
  retryable: false,
  retryDelay: 75.30141439047937 }

If I use java sdk it works fine. After a little debugging I found that if I pass region as azureblob while creating the bucket then it is working fine.

@gaul
Copy link
Owner

gaul commented Mar 14, 2017

Enable S3Proxy trace logging and see what nodejs is providing, probably us-east-1. I investigated a similar issue earlier in aws/aws-sdk-js#919 but dropped it due to lack of understanding how to debug nodejs code. Perhaps S3Proxy should default to allowing us-east-1 as a constraint?

@kishore25kumar
Copy link
Contributor Author

@andrewgaul After debugging I found that nodejs is sending us-east-1 as the default region. This is causing the issue.
I have found from the #127 issue you asked to use jclouds.region=us-east-1 while using nodejs sdk. I have added this to my properties file and it worked. Is this the solution you are mentioning?

@gaul
Copy link
Owner

gaul commented Mar 15, 2017

@kishore25kumar I am glad that you found a workaround but I think S3Proxy should work out of box for nodejs users. Perhaps we should add a default jclouds.region value to S3Proxy?

@gaul
Copy link
Owner

gaul commented Aug 2, 2018

Fixed by #277.

@gaul gaul closed this as completed Aug 2, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants