Skip to content
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

cgcloud register-key doesn't work with region us-east #215

Closed
kkdang opened this issue Jul 28, 2016 · 2 comments
Closed

cgcloud register-key doesn't work with region us-east #215

kkdang opened this issue Jul 28, 2016 · 2 comments

Comments

@kkdang
Copy link

kkdang commented Jul 28, 2016

When setting up cgcloud to run in AWS us-east-1 region, it doesn't work:

$ cgcloud register-key ~/.ssh/id_rsa.pub -z us-east-1b

INFO: Using zone 'us-east-1b' and namespace '/toilUser/'
Traceback (most recent call last):
  File "/Users/.virtualenvs/cgcloud/bin/cgcloud", line 11, in <module>
    sys.exit(main())
  File "/Users/.virtualenvs/cgcloud/lib/python2.7/site-packages/cgcloud/core/cli.py", line 49, in main
    app.run( args )
  File "/Users/.virtualenvs/cgcloud/lib/python2.7/site-packages/cgcloud/lib/util.py", line 308, in run
    command.run( options )
  File "/Users/.virtualenvs/cgcloud/lib/python2.7/site-packages/cgcloud/core/commands.py", line 85, in run
    return self.run_in_ctx( options, ctx )
  File "/Users/.virtualenvs/cgcloud/lib/python2.7/site-packages/cgcloud/core/commands.py", line 637, in run_in_ctx
    force=options.force )
  File "/Users/.virtualenvs/cgcloud/lib/python2.7/site-packages/cgcloud/lib/context.py", line 522, in register_ssh_pubkey
    self.upload_ssh_pubkey( ssh_pubkey, fingerprint )
  File "/Users/.virtualenvs/cgcloud/lib/python2.7/site-packages/cgcloud/lib/context.py", line 479, in upload_ssh_pubkey
    location=self.region )
  File "/Users/.virtualenvs/cgcloud/lib/python2.7/site-packages/boto/s3/connection.py", line 621, in create_bucket
    response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidLocationConstraint</Code><Message>The specified location-constraint is not valid</Message><LocationConstraint>us-east-1</LocationConstraint><RequestId>56D03A456F56A818</RequestId><HostId>VBL/IHg0GKwM1y0iM0oRm82an66AQTNdWASWR6yXo4keYUV7NihRJi9a8NVyIm/l9rxpsq0xtds=</HostId></Error>

But the same command works fine with us-west:

$ cgcloud register-key ~/.ssh/id_rsa.pub -z us-west-2a

INFO: Using zone 'us-west-2a' and namespace '/toilUser/'

I wonder if this is related to boto/boto3#125 noted already in boto where the region for S3 is really "US Standard" but the region for other aspects of AWS, such as EC2, is us-east-1a, etc.

Relevant versions in use below:
argcomplete (1.4.1)
bd2k-python-lib (1.14a1.dev30)
boto (2.38.0)
cgcloud-core (1.5.3)
cgcloud-lib (1.5.3)
ecdsa (0.13)
Fabric (1.10.3)
futures (3.0.4)
paramiko (1.16.0)
pip (8.1.2)
pycrypto (2.6.1)
PyYAML (3.11)
setuptools (24.0.3)
subprocess32 (3.2.7)
tabulate (0.7.5)
wheel (0.29.0)

@hannes-ucsc
Copy link
Contributor

Thank you for the bug report. Interestingly, even without the fix from b4756be, you should now be able to register the key in us-east-1 since the bucket has now been created when you tried it in us-west-2.

@kkdang
Copy link
Author

kkdang commented Jul 28, 2016

Yes, that worked. Thanks for the quick reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants