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

EnvAccessKeyNotFound error from copilot init #1151

Closed
erno opened this issue Jul 16, 2020 · 4 comments
Closed

EnvAccessKeyNotFound error from copilot init #1151

erno opened this issue Jul 16, 2020 · 4 comments
Labels
area/creds Issues about credentials. type/bug Issues that are bugs. type/request Issues that are created by customers.

Comments

@erno
Copy link

erno commented Jul 16, 2020

Here's a paste of what I saw in the terminal:

$ copilot init
Note: It's best to run this command in the root of your Git repository.
Welcome to the Copilot CLI! We're going to walk you through some questions
to help you get set up with an application on ECS. An application is a collection of
containerized services that operate together.

Your workspace is registered to application coptest1.


Service type: Backend Service
Service name: frobber
Dockerfile: ./Dockerfile
Ok great, we'll set up a Backend Service named frobber in application coptest1 listening on port 80.

✔ Created the infrastructure to manage services under application coptest1.

✔ Manifest file for service frobber already exists at copilot/frobber/manifest.yml, skipping writing it.
Your manifest contains configurations like your container size and port (:80).

✔ Created ECR repositories for service frobber.

All right, you're all set for local development.
Deploy: Yes


✔ Created the infrastructure for the test environment.
- Virtual private cloud on 2 availability zones to hold your services     [Complete]
- Virtual private cloud on 2 availability zones to hold your services     [Complete]
  - Internet gateway to connect the network to the internet               [Complete]
  - Public subnets for internet facing services                           [Complete]
  - Private subnets for services that can't be reached from the internet  [Complete]
  - Routing tables for services to talk with each other                   [Complete]
- ECS Cluster to hold your services                                       [Complete]
- Application load balancer to distribute traffic                         [Complete]
✔ Linked account <myaccid> and region eu-west-3 to application coptest1.

✔ Created environment test in region eu-west-3 under application coptest1.
✘ get ECR repository URI: ecr describe repository coptest1/frobber: NoCredentialProviders: no valid providers in chain
caused by: EnvAccessKeyNotFound: failed to find credentials in the environment.
SharedCredsLoad: failed to load profile, <myprofile>.
EC2RoleRequestError: no EC2 instance role found
caused by: RequestError: send request failed
caused by: Get http://169.254.169.254/latest/meta-data/iam/security-credentials/: dial tcp 169.254.169.254:80: connect: no route to host

I'm using temporary credentials defined in .aws/config / .aws/credentials and have the right profile set in my AWS_PROFILE env var - awscli aws ecr describe-repositories will show me my frobber repository.

edit: I was using the latest release (0.1.0).

@efekarakus efekarakus added area/creds Issues about credentials. type/bug Issues that are bugs. labels Jul 17, 2020
@efekarakus
Copy link
Contributor

Hi @erno!

That's very strange, I wonder if this is a transient issue or if it happens everytime you run copilot init. Would you mind trying the command again?
Getting the ECR repo URI uses the same session as creating the "coptest1" application.

@efekarakus efekarakus added the type/request Issues that are created by customers. label Jul 17, 2020
@chrisLeeTW
Copy link

I've also faced same problem with aws-vault (https://github.com/99designs/aws-vault)

@efekarakus
Copy link
Contributor

Heya! We fixed this issue recently in #1205 this was because during svc deploy we wouldn't read the ~/.aws/config file and result in this error. It should be out with the next release!

@efekarakus
Copy link
Contributor

The fixed was released in v0.3.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/creds Issues about credentials. type/bug Issues that are bugs. type/request Issues that are created by customers.
Projects
None yet
Development

No branches or pull requests

3 participants