Kodi Community Forum
Release Kanzi: Amazon Alexa skill for Kodi - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: Release Kanzi: Amazon Alexa skill for Kodi (/showthread.php?tid=254502)



RE: Amazon Echo skill for Kodi - jaysmith2 - 2017-06-16

I went to the Service Simulator and tried "Open Kodi". This resulted in "There was an error calling the remote endpoint, which returned HTTP 500 : Internal Server Error". The log results for that test were as follows:

[1497621678259] [DEBUG] 2017-06-16T14:01:18.259Z 44e03776-529c-11e7-881b-ddfc80c9f253 Zappa Event: {u'body': u'eyJ2ZXJzaW9uIjo...iJlbi1VUyJ9fQ==', u'resource': u'/', u'requestContext': {u'resourceId': u'j06tsdmn60', u'apiId': u'z06kpvwwea', u'resourcePath': u'/', u'httpMethod': u'POST', u'requestId': u'44c841c1-529c-11e7-8721-55195c0872c9', u'path': u'/dev', u'accountId': u'781845700447', u'identity': {u'apiKey': u'', u'userArn': None, u'cognitoAuthenticationType': None, u'accessKey': None, u'caller': None, u'userAgent': u'Apache-HttpClient/UNAVAILABLE (Java/1.8.0_131)', u'user': None, u'cognitoIdentityPoolId': None, u'cognitoIdentityId': None, u'cognitoAuthenticationProvider': None, u'sourceIp': u'72.1.1.141', u'accountId': None}, u'stage': u'dev'}, u'queryStringParameters': None, u'httpMethod': u'POST', u'pathParameters': None, u'headers': {u'Content-Type': u'application/json; charset=utf-8', u'Via': u'1.1 440f7503597ca64245c4258c03b08e0c.cloudfront.net (CloudFront)', u'CloudFront-Is-Desktop-Viewer': u'true', u'CloudFront-Is-SmartTV-Viewer': u'false', u'SignatureCertChainUrl': u'https://s3.amazonaws.com/echo.api/echo-api-cert-4.pem', u'CloudFront-Is-Mobile-Viewer': u'false', u'X-Forwarded-For': u'72.1.1.141, 54.1.1.67', u'CloudFront-Viewer-Country': u'US', u'X-Forwarded-Port': u'443', u'Accept': u'application/json', u'User-Agent': u'Apache-HttpClient/UNAVAILABLE (Java/1.8.0_131)', u'X-Amzn-Trace-Id': u'Root=1-5943e4ae-448db8b07238f30850808b1b', u'Accept-Charset': u'utf-8', u'Host': u'z06kpvwwea.execute-api.us-east-1.amazonaws.com', u'X-Forwarded-Proto': u'https', u'X-Amz-Cf-Id': u'OwkRTN_wpTErDdoDZ3TpbWDurIM3PZvS64_ASR-5QqLoh3-KkDDRHA==', u'CloudFront-Is-Tablet-Viewer': u'false', u'Signature': u'N9TDcczKOoy...UXYYKH9pg/77RQ==', u'CloudFront-Forwarded-Proto': u'https'}, u'stageVariables': None, u'path': u'/', u'isBase64Encoded': True}

[1497621678259] 'NoneType' object is not callable


I also copy/pasted the request from the Service Simulator into a Lambda Test Event and ran the test there. This reulted in a result of "null". The log events for that test were as follows:

[1497621885438] [DEBUG] 2017-06-16T14:04:45.423Z c05c4e19-529c-11e7-a396-01e120fd3350 Zappa Event: {u'session': {u'application': {u'applicationId': u'amzn1.ask.skill.b5c6ff22-2151-4bf1-baa2-a474ad0829bd'}, u'sessionId': u'SessionId.bd7e7323-f89a-4e7b-969a-6decb8dbab54', u'user': {u'userId': u'amzn1.ask.account.AGHLN...FGEEOQJA'}, u'new': True, u'attributes': {}}, u'request': {u'locale': u'en-US', u'timestamp': u'2017-06-16T13:53:00Z', u'type': u'LaunchRequest', u'requestId': u'EdwRequestId.ebf1db66-22d0-4e90-b5fd-f20c5300ab13'}, u'version': u'1.0'}

(Note: I truncated some of the longer strings, and ID fields with "...")


Any ideas?


RE: Amazon Echo skill for Kodi - digiltd - 2017-06-16

Are you using the http endpoint url that zappa gives you in terminal as the endpoint in lambda?


RE: Amazon Echo skill for Kodi - jaysmith2 - 2017-06-16

Yes, I am using the zappa-provided HTTP URL (Actually, HTTPS)


RE: Amazon Echo skill for Kodi - digiltd - 2017-06-16

and are you using virtualenv when deploying? you need to have enabled the venv before you installed zappa.


RE: Amazon Echo skill for Kodi - jaysmith2 - 2017-06-16

Yes, this is the sequence that I use for deployment:

1. C:\Python27\Scripts\pip.exe install awscli
2. call C:\Python27\Scripts\aws configure
3. C:\Python27\Scripts\pip.exe install virtualenv
4. cd c:\kodi-alexa
5. call C:\Python27\Scripts\virtualenv venv
6. call venv\Scripts\activate.bat
7. pip install -r requirements.txt
8. pip install zappa
9. zappa init
10. zappa deploy dev


When I start a new deployment, I begin with a new, clean Windows 10 VM environment and try to deploy from scratch.


Amazon Echo skill for Kodi - digiltd - 2017-06-16

The new vm each time isn't necessary so that should help speed things up Smile


Amazon Echo skill for Kodi - digiltd - 2017-06-16

Have you configured the Kodi.config file?


RE: Amazon Echo skill for Kodi - darkmadda - 2017-06-16

I'm having the same problem with the nonetype object not callable.
I;ve tried the instructions several times from start to begining, i think it is a problem with the zappa_settings.json, but that's just based on other zappa apps that have the same error. I was able to install the wsgi on a local server, so the python code should be good.I'd just like to off load this on to an aws container. If i figure it out i'll post but i'm kinda out of ideas at this point.


Amazon Echo skill for Kodi - digiltd - 2017-06-16

I use the Zappa way successfully. I do occasionally get a hiccup due to dependencies being being out of date. You can try adding --no-cache to the end of your pip instal -r requirements command.


RE: Amazon Echo skill for Kodi - jaysmith2 - 2017-06-16

Yes - configured with Notepad++. All the slots details are populated, so I believe that confirms connectivity to my Kodi and that those values are good. Is there a good Test Event I can trying Lambda Test to see if the Lambda code is working? (I tried to cut & paste the Lambda request from the Service Simulator, and it came back null, but I'm not sure if that request was valid). That request was:

{
"session": {
"sessionId": "SessionId.4c12a99f-d7ad-419d-8c00-a606e079f4a5",
"application": {
"applicationId": "amzn1.ask.skill.b5c6ff22-2151-1111-baa2-a474ad0829bd"
},
"attributes": {},
"user": {
"userId": "amzn1.ask.account.AGHLN...EOQJA"
},
"new": true
},
"request": {
"type": "LaunchRequest",
"requestId": "EdwRequestId.f0e4f278-08e5-4f38-1111-b4743bc3c21d",
"locale": "en-US",
"timestamp": "2017-06-16T16:23:22Z"
},
"version": "1.0"
}


(Note: I truncated some of the longer strings, and ID fields with "...")


Amazon Echo skill for Kodi - digiltd - 2017-06-16

Also (after deactivating your venv) try deleting the venv folder and setting up a new virtual env venv


RE: Amazon Echo skill for Kodi - jaysmith2 - 2017-06-16

I'm actually starting with a new Windows VM each time I try a new deployment. It is actually creating the venv from scratch each time.


Amazon Echo skill for Kodi - digiltd - 2017-06-16

You shouldn't have to touch the lambda stuff the first test is getting the skill talking to the lambda


RE: Amazon Echo skill for Kodi - darkmadda - 2017-06-16

ok some progress, it looks like it must be a problem with the alex.py code. I replaced backed up the alexa.py file and replaced the contents with a very basic python script

from flask import Flask

app = Flask(__name__)

@app.route('/')
def index():
return "Hello, world!", 200

# We only need this for local development.
if __name__ == '__main__':
app.run()


after i zappa update it the endpoint properly returns hello world. I'm going to dig into the alexa.py file and see if i can figure out what is causeing aws not to run it properly. I'll keep you posted.


Amazon Echo skill for Kodi - digiltd - 2017-06-16

(2017-06-16, 18:37)digiltd Wrote: You shouldn't have to touch the lambda stuff the first test is getting the skill talking to the lambda


I have


This forum uses Lukasz Tkacz MyBB addons.