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

Installation (Do, Docker) #34

Open
matyhaty opened this issue Jun 25, 2020 · 11 comments
Open

Installation (Do, Docker) #34

matyhaty opened this issue Jun 25, 2020 · 11 comments

Comments

@matyhaty
Copy link

Hi Tiledesk

Ive followed the step by step instructions from setting up a Docker droplet on Digital Ocean

All went well, get to the login page - which fails, and get the following error in console:

<title>Error</title>
Cannot POST /chat21/firebase/auth/createCustomToken

Its trying to post to the url:
http://chat.senses.co.uk/api/chat21/firebase/auth/createCustomToken

Where chat.senses.co.uk is the base URL

Can anyone point me in a direction?

@andrealeo83
Copy link
Contributor

@matyhaty
Copy link
Author

matyhaty commented Jun 25, 2020

Hi @andrealeo83

Yes, I double checked this part also, assuming it would be the area of issue

For clarity, the terminal log is below (where I get the deploy timeout I re-ran the missing ones)

I will note there is no function in Firebase called createCustomToken - should there be>?


Terminal Log

`/usr/app # firebase login
Already logged in as [email protected]

/usr/app # firebase use --add
? Which project do you want to add? tiledesk-senses
? What alias do you want to use for this project? (e.g. staging) staging

Created alias staging for tiledesk-senses.
Now using alias staging (tiledesk-senses)

/usr/app # firebase deploy
⚠ functions: package.json indicates an outdated version of firebase-functions.
Please upgrade using npm install --save firebase-functions@latest in your functions directory.

=== Deploying to 'tiledesk-senses'...

i deploying database, functions
i database: checking rules syntax...
✔ database: rules syntax for database tiledesk-senses is valid
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
✔ functions: required API cloudfunctions.googleapis.com is enabled
i functions: preparing functions directory for uploading...
i functions: packaged functions (103.68 KB) for uploading
✔ functions: functions folder uploaded successfully
i database: releasing rules...
✔ database: rules for database tiledesk-senses released successfully
i functions: updating Node.js 8 function api(us-central1)...
i functions: updating Node.js 8 function supportapi(us-central1)...
i functions: updating Node.js 8 function webhook-onMessage(us-central1)...
i functions: updating Node.js 8 function webhook-onDeleteConversation(us-central1)...
i functions: updating Node.js 8 function webhook-onDeleteArchivedConversation(us-central1)...
i functions: updating Node.js 8 function webhook-onGroupCreated(us-central1)...
i functions: updating Node.js 8 function webhook-onMemberJoinGroup(us-central1)...
i functions: updating Node.js 8 function webhook-onMemberLeaveGroup(us-central1)...
i functions: updating Node.js 8 function webhook-onTyping(us-central1)...
i functions: updating Node.js 8 function insertAndSendMessage(us-central1)...
i functions: updating Node.js 8 function createConversation(us-central1)...
i functions: updating Node.js 8 function deleteArchivedConversation(us-central1)...
i functions: updating Node.js 8 function sendMessageReturnReceipt(us-central1)...
i functions: updating Node.js 8 function fanOutGroup(us-central1)...
i functions: updating Node.js 8 function sendInfoMessageOnGroupCreation(us-central1)...
i functions: updating Node.js 8 function duplicateTimelineOnJoinGroup(us-central1)...
i functions: updating Node.js 8 function duplicateTimelineOnJoinGroupForInvitedMembers(us-central1)...
i functions: updating Node.js 8 function sendInfoMessageOnJoinGroup(us-central1)...
i functions: updating Node.js 8 function saveMemberInfoOnJoinGroup(us-central1)...
i functions: updating Node.js 8 function removeMemberInfoOnLeaveGroup(us-central1)...
i functions: updating Node.js 8 function pushNotificationsFunction-sendNotification(us-central1)...
i functions: updating Node.js 8 function thumbnailFunction-generateThumbnail(us-central1)...
⚠ functions: failed to update function deleteArchivedConversation
You have exceeded your deployment quota, please deploy your functions in batches by using the --only flag, and wait a few minutes before deploying again. Go to https://firebase.google.com/docs/cli/#partial_deploys to learn more.
⚠ functions: failed to update function api
You have exceeded your deployment quota, please deploy your functions in batches by using the --only flag, and wait a few minutes before deploying again. Go to https://firebase.google.com/docs/cli/#partial_deploys to learn more.
⚠ functions: failed to update function sendInfoMessageOnJoinGroup
You have exceeded your deployment quota, please deploy your functions in batches by using the --only flag, and wait a few minutes before deploying again. Go to https://firebase.google.com/docs/cli/#partial_deploys to learn more.
⚠ functions: failed to update function webhook-onDeleteArchivedConversation
You have exceeded your deployment quota, please deploy your functions in batches by using the --only flag, and wait a few minutes before deploying again. Go to https://firebase.google.com/docs/cli/#partial_deploys to learn more.
✔ functions[thumbnailFunction-generateThumbnail(us-central1)]: Successful update operation.
✔ functions[webhook-onMemberJoinGroup(us-central1)]: Successful update operation.
✔ functions[sendMessageReturnReceipt(us-central1)]: Successful update operation.
✔ functions[webhook-onDeleteConversation(us-central1)]: Successful update operation.
✔ functions[pushNotificationsFunction-sendNotification(us-central1)]: Successful update operation.
✔ functions[webhook-onMessage(us-central1)]: Successful update operation.
✔ functions[fanOutGroup(us-central1)]: Successful update operation.
✔ functions[webhook-onMemberLeaveGroup(us-central1)]: Successful update operation.
✔ functions[webhook-onGroupCreated(us-central1)]: Successful update operation.
✔ functions[createConversation(us-central1)]: Successful update operation.
✔ functions[insertAndSendMessage(us-central1)]: Successful update operation.
✔ functions[duplicateTimelineOnJoinGroupForInvitedMembers(us-central1)]: Successful update operation.
✔ functions[duplicateTimelineOnJoinGroup(us-central1)]: Successful update operation.
✔ functions[webhook-onTyping(us-central1)]: Successful update operation.
✔ functions[removeMemberInfoOnLeaveGroup(us-central1)]: Successful update operation.
✔ functions[sendInfoMessageOnGroupCreation(us-central1)]: Successful update operation.
✔ functions[saveMemberInfoOnJoinGroup(us-central1)]: Successful update operation.
✔ functions[supportapi(us-central1)]: Successful update operation.

Functions deploy had errors with the following functions:
api
deleteArchivedConversation
sendInfoMessageOnJoinGroup
webhook-onDeleteArchivedConversation

To try redeploying those functions, run:
firebase deploy --only functions:api,functions:deleteArchivedConversation,functions:sendInfoMessageOnJoinGroup,functions:webhook-onDeleteArchivedConversation

To continue deploying other features (such as database), run:
firebase deploy --except functions

Error: Functions did not deploy properly.
/usr/app # firebase deploy --only functions:api,functions:deleteArchivedConversation,functions:sendInfoMessageOnJoinGroup,functions:web
hook-onDeleteArchivedConversation

⚠ functions: package.json indicates an outdated version of firebase-functions.
Please upgrade using npm install --save firebase-functions@latest in your functions directory.

=== Deploying to 'tiledesk-senses'...

i deploying functions
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
✔ functions: required API cloudfunctions.googleapis.com is enabled
i functions: preparing functions directory for uploading...
i functions: packaged functions (103.68 KB) for uploading
✔ functions: functions folder uploaded successfully
i functions: current functions in project: api(us-central1), createConversation(us-central1), deleteArchivedConversation(us-central1), duplicateTimelineOnJoinGroup(us-central1), duplicateTimelineOnJoinGroupForInvitedMembers(us-central1), fanOutGroup(us-central1), insertAndSendMessage(us-central1), pushNotificationsFunction-sendNotification(us-central1), removeMemberInfoOnLeaveGroup(us-central1), saveMemberInfoOnJoinGroup(us-central1), sendInfoMessageOnGroupCreation(us-central1), sendInfoMessageOnJoinGroup(us-central1), sendMessageReturnReceipt(us-central1), supportapi(us-central1), thumbnailFunction-generateThumbnail(us-central1), webhook-onDeleteArchivedConversation(us-central1), webhook-onDeleteConversation(us-central1), webhook-onGroupCreated(us-central1), webhook-onMemberJoinGroup(us-central1), webhook-onMemberLeaveGroup(us-central1), webhook-onMessage(us-central1), webhook-onTyping(us-central1)
i functions: uploading functions in project: api(us-central1), deleteArchivedConversation(us-central1), sendInfoMessageOnJoinGroup(us-central1)
⚠ functions: the following filters were specified but do not match any functions in the project: webhook-onDeleteArchivedConversation
i functions: updating Node.js 8 function api(us-central1)...
i functions: updating Node.js 8 function deleteArchivedConversation(us-central1)...
i functions: updating Node.js 8 function sendInfoMessageOnJoinGroup(us-central1)...
✔ functions[sendInfoMessageOnJoinGroup(us-central1)]: Successful update operation.
✔ functions[deleteArchivedConversation(us-central1)]: Successful update operation.
✔ functions[api(us-central1)]: Successful update operation.

✔ Deploy complete!

Project Console: https://console.firebase.google.com/project/tiledesk-senses/overview
`

@matyhaty
Copy link
Author

For a note, it does actually log me in, but i have to manually navigate. to /dashboard (otherwise it just sites on the login screen!)
Sounds odd if it cant get a token of some sorts

@andrealeo83
Copy link
Contributor

chat21/firebase/auth/createCustomToken is part of tiledesk-server here: https://github.com/Tiledesk/tiledesk-server/blob/master/channels/chat21/firebaseauth.js

@maliksaif
Copy link

@matyhaty Any luck with the above issues it seems i have similar issue and can't seem to find any solution that.

@andrealeo83
Copy link
Contributor

andrealeo83 commented Jan 30, 2021 via email

@maliksaif
Copy link

@andrealeo83
Here are the steps i followed just o make sure i did not do something stupid.

  • Cloned this repo
  • cd "repo"
  • cd functions - did npm install
  • cd ..
  • firebase login
  • firebase use --add
    -- firebase deploy

last command always gives me following error :-

=== Deploying to 'tiledesk-c2a9b'...

i deploying database, functions
i database: checking rules syntax...
✔ database: rules syntax for database tiledesk-c2a9b-default-rtdb is valid
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
✔ functions: required API cloudbuild.googleapis.com is enabled
✔ functions: required API cloudfunctions.googleapis.com is enabled
i functions: preparing functions directory for uploading...

Error: Error occurred while parsing your function triggers.

TypeError: functions.region(...).region(...).region(...).region(...).region(...).config is not a function
at Object. (/home/shahvaizahmed29/chat21-cloud-functions/functions/chat-bot-support-api.js:21:125)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/home/shahvaizahmed29/chat21-cloud-functions/functions/chat-support.js:12:27)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/home/shahvaizahmed29/chat21-cloud-functions/functions/index.js:39:25)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)

@andrealeo83
Copy link
Contributor

Yes the error exists:
Fixed with @chat21/[email protected]

@maliksaif
Copy link

@andrealeo83 Thanks Issues has been resolved.

@matyhaty
Copy link
Author

matyhaty commented Feb 1, 2021

@maliksaif

could you document how you resolved

will help me, others, everyone :()

@maliksaif
Copy link

@matyhaty
at first i was also getting this error below i will write down what i followed.

Cannot POST /chat21/firebase/auth/createCustomToken

  1. Created back up for current project cloned new one
  2. cd newly downloaded project
  3. cd functions
  4. npm install
  5. cd ..
  6. npm install ( don't this makes a difference but what can i say )
  7. Firebase login ( if not logged in login please )
  8. Firebase use --add ( Choose your project and pull stagging alias )
  9. Firebase deploy

These should work for you because you will have a latest cloned project.

If you want to do it in previous project :-

  1. Git stash
  2. Git pull
  3. cd functions
  4. npm install
  5. cd ..
  6. npm install ( don't this makes a difference but what can i say )
  7. Firebase login ( if not logged in login please )
  8. Firebase use --add ( Choose your project and pull stagging alias )
  9. Firebase deploy

I just tried the second options after @andrealeo83 response and it deployed perfectly without any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants