Code Monkey home page Code Monkey logo

Comments (19)

MureedSultan avatar MureedSultan commented on July 19, 2024 4

Replacing

path.dirname = path.dirname.replace('src/skill', '' )

with

path.dirname = path.dirname.replace('src\\skill', '' )

fixes the problem on Windows. Might break on other OS though.

from skill-sample-nodejs-adventure-game.

tedbarnett avatar tedbarnett commented on July 19, 2024 2

@PaulCutsinger I was having the same issue (on Windows 10) as @winglmui, but followed the helpful suggestion of @irnglxy and got it working. I found that I had to go inside the "/src/skill" folder and zip up all the files there (index.js, AlexaSkill.js, polyfills.js, and the folders handlers, models, and tests). I uploaded that zipped file to Lambda (the old-fashioned Alexa Skill upload method). It then worked perfectly.

FYI: I noticed a file called "dist.zip" already in my skill folder that I presume was created by the Adventure Maker tool. It does not seem to have been created at the right directory "level": it contains the folder "src", which contains skill, which contains index.js. Perhaps something amiss in the zipping-and-uploaded process under Windows?

from skill-sample-nodejs-adventure-game.

msymonds avatar msymonds commented on July 19, 2024 2

If anybody was using the tool to directly upload the code but having the same issue that @winglmui and @PantherTheCat were having, where testing the module produced the "Cannot find module 'index'" error described above, or as described by the CloudWatch log:

Unable to import module 'index': Error
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)

You can fix this by going to the configuration tab in the AWS Lambda console and updating the handler field from "index.handler" to "/src/skill/index.handler".

from skill-sample-nodejs-adventure-game.

thomseninteractive avatar thomseninteractive commented on July 19, 2024 1

@MureedSultan the updated button worked on Windows 10! I hope in the near future a method is revealed for automatically updating the utterances and intents.

from skill-sample-nodejs-adventure-game.

rjamison avatar rjamison commented on July 19, 2024

That usually indicates an issue inside the Lambda function. Could you check the logs in AWS under your Lambda function and see if you spot any errors?

screen shot 2016-08-06 at 10 12 23 am

If you don't spot anything there, it may also have been an issue with uploading the Function from the tool. That error would show up in the console where you started it:

screen shot 2016-08-06 at 10 15 38 am

from skill-sample-nodejs-adventure-game.

irnglxy avatar irnglxy commented on July 19, 2024

I'm also having problems getting the files to upload. Maybe an error with my aws credentials? But I just can't figure out where I'm going wrong.

Any help would be greatly appreciated.

Ned

[17:22:58] Uploading Lambda function "MyAlexaSkillLambdaFunction"...
/Users/Ned/interactive-adventure-game-tool/node_modules/gulp-awslambda/node_modules/aws-sdk/lib/request.js:30
throw err;
^

Error: The security token included in the request is invalid.
at Request.callListeners (/Users/Ned/interactive-adventure-game-tool/node_modules/gulp-awslambda/node_modules/aws-sdk/lib/sequential_executor.js:107:43)
at Request.emit (/Users/Ned/interactive-adventure-game-tool/node_modules/gulp-awslambda/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/Users/Ned/interactive-adventure-game-tool/node_modules/gulp-awslambda/node_modules/aws-sdk/lib/request.js:596:14)
at Request.transition (/Users/Ned/interactive-adventure-game-tool/node_modules/gulp-awslambda/node_modules/aws-sdk/lib/request.js:21:10)
at AcceptorStateMachine.runTo (/Users/Ned/interactive-adventure-game-tool/node_modules/gulp-awslambda/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /Users/Ned/interactive-adventure-game-tool/node_modules/gulp-awslambda/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/Users/Ned/interactive-adventure-game-tool/node_modules/gulp-awslambda/node_modules/aws-sdk/lib/request.js:37:9)
at Request. (/Users/Ned/interactive-adventure-game-tool/node_modules/gulp-awslambda/node_modules/aws-sdk/lib/request.js:598:12)
at Request.callListeners (/Users/Ned/interactive-adventure-game-tool/node_modules/gulp-awslambda/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
at Request.emit (/Users/Ned/interactive-adventure-game-tool/node_modules/gulp-awslambda/node_modules/aws-sdk/lib/sequential_executor.js:77:10)

from skill-sample-nodejs-adventure-game.

rjamison avatar rjamison commented on July 19, 2024

The error definitely indicates some issue with your keys. I receive the same error if I modify the "aws_access_key_id" value in the credentials file, so you could try double checking that value.

For posterity, tried these things to see what errors they'd produce:

  1. Removing the ~/.aws/credentials config entirely gave me: Error: Missing credentials in config
  2. Using an invalid access key gave me: Error: The security token included in the request is invalid.
  3. Using an invalid secret key gave me: Error: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.

from skill-sample-nodejs-adventure-game.

irnglxy avatar irnglxy commented on July 19, 2024

Hey Robert,

Thanks so much for getting back to me on this. I think you're totally right in that it's a problem with the keys, just trying to figure out a resolution - I'm a writer rather than a programer so please forgive my ignorance.

AWS seemed to want me to setup an IAM user rather for the account rather than use the root keys. So that's what I did and put in the two keys it gave me for the user. I'm not sure if there's anywhere else I should be linking to the account somewhere? To the best of my knowledge I've followed all the other steps correctly (although you never know...).

Thanks for you help! Excited to use the tool, think there are some really interesting possibilities there.

Ned

from skill-sample-nodejs-adventure-game.

rjamison avatar rjamison commented on July 19, 2024

No problem, you're exactly who we hope will give the tool a try :)

Setting up an IAM User shouldn't be an issue as long as you give the User permissions to access Lambda to update the code. Incorrect permissions would give an error like:

Error: User: arn:aws:iam::[REDACTED]:user/my_macbook is not authorized to perform: lambda:UpdateFunctionCode on resource: arn:aws:lambda:us-east-1:[REDACTED]:function:MyAlexaSkillLambdaFunction

I suggest you try creating new Security Credentials for the User account you've created (in AWS under "IAM" -> "Users" -> [YOUR USER ACCOUNT] -> "Security Credentials") and configuring those in case of a copy/paste error.

You could also try using the AWS command line tools, which provides a command that helps you configure the credentials. More details here: http://docs.aws.amazon.com/cli/latest/userguide/installing.html

from skill-sample-nodejs-adventure-game.

irnglxy avatar irnglxy commented on July 19, 2024

I did try setting up new security credentials to no avail. Also installed the aws command line tool which seems to say I have correct (or at least some) credentials:

Neds-MacBook-Air:~ Ned$ aws configure
AWS Access Key ID [*************_44A]]:
AWS Secret Access Key [
_*************E9a]]:

However I'm now being given an: Error: Missing credentials in config when trying to save.

Tried it on another machine with similar effect, only the security token error again.

Feel like I'm doing something fundamentally (and very possibly stupidly) wrong, just can't figure out where. Think I followed the instructions to the letter, the only additional step I had to take was before doing the npm install, I had to change directory with a cd to the interactive-adventuregame folder otherwise it gave me an error. Could it be that?

Thanks for your continued help!

from skill-sample-nodejs-adventure-game.

PantherTheCat avatar PantherTheCat commented on July 19, 2024

So I checked and I show no Invocation of the Lambda function at all? Also I cannot view what is actually uploaded for whatever reason, as it is disabled from inline editing - Whilst I am glad you were able to help the other user - my issue is that i can upload, and it appears to have worked, but then the function isn't getting called?
image

from skill-sample-nodejs-adventure-game.

rjamison avatar rjamison commented on July 19, 2024

Sorry for the delayed reply. Have been away for the last week.

@irnglxy sounds like you're doing all the right steps. Are you possibly using 'sudo' to run any of the steps? I've seen similar issues because the root user doesn't have credentials configured, even if your user account does.

@PantherTheCat sorry you're having trouble. You can download the file that was uploaded to lambda, the option is just a little hidden:

screen shot 2016-08-25 at 9 29 59 am

How are you invoking the skill when the function isn't called? If you're testing on a device, it could be that the "Alexa Skills" event source isn't configured for your Lambda, or that the configuration on https://developer.amazon.com has an issue.

from skill-sample-nodejs-adventure-game.

irnglxy avatar irnglxy commented on July 19, 2024

Thanks Robert, I got around the problem by zipping the contents of the skills folder and manually uploading it to lambda. Would be easier to do it directly but just couldn't get to the bottom on the problem and this is working out fine.

Thanks!

from skill-sample-nodejs-adventure-game.

PantherTheCat avatar PantherTheCat commented on July 19, 2024

I have tried to test from the web interface , and from the text interface on the skill page

Sent from my iPhone

On Aug 25, 2016, at 12:34 PM, Robert Jamison [email protected] wrote:

Sorry for the delayed reply. Have been away for the last week.

@irnglxy sounds like you're doing all the right steps. Are you possibly using 'sudo' to run any of the steps? I've seen similar issues because the root user doesn't have credentials configured, even if your user account does.

@PantherTheCat sorry you're having trouble. You can download the file that was uploaded to lambda, the option is just a little hidden:

How are you invoking the skill when the function isn't called? If you're testing on a device, it could be that the "Alexa Skills" event source isn't configured for your Lambda, or that the configuration on https://developer.amazon.com has an issue.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

from skill-sample-nodejs-adventure-game.

winglmui avatar winglmui commented on July 19, 2024

I am having a similar problem as @PantherTheCat. I got this as an error when I tested via the skill page text interface:

{
"errorMessage": "Cannot find module 'index'",
"errorType": "Error",
"stackTrace": [
"Module.require (module.js:353:17)",
"require (internal/module.js:12:17)"
]
}

from skill-sample-nodejs-adventure-game.

PaulCutsinger avatar PaulCutsinger commented on July 19, 2024

When you zip, be sure that your index.js is at the root of the zip. Don't include the containing folder of index.js, or you'll see this error

from skill-sample-nodejs-adventure-game.

winglmui avatar winglmui commented on July 19, 2024

@PaulCutsinger The tool itself did the zipping and uploading for me. So I guess I should manually zip all the files? Alternatively, is there a place where the tool puts the zip it makes so I can see what went wrong in there?

Thanks!

from skill-sample-nodejs-adventure-game.

thomseninteractive avatar thomseninteractive commented on July 19, 2024

I have replicated the problem and workaround @tedbarnett described on Windows. Where can we look to correct the path of the zipped file on Windows? I was happy to get everything working by manually uploading the files - but knowing that upload button is there but not usable----help!!

I believe that it could be fixed with someone smarter than me taking a look at:
gulp-tasks/_upload.js
That's the one!

from skill-sample-nodejs-adventure-game.

hasimam avatar hasimam commented on July 19, 2024

would you please tell us how to setup the tool on windows operated machien ?

from skill-sample-nodejs-adventure-game.

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.