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

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.

Related

Firefox seems to fail on registering a ServiceWorker for Push Notifications?

Firefox seems to fail on registering a ServiceWorker for Push Notifications, with an error "InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable", but the code works in Chrome and Edge, and appears to be compliant with the examples online and the spec.
I've thrown an example up on one of my test sites, https://wiegandtech.net/ - visiting it in Chrome will prompt for permission and then opt-in successfully, sending the info to the server. But Firefox prompts, doesn't complete the registration, and doesn't fire any error or throw anything into the console. When I try to debug, it seems to never return from navigator.serviceWorker.ready.then call - I debug in and reg is undefined, even though the promise says it shouldn't be. I can find no reason why this is failing. I do see in Fiddler that FF gets the worker file, so it appears to be starting the call, but never finishing? The worker is valid JavaScript, as far as I can tell. Does anyone have any documentation on how Firefox's implementation is different from Chrome's/the spec?
Firefox requires the ServiceWorker's URL to end in .js - I was using an ASP.Net site and returning javascript but through my own controller. When I just give it the URL for the .js file itself, it now works. Would file a bug, but too non-trivial to setup a site given that ServiceWorkers require a real life site to troubleshoot, and their source code doesn't appear to be on github.

Fastlane TestFlight upload primary.test.info missing

I'm trying to set the changelog via Fastlane:
changelog = changelog_from_git_commits(
commits_count: 1)
upload_to_testflight(changelog: changelog)
This causes the following error:
Could not set changeling: {"code"=>"ITC.apps.tf.build.missing.primary.test.info", "description"=>"Missing primary test info."}
This is an app used for internal testing only. I didn't fill in any information on "Test Information" because I don't want to accidentally release it to external testers.
I tried unchecking the following box:
It still shows the same error message.
What's the minimum amount of information I need to get this to work?
I'm on fastlane 2.108.0. I found some related information here, but that's mainly with ITC.apps.tf.build.test.info.missing.whats.new, which is not the exact error I'm seeing.
Navigate to:
App Store Connect
Choose your App
TestFlight
Test Information
You will probably see this error message up top:
⚠️ Complete test information is required to submit a build for external testing.
You can ignore that. For an internal test to work, you don't need any information on here. However, to get Fastlane's changelog feature working, you'll need to fill in the following details...
primary.test.info
Could not set changeling: {"code"=>"ITC.apps.tf.build.missing.primary.test.info", "description"=>"Missing primary test info."}
You're missing a "beta app description":
test.info.missing.feedback
Could not set changelog: {"code"=>"ITC.apps.tf.build.test.info.missing.feedback", "description"=>"Missing feedback email."}
You're missing the "feedback email":
So as a minimum, you need to fill in the following information when using fastlane's TestFlight changelog feature:
Beta App Description
Feedback Email

Chromecast sample sender application CastHelloText-chrome ends with error when trying to get session

I have problem with launching Google-Cast application similar to sample CastHelloText-chrome. I slightly modified example code for my specific purposes. The goal for creating this application is to send and show image data directly in Chromecast device.
Particularly the difference between official sample and my code is in message format and its content, sent by sender application. Sender application took png image coded by base64 and send through message bus with custom namespace. Receiver application get this message and use this as data source for html object <img>.
Error appears when I do this steps:
Reload sender page, checking console if any device found.
Send the form by just pushing enter on input box (text is ignored).
Now a popup from Chromecast extension shows. Next there are two scenarios:
3a) I confirm casting to device by choosing one from the list, then I get this error message in console:
onError: {"code":"channel_error","description":"Error: Timeout","details":null}
3b) I just click somewhere else, I get this error:
onError: {"code":"cancel","description":"User closed popup menu","details":null}
Both of errors are caused by calling function chrome.cast.requestSession in chromehellotext.html at line 161, but what's really wrong I don't know.
When I step sender script I realize that function sessionListener is never called. I know that something go wrong when code try to call chrome.cast.requestSession, where described error raises. So I need help if I missed about right way to use Google-Cast API or If this problem has something to do with networking issues.
Receiver application is registered on Google Cast SDK Developer Console and I'm testing on registered device with some serial number. I'm using Google Chrome in version 42.0.2300.2 canary (64-bit) and Chrome version 40.0.2214.111 (current stable I suppose). For testing I also tried to turn off Windows Firewall entirely but with no luck.
Edit:
There were some syntactic errors that caused error message described above.
It seems like you are trying to use the data/control channel to send an image; please don't do that; that channel is not meant to be used for large data communications; in fact it cannot send anything which approaches or exceeds 64k. If your goal is to send images from your local machine, you would need to run a local web server on your local machine and serve images through the web server.
For and easiest tutorial you can have a look to this tutorial.
It is well explained in this tutorial.
Chromecast Sender application
There is no need to maintain session by yourself.
just add button and enjoy casting
mCastManager.addMediaRouterButton(mediaRoutebtn);
I found a source of my problem. There was something wrong in receiver code - syntactic and runtime errors, so I must admit that my code wasn't functional. Now its working in terms of launching application and getting session.
Unfortunate thing is that the error message generated by Chromecast extension didn't match the actual error - at least it was a bit confusing when I didn't know what's really happening on receiver side without ability to debug the code.

Disable Heroku Router Logs

I've written a Heroku app, that's a very simple API. A number of GET requests are made to it with sensitive information amongst their parameters. It would be preferable to have Heroku not log this sensitive information.
Is there any way to have Heroku not log requests or better yet, truncate the path so it contains no parameters?
I don't think there's a way to do it. The usual answer is to POST the sensitive information rather than use GET, but I'm guessing that's not an option for you.
Using heroku logs --source app will only show the logs of you app.
heroku logging
I had the same issue and as I didn't find a solution.
So I'll let you know my workaround for PHP Laravel 6.3 application on Heroku.
Activate Papertrail addon (free with "Wayne" plan)
Show web app output
Filter for "application" (and environment, in my case "staging"
"Save search" -> Replace existing search -> "web app output"
Hope this helps others.
In case anyone is still searching for this. Papertrail now supports Log filters.
Just go to Papertrail > Dashboard > lower right corner > Filter logs.
You can use a regular expression like this:
heroku\/router
and papertrail will ignore all heroku/router logs. This however does not prevent Heroku from emitting those logs altogether, you can still see live heroku/router logs by going to your app's dashboard and clicking "More"> "View Logs.
It can significantly reduce costs though.

YouTube iframe API official example gives errors

As of 2013-04-16 WEST, the official getting started example of the YouTube iframe API results in error messages when run in Chrome 25 on WinXP/SP3:
I am accessing the example hosted on a web server, i.e. not via the local file system.
Am I doing something wrong? Is the example / the API broken? Can you reproduce the issue?
This error message has been around for quite a while -- as this Google Group post explains, it's due to an unresolved (4-year unresolved!) bug in WebKit:
https://groups.google.com/forum/?fromgroups=#!topic/youtube-api-gdata/VKGl4ahBGyk
It shouldn't affect anything -- it certainly hasn't for our projects, and in visiting the demo URL you posted, it looks like it isn't affecting the API functionality there (i.e. in that demo, the video still stops after 6 seconds per what the code states). There was an SO question a while back that thought it might be affecting analytics:
youtube "Unable to post message to..." causing video analytics to not be tracked
But it was never confirmed as being relevant.
It will be interesting to see if Chrome's move to the new Blink fork of WebKit leads to the bug itself being resolved.

Resources