internet-archive-voice-apps icon indicating copy to clipboard operation
internet-archive-voice-apps copied to clipboard

Issue while setting up the Project

Open savannahar68 opened this issue 7 years ago • 11 comments
trafficstars

As of now, there is no communication channel for this project(slack,gitter) and also the readme doesn't help a lot to run the project locally.I would suggest to update readme adding steps to run the project locally, like we don't come to know whether we need to create a firebase project and then init and add it, also do we have to create google's api.ai account or we should use the one created for this project.

  1. I forked repo,
  2. I did npm install in functions folder
  3. inside npm folder i installed express by npm i express --save
  4. Till now i have created firebase account and added it to the project firebase use --add then selected the project i created on internet archive
  5. now when i run DEBUG=ia: npm start* it starts and with shows this along with other things functions: playMedia: http://localhost:5000/internet-archive-51ab5/us-central1/playMedia

When i enter this URL on chrome it returns me a json {"speech":"Internet Archive is here!","contextOut":[{"name":"_actions_on_google_","lifespan":100,"parameters":{"actions":{"action":null,"count":1}}}],"data":{"google":{"expect_user_response":true,"no_input_prompts":[],"is_ssml":false}}}

So here as mentioned no inputs are provided so no output is shown, @hyzhak could you help me to correct me if im going wrong or show me how to run this project , it would be very helpful for us

savannahar68 avatar Mar 14 '18 09:03 savannahar68

Are you getting some errors like this "Unable to authorize access to project internet-archive"

anishsarangi avatar Mar 14 '18 10:03 anishsarangi

@anishsarangi yes you get that because in .firebaserc the name of firebase project is internet-archive which would be made by the founder of this repo on his firebase,(solved it by) so you have to init firebase and add to it your own firebase project, after initialization of firebase type this firebase use --add to choose your firebase project. Even i guess that we have to use our own firebase project for dynamic scaling becuase we wont get auth for internet archive's fb.

savannahar68 avatar Mar 14 '18 12:03 savannahar68

Yes, I have already done it. I have referring to issue #11 where you are getting that above mentioned error.It seems you have fixed it.

anishsarangi avatar Mar 14 '18 12:03 anishsarangi

@hyzhak do we have to make our own dialogflow ,as when we deploy firebase we have to add function URL into fulfillment menu item, without it we wont be able to do further work, so can we get internet archive's login or can we do something like export import dialogflows ?

savannahar68 avatar Mar 14 '18 16:03 savannahar68

I'd appreciate a little more to the README.md. Not grokking it lead me here.

mc2 avatar Apr 12 '18 20:04 mc2

Sure! We are really lacking someone who would pass from the bottom to the top all the setup process and noted all steps and problems which they faced. I have even created special tag project accessibility for tasks which should be solved to shortening learning curve.

hyzhak avatar Apr 13 '18 11:04 hyzhak

@hyzhak I'm having the same problem. I'm stuck, If you can just help me run this project, I'd be able to contribute and I'll update the readme too. Any help will be appreciated!

yagyanshbhatia avatar Dec 18 '18 07:12 yagyanshbhatia

@yagyanshbhatia please describe steps which you have done, and which problem have you faced. As well have you create Dialog Flow apps before?

hyzhak avatar Dec 18 '18 20:12 hyzhak

Hey @hyzhak I am new to firebase and dialogflow, I've made just some basic apps to get started. I completed google-action-codelab level 1,2,3 here I forked and cloned the repo, made a new firebase project, firebase --add that project, used npm install in functions, doing firebase init gives

i  .firebaserc already has a default project, skipping

=== Firestore Setup

Error: HTTP Error: 403, The caller does not have permission

used npm to install some dependencies manually as they were not installed when I used npm install like acorn@^6.0.0 and firebase-admin@~6.0.0 used firebase deploy which gives the following error

Error: Error occurred while parsing your function triggers.

TypeError: Cannot read property 'key' of undefined
    at module.exports (/home/yagyansh/internet-archive-google-action/functions/src/platform/assistant/handler.js:27:60)
    at Object.<anonymous> (/home/yagyansh/internet-archive-google-action/functions/index.js:23:21)
    at Module._compile (internal/modules/cjs/loader.js:723:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Module.require (internal/modules/cjs/loader.js:659:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at /usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js:15:15
    at Object.<anonymous> (/usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js:53:3)
    at Module._compile (internal/modules/cjs/loader.js:723:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:776:12)
    at executeUserCode (internal/bootstrap/node.js:342:17)
    at startExecution (internal/bootstrap/node.js:276:5)
    at startup (internal/bootstrap/node.js:227:5)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3) 

now DEBUG=ia* npm start gives

> firebase serve --only functions:assistant

[2018-12-19T06:06:46.401Z] ----------------------------------------------------------------------
[2018-12-19T06:06:46.403Z] Command:       /usr/local/bin/node /usr/local/bin/firebase serve --only functions:assistant
[2018-12-19T06:06:46.404Z] CLI Version:   6.1.2
[2018-12-19T06:06:46.404Z] Platform:      linux
[2018-12-19T06:06:46.404Z] Node Version:  v11.4.0
[2018-12-19T06:06:46.404Z] Time:          Wed Dec 19 2018 11:36:46 GMT+0530 (India Standard Time)
[2018-12-19T06:06:46.404Z] ----------------------------------------------------------------------

[2018-12-19T06:06:46.410Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2018-12-19T06:06:46.411Z] > authorizing via signed-in user
[2018-12-19T06:06:46.411Z] [iam] checking project archive-assistant for permissions ["firebase.projects.get"]
[2018-12-19T06:06:46.412Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/archive-assistant:testIamPermissions  
 permissions=[firebase.projects.get]
[2018-12-19T06:06:48.480Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Wed, 19 Dec 2018 06:07:28 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="44,43,39,35", accept-ranges=none, connection=close
[2018-12-19T06:06:48.482Z] >>> HTTP REQUEST GET https://cloudresourcemanager.googleapis.com/v1/projects/archive-assistant  
 
[2018-12-19T06:06:50.386Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Wed, 19 Dec 2018 06:07:30 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="44,43,39,35", accept-ranges=none, connection=close

=== Serving from '/home/yagyansh/internet-archive-google-action'...

i  functions: Preparing to emulate functions.
[2018-12-19T06:06:50.933Z] Fetching environment
[2018-12-19T06:06:51.332Z] Error: EACCES: permission denied, open '/home/yagyansh/.config/gcloud/application_default_credentials.json'
    at Object.openSync (fs.js:450:3)
    at Object.writeFileSync (fs.js:1212:35)
    at module.exports (/usr/local/lib/node_modules/firebase-tools/lib/ensureDefaultCredentials.js:28:8)
    at FunctionsEmulator.start (/usr/local/lib/node_modules/firebase-tools/lib/functionsEmulator.js:106:5)
    at Object.start (/usr/local/lib/node_modules/firebase-tools/lib/serve/functions.js:7:33)
    at /usr/local/lib/node_modules/firebase-tools/lib/serve/index.js:15:23
    at arrayMap (/usr/local/lib/node_modules/firebase-tools/node_modules/lodash/lodash.js:639:23)
    at Function.map (/usr/local/lib/node_modules/firebase-tools/node_modules/lodash/lodash.js:9556:14)
    at _serve (/usr/local/lib/node_modules/firebase-tools/lib/serve/index.js:13:26)
    at Command.module.exports.Command.description.option.option.option.option.before.action [as _action] (/usr/local/lib/node_modules/firebase-tools/lib/commands/serve.js:55:12)

Error: An unexpected error has occurred.

Having trouble? Try again or contact support with contents of firebase-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] start: `firebase serve --only functions:assistant`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

yagyanshbhatia avatar Dec 19 '18 06:12 yagyanshbhatia

hey @hyzhak I figured we dont have a proper channel, hence I made one! I've sent you an invite on [email protected] :smiley:

yagyanshbhatia avatar Dec 19 '18 06:12 yagyanshbhatia

@yagyanshbhatia Thanks for your afford! I'd be very appreciate if you could create comprehensive documentation about running this app (in bullet format), so please write down all issue which you have faced and how have you solve it.

Btw, why do we need acorn here? We don't use it directly in this project.

And, I'd recommend to you try firebase and action on google examples first, before trying to setup this project. I don't think we should repeat documentation of both those projects here. In particular your issue isn't related to setup firebase in general not to this project. So it would be better to ask such questions there.

hyzhak avatar Dec 19 '18 08:12 hyzhak