Google Cloud Platform - RecognitionAudio not set - node.js

since this morning, I'm receiving the following error from Google Cloud Platform when transcribing audio to text:
{ Error: RecognitionAudio not set.
at Operation._unpackResponse (/usr/src/app/node_modules/google-gax/build/src/longRunningCalls/longrunning.js:145:31)
at noCallbackPromise.currentCallPromise_.then.responses (/usr/src/app/node_modules/google-gax/build/src/longRunningCalls/longrunning.js:131:18)
at <anonymous> code: 3 }
Please note that I have not changed anything in my code, and this code was working perfectly before this. The code is as follows:
const client = new speech.SpeechClient();
client.longRunningRecognize({
config: {
encoding: "FLAC",
enableWordTimeOffsets: true,
languageCode: "en-US"
},
audio: {
uri: "gs://some-cloud-bucket/audiofile.flac"
}
})
As you can see, for RecognitionAudio I'm sending a Google cloud URI as described in their docs here: https://cloud.google.com/speech-to-text/docs/reference/rest/v1/RecognitionAudio
I have confirmed that both the bucket and audiofile exist. Keep in mind this was working fine yesterday.
I have no clue where to look in order to solve this error. Cloud status says their platforms are up and running and are having no issues.
Any of you guys experiencing the same problem? Or am I simply doing something wrong all of a sudden? E.g. using something deprecated that was patched today?
If anyone could point me in the right direction, that'd be awesome. Thank you in advance.

Right. So 11 minutes after posting this issue the service started working again. 🤦🏻‍♂️
They have been down since (at least) 2019-09-18 08:21:01 UTC which translates to about 7 hours.
For anyone reading this, the code above should be fine and working as intended.

Related

Flutter not able to decode json data

I am currently learning flutter from a udemy course. Following the course now I am building a climate app using openweathermap.org's api. The app was working fine with default location of the emulator but then I followed my instructor and customized the app so that it can use the device current location but the app was not responding and was returning statusCode as 401. I tried running my instructor's code as well but the same problem was there as well so if anyone can tell me the reason of the statusCode being 401 because when I ran the url it gave the correct json data but I think android studio(Flutter) was not able to decode json data.
If someone can please justify the reason for the problem please respond.
Thankyou
This could be caused because of an invalid or bad API key. You can get an API key from the openweathermap.api.
Once it works it will return a 202 status code.

nodejs api returning nothing

I am trying to implement MEAN app for which I made node server
app.get("/posts",(req,res)=>{
posts=[{"title":"a","context":"b"},{"title":"c","context":"d"}]
res.send(posts); // tried even with res.status(200).json(posts)
});
when it checked with api tester it works well output snapshot
output snapshot with apitester
when i try to access with angular services
getposts()
{
var url='http://localhost:3000/posts';
this.http.get<post[]>(url).subscribe(data=>this.posts=data);
console.log(this.posts);
return this.posts;
}
when i do console.log(posts) it returning []
can someone please help i am struggling from last 2 days?
As you have not added the screenshot from the Browser's Inspector => Network Tab, I am guessing this answer will help you in case my guess is right.
Try setting the below in your front-end project (Angular in your case):
Try setting the below in your back-end project (Node in your case):
Also, verify your updates as in the below screengrab in the Browser's Inspector (Chrome in my case):
Please Note: - The mentioned response headers have special meaning, so kindly look for more info with a simple Google search. Use these settings during your development phase on localhost.

Is accessing the Customer Profile API possible using the Cloud9 code editor in the AWS Lambda web console? If so, how?

First off, I'm new to Alexa skill development, so I have much to learn. I've been banging my head off the desk trying to figure this out. I've found various tutorials and have gone over the information provided by Amazon for accessing the Customer Profile API via an Alexa skill but still can't manage to obtain the customer's phone number.
I'm using the AWS console in-line code editor (Cloud9). Most, if not all, instructions use something like 'axios', 'request', or 'https' modules which I don't think is possible unless you use the ask-cli (please correct me if I'm wrong). Also, I followed a tutorial to initially create the skill which had me use Skillinator.io to create an AWS Lambda template based on the skill's JSON in the Amazon Developer console. The format of the code in the Customer Profile API tutorials does not match what was provided by the Skillinator.io tool. The way the Intent handlers are set up is different, which is where I believe my confusion is coming from. Here's an example:
Skillinator.io code:
const handlers = {
'LaunchRequest': function () {
welcomeOutput = 'Welcome to the Alexa Skills Kit!';
welcomeReprompt = 'You can say, Hello!';
this.emit(':ask', welcomeOutput, welcomeReprompt);
},
};
Tutorial code:
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
},
handle(handlerInput) {
const speechText = 'Welcome to the Alexa Skills Kit!';
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.withSimpleCard('Hello World', speechText)
.getResponse();
}
};
Can anyone shed some light and help me understand why there is a difference in the way the handlers are formatted, and how (if possible) to create the request to the Customer Profile API?
I've already completed the steps for the necessary permissions/account linking.
Thanks in advance.
EDIT:
I've learned that the difference in syntax is due to the different versions of the sdk, Skillinator being 'alexa-sdk' or v1 and the various tutorials using 'ask-sdk' or v2.
I'm still curious as to whether using modules like 'axios' or 'request' is possible via the in-line code editor in AWS console or if it's even possible to access the Customer Profile API using sdk v1?
I've decided to answer the question with what I've learned in hopes that others won't waste as much time as I have trying to understand it.
Basically, it is possible to use the above-mentioned modules in sdk v1 using the AWS console's in-line code editor but you must create a .zip file of your code and any necessary modules and upload that .zip to Lambda.
I've edited my original answer to include my findings for the difference in syntax in the intent handlers.
From what I can tell (and please correct me if I'm wrong), it is not possible to access the Customer Profile API using the sdk v1.

Interpreting Error Code -102 Nightmare.js Scraping

I'm just getting started with Nightmare.js. I'm building off of their demo, which targeted duckduckgo.com and worked beautifully. I set my sights on imdb.com and got . . .
{ message: 'navigation error',
code: -102,
details: 'ERR_CONNECTION_REFUSED',
url: 'https://imdb.com/' }
My questions are 1) whether or not this came up because imdb.com knew it was being scraped or some other reason and 2) is it a Nightmare thing, a Node.js thing, or an Electron thing? I've tried googling about for the specific code and gotten very nonspecific answers. Any thoughts?
url: 'https://imdb.com/'
Make it just
url: 'http://imdb.com/'
If you try navigating to https://imdb.com in any other browser you get redirected to http://imdb.com. It seems they don't provide https: on their homepage. Changing the code to use the http version made it work for me.

API Error Code: 100 using passport-facebook in nodejitsu

I've been developing this app during the last few weeks, which uses a login system based on passport-facebook, and everything was working fine on my dev computer until I decided to test it on nodejitsu.
The error that im getting is:
API Error Code: 100 API Error
Description: Invalid parameter Error
Message: redirect_uri URL is not properly formatted
The redirect_uri is: https://www.facebook.com/dialog/oauth?display=popup&response_type=code&redirect_uri=http%3A%2F%2Ftookie_beta.jit.su%2Fauth%2Ffacebook%2Fcallback&scope=email%2Cuser_website&client_id=399936936740982&type=web_server
Which looks fine to me, so I'm kinda lost.
This was the configuration that i was using on my local machine:
And this is the configuration that I have now:
Does anyone knows what's going on, or what i'm missing here ? Thanks !
I believe that your Site URL is wrong. Shouldn't it point to http://your-subdomain.jit.su?
Hasn't nodejitsu dropped its service as it was bought out by GoDaddy :(
Link: https://blog.nodejitsu.com/nodejitsu-joins-godaddy/

Resources