Coder Social home page Coder Social logo

Comments (28)

TomBarta avatar TomBarta commented on July 29, 2024 9

I had this problem today, too.

export AWS_ACCESS_KEY_ID=id_key
export AWS_SECRET_ACCESS_KEY=access_key

solved it on my OSX and Ubuntu 16.04 machines.

from serverless-graphql.

Aciid avatar Aciid commented on July 29, 2024 1

same issue here, I've checked that the relevant profile is mentioned in ~/.aws/config and ~/.aws/credentials

serverless-starter works, maybe theres something out of date here.

from serverless-graphql.

laardee avatar laardee commented on July 29, 2024 1

@ismarslomic yes, I had the aws cli installed beforehand and I probably used similar instructions when I configured the credentials. I have exactly same versions of python, serverless and os x installed.

from serverless-graphql.

Glavin001 avatar Glavin001 commented on July 29, 2024

I had the same problem.

I think 1 thing that helped was downloading a ZIP of the master branch of this project and copying over all of the files -- it appears that the installation did not use the latest code -- and then I changed name field in s-project.json to your applicable project name. I now have it working. I also tried installing DynamoDB Local manually vs using docker-compose up, however now they both work.
I spent a long time trying things to get this to work so at this point I am not even confident which 1 or so things ended up fixing it. However I think updating to the latest code definitely helped, if not being the actual solution.

Hope that helps!


I remember what fixed it! See #31 (comment)
So yes, the fix is to download and merge in a copy of the latest code on the master branch which includes that fixes within Pull request #31.

from serverless-graphql.

Aciid avatar Aciid commented on July 29, 2024

Hey @Glavin001 ,

I tried the master branch but that didn't work out any better. I also checked out the pull request, doesn't seem that relevant. Thanks for the hint tho, I haven't followed the progress of this repository that much but It's evolving quite nicely.

I'm more concerned about backend-git/back/api/lib/dynamodb.js which has the actual mentions on how to drive locally this is where the "credentials" are missing. as the sessionToken doesn't get validated by the local instance.

But as none other project's are currently using local dynamodb with sls offline capabilities I don't think theres an easy way to peek for the answer other than debugging :E, I guess it's off to using sls offline with a live table Β―_(ツ)_/Β― until this gets resolved.

from serverless-graphql.

Glavin001 avatar Glavin001 commented on July 29, 2024

Hmm I'll try to figure out what I did to fix that issue. It was a long day last week, I remember that much.

from serverless-graphql.

laardee avatar laardee commented on July 29, 2024

@jesucarr @Glavin001 @Aciid How did you install the boilerplate? With sls project install serverless-graphql or cloning the repo and running sls project init? I haven't touched the admin.env and it has my personal profile settings mapped for both stages that I've created, dev when installing the project and tests later with sls stage create

AWS_DEV_PROFILE=laardee
AWS_TESTS_PROFILE=laardee

(I have my AWS work profile as [default] and [laardee] for personal stuff)

from serverless-graphql.

Aciid avatar Aciid commented on July 29, 2024

@TomBarta this worked :3 thanks!

@laardee AWS_TESTS_PROFILE had no effect and I didn't have this after init ( wasn't asked for this in the config ) weird is this used for the offline then tho?

from serverless-graphql.

ismarslomic avatar ismarslomic commented on July 29, 2024

I had same issue as well. Exporting the two env variables as suggested by @TomBarta resolved the issue. I guess this is just an workaround, as credentials shall be retrieved from ~/.aws/credentials? If i is not an workaround, then documentation shall be updated

from serverless-graphql.

laardee avatar laardee commented on July 29, 2024

@Aciid, that "AWS_TESTS_PROFILE" profile is for "tests" stage that I used. If you haven't created a stage tests there should not be such a profile. When you create a new stage with sls stage create it appends new profile mapping to the admin.env, so I don't think you need to manually change that file at all if you use serverless framework to create/init project.

from serverless-graphql.

laardee avatar laardee commented on July 29, 2024

I just can't reproduce this issue. I created new stage that uses different credentials and everything works ok. I haven't exported either work or personal credentials with

export AWS_ACCESS_KEY_ID=id_key
export AWS_SECRET_ACCESS_KEY=access_key

I logged credentials in setup db and it prints out correct ones for each stage.

Which OS / Serverless version / AWS CLI version are you using?

from serverless-graphql.

ismarslomic avatar ismarslomic commented on July 29, 2024

@laardee do you have aws cli installed and have you done profile configuration as described here http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html before installing serverless and creating new project? I have currently not installed aws cli, so that might be the issue?

from serverless-graphql.

ismarslomic avatar ismarslomic commented on July 29, 2024

Just to add another observation here: after exporting these two variables, admin.env doesnΒ΄t seem to be in use anymore. I opene admin.env and added an invalid value to AWS_DEV_PROFILE, but i still managed to run the function locally.

from serverless-graphql.

Aciid avatar Aciid commented on July 29, 2024

@laardee so if you run
echo $AWS_ACCESS_KEY_ID you get blank? Sorry for being so straight, but I'm just trying verify that you are not using the credentials from "AWS-CLI" standpoint (which we have verified now working)

My serverless-graphql version is "version": "0.0.4",
AWS-CLI aws-cli/1.7.0 Python/2.7.10 Darwin/15.4.0
And yes os x.

from serverless-graphql.

laardee avatar laardee commented on July 29, 2024

I'm away from the keyboard for couple hours, I'll get back to this issue later today.

from serverless-graphql.

erikerikson avatar erikerikson commented on July 29, 2024

Making no commentary about this specific issue.

Given the credential loading questions here, you can review how that happens in this thread:
serverless/serverless#740

Note that in specifying a profile you can declare a general AWS_PROFILE for use in all stages or a stage specific AWS_[STAGE]_PROFILE.

A later PR added support for ~/.aws/config:
serverless/serverless#917

from serverless-graphql.

ismarslomic avatar ismarslomic commented on July 29, 2024

I have following setup:

  • Python 2.7.10
  • Serverless 0.5.5
  • OS X El Capitan (10.11.5)

I do not have installed AWS CLI.

from serverless-graphql.

ismarslomic avatar ismarslomic commented on July 29, 2024

Ok, so then I guess installing AWS CLI shall be prerequisite for this project in order to run functions with local database? By the way, how did you install AWS CLI on Mac? by use of pip or bundle, or?

from serverless-graphql.

laardee avatar laardee commented on July 29, 2024

@ismarslomic with pip

from serverless-graphql.

laardee avatar laardee commented on July 29, 2024

@Aciid echo $AWS_ACCESS_KEY_ID prints out empty line. I have little bit newer aws-cli installed aws-cli/1.10.24 Python/2.7.10 Darwin/15.5.0 botocore/1.4.15, I just updated it about a week ago, but it worked with older version as well. I don't remember which was the version I had previously, but it was installed maybe a 6 months ago.

from serverless-graphql.

ismarslomic avatar ismarslomic commented on July 29, 2024

@laardee: I have now installed AWS CLI (aws-cli/1.10.28 Python/2.7.10 Darwin/15.5.0 botocore/1.4.19), but only installing AWS CLI didnt help on this credential issue. Only after running aws configure I managed to run functions with local db successfully. However, executing echo $AWS_ACCESS_KEY_ID still prints empty line.

from serverless-graphql.

laardee avatar laardee commented on July 29, 2024

@ismarslomic Everything works ok locally if credentials are set with aws configure?

from serverless-graphql.

ismarslomic avatar ismarslomic commented on July 29, 2024

@laardee yes. Im though not sure how selection/creation of aws profile as part of serverless project create impacts or interacts together with AWS CLI profile configuration. As mentioned previously, if I change AWS_DEV_PROFILE=222 (invalid profile name) in admin.env, Im still able to successfully run the function locally.

from serverless-graphql.

laardee avatar laardee commented on July 29, 2024

There is some magic 🎩 πŸ‡. I can also successfully run the project if I have correct AWS_[STAGE]_PROFILE but with invalid value.

from serverless-graphql.

ismarslomic avatar ismarslomic commented on July 29, 2024

But, if you try to deploy your function with invalid value in admin.env serverless will complain about unknown profile. So I guess that the aws profile mentioned in admin.env is used mainly in AWS and not locally. Would be great to have someone from the serverless team to confirm our assumptions here and also update README so it is more clear.

from serverless-graphql.

jesucarr avatar jesucarr commented on July 29, 2024

@laardee I installed the boilerplate with sls project install serverless-graphql. I have not installed the AWS CLI.

from serverless-graphql.

ChaosSmith avatar ChaosSmith commented on July 29, 2024

Was having issues reading AWS credentials on OSX after initiating a project, checked the admin.env variable and found that the AWS_DEV_PROFILE was in quotes while on my ubuntu machine it was not. Removed the quotes and suddenly credential reading worked like a charm.

from serverless-graphql.

Glavin001 avatar Glavin001 commented on July 29, 2024

There's an ongoing issue with aws-sdk-js here: aws/aws-sdk-js#692

from serverless-graphql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.