parse heroku cloudcode function not linked/working - heroku

I am going in circles for a day now. I cant get the hello cloud function to work.
I followed this tutorial: http://blog.parse.com/announcements/introducing-heroku-parse/
1) I linked heroku to my parse account
2) I created an app from scratch with CLI (like in the video)
3) I use 'parse deploy' and i see its pushed to heroku
4) On my Parse Dashboard - Webhooks page i see its linked with the app
5) Not knowing if this is important but if go to Cloud Code in the parse dashboard it says i havent deployed anything.
When i use the command "parse functions" to see the webhooks of the cloudcode I see 2 empty lines as a response. Instead of the hello function.
When I try to use the Api Console in the dashboard to check if "functions/hello" works i get this response:
RESPONSE
{
"code": 141,
"error": "function not found"
}
What am I missing or are the docs outdated ? I think it has to do with this register-webhook.js like its not getting called or something. Its only in package.json as a start and record parameter. But i dont have enough knowledge of heroku to see if it is even called.

Related

Show all available routes in Kibana

I'm new with Kibana and Elasticsearch also and want to use some API to investigate the connection between them. But got some errors when testing.
Ex: when I run /api/saved_objects/_find?type=index-pattern It worked,
but some APIs does not. It responses "not found" and not like the doc, such as GET api/saved_objects/index-pattern/my-pattern. return
{
"statusCode": 404,
"error": "Not Found",
"message": "Not Found"
}
So my question is how can I show all available routes of Kiabana's app like Rails with rake routes
P/s: For now I want to custom the core-plugin of Kibana's app, but it's difficult to find a document or articles about this. Information in the official doc is not enough for me. If you know any resources, can you please share them with me. Thank you.
You're probably missing something in the URL. If the ID of your index pattern in the Kibana index is index-pattern:my-pattern then you can GET it like this:
api/saved_objects/index-pattern/my-pattern
^
|
you need to remove the prefix here

How to get stack trace in google actions logs, because 'final_response' must be set is useless

The debugging in actions on google is hell. The only usefull thing to do is if you debug in Dialogflow test console, because there you can see exactly where it went wrong. But here you just get this MalformedResponse: 'final_response' must be set. Is there any way to print out console.log so you can see at least in Logs Viewer what went through and what didn't?
Because from this, you can't see anything what went wrong except that conv.ask didn't execute or am i missing something?
insertId: "id"
labels: {
channel: "preview"
querystream: "GOOGLE_USER"
source: "JSON_RESPONSE_VALIDATION"
}
logName: "projects/0/logs/actions.googleapis.com%2Factions"
receiveTimestamp: "2018-08-27T08:01:46.632208192Z"
resource: {
labels: {
action_id: "actions.intent.TEXT"
project_id: "avant2goassistant"
version_id: ""
}
type: "assistant_action"
}
severity: "ERROR"
textPayload: "MalformedResponse: 'final_response' must be set"
timestamp: "2018-08-27T08:01:46.605934393Z"
trace: "projects/0/traces/0"
There are a lot of places to investigate if you get this error.
First check the obvious - that your Intent has fulfillment enabled. At the bottom of your Intent, make sure "Enable webhook call for this intent" is turned on.
If you're sure about that, check the logs for your webhook. You haven't specified how or where your webhook is running, so I can't provide detailed guidance on that, but if you're using the Dialogflow built in editor, you can check out the logs in Firebase. Make sure there isn't an error being thrown.
I often run testing locally (using firebase serve --only functions) and use ngrok to provide a secure tunnel. ngrok also provides a protocol inspector which will let you look at the response you're sending back to Dialogflow.
If you're still having issues, you may wish to turn on Dialogflow logging to Google Cloud. This is on the settings screen (under the gear icon for your project) and towards the bottom. It is off by default - turn it on, and you can follow the link there to see where the logs are. This will show you what is sent to your fulfillment and what you get back.
Much of this information is also in the "Response" and "Debug" tabs in the Actions on Google simulator. You can also look there (or post them on StackOverflow) if you still need help.
Using the Dialogflow simulator isn't sufficient for debugging Actions - the AoG environment sends additional information that the Dialogflow simulator doesn't.

Laravel, Openshift, and error messages

I have just created an app on Openshift and been making modifiactions. I test them locally before pushing the modifications. I now have an error that does not appear locally so I need to have details about the error.
How do I get the messages to display?
First step check your log files for getting all detailed information about your errors, if you use laravel it will be here /storage/logs/.

Cloud Code Functions will not work after Parse Server migration to Heroku

I followed the migration path from the parse website to Heroku.
Parse initializes but I cannot find any of my cloud code functions from my JS Angular Web App, example :-
Parse.Cloud.run('checkStats',{'id' : id }
The network tab shows POST request with a 404.
http://..../parse/1/functions/checkStats
As I test I used hurl.it (http tool) and got the same results, I then changed the url and removed the /1/ and the function works.
http://..../parse/functions/checkStats
Any ideas?
Figured it out, I had to update my Parse JS SDK to the latest version (1.6.14) on the client side. In addition, on the cloud code side, code changes were required as Parse.User.current() or Parse.Cloud.useMasterKey() are no longer supported, instead you need to use different functions for the same result... refer to
https://github.com/ParsePlatform/parse-server

twitter response: "error 32: Could not authenticate you" from Heroku, but not desktop

I'm following the instructions from Carin Meier's How I Start post and having an issue with posting to twitter (like her example) from Heroku. Note that my app does not have a web component, just a worker component.
Testing on my desktop, I'm able to post to twitter and gist.github.com.
But, on Heroku, I always get Exception in thread "main" java.lang.Exception: Twitter responded to request with error 32: Could not authenticate you. I am able to post to gist.github.com, so it appears to be a twitter-only issue.
I have used heroku run lein repl to confirm that my creds look just fine:
(reset! my-twitter-creds (tw-oauth/make-oauth-creds
(env :app-consumer-key)
(env :app-consumer-secret)
(env :user-access-token)
(env :user-access-secret)))
but a call to:
(tw/statuses-user-timeline :oauth-creds #my-twitter-creds
:params {:count 1 :screen-name "myname"})
Always gives the error 32.
All the code I've created for this is available to browse here: https://github.com/rogerallen/tweegeemee/blob/master/src/tweegeemee/core.clj
My current suspicion is that there is some requirement on Heroku for a twitter Oauth callback URL. But, since my app does not have a web-worker, I don't want to have to add this (and it isn't mentioned in the post).
Can anyone help me get this working?
From what you described, if you can post to twitter using lein run locally with your environment variables - then the only difference should be the environment variables that heroku is using.
Maybe check with heroku config or even put some more logging in an watch in the heroku logs to see what it is calling it with.

Resources