Google Cloud Speech Async Streaming GRPC tunnel closed by Google - google-cloud-speech

Trying to connect our contact center to Google Cloud Speech via gRPC on C++, using async streaming.
The logs we pass down the configuration is below:
#2018-08-01 07:13:11,316||FINEST|MediaMgr|2601||ProcessMessage - Message
Content: type: StartCloudRecognition
endpointID: 5
config: { "provider": "google", "profanity-filter": false, "chunkSize": 8192,
"phrases": [] }
Then we start writing the content in:
#2018-08-01 07:13:12,101||FINEST|Tele|2673|FileName=media/audio/CloudEndpoint.cpp,LineNumber=317|CheckStatus() get 2|MPP227####
#2018-08-01 07:13:12,151||FINEST|Tele|2673|FileName=media/audio/CloudEndpoint.cpp,LineNumber=317|CheckStatus() get 1|MPP227####
#2018-08-01 07:13:12,151||FINEST|Tele|2673|FileName=media/audio/CloudEndpoint.cpp,LineNumber=325|GSRProvider::CheckStatus: EndpointID=5 Got event tag=0x1899f98 ok=true state=1|MPP227####
#2018-08-01 07:13:12,151||FINEST|Tele|2673|FileName=media/audio/CloudEndpoint.cpp,LineNumber=317|CheckStatus() get 1|MPP227####
#2018-08-01 07:13:12,151||FINEST|Tele|2673|FileName=media/audio/CloudEndpoint.cpp,LineNumber=325|GSRProvider::CheckStatus: EndpointID=5 Got event tag=0x1899f94 ok=true state=2|MPP227####
#2018-08-01 07:13:12,151||FINEST|Tele|2673|FileName=media/audio/CloudEndpoint.cpp,LineNumber=317|CheckStatus() get 1|MPP227####
#2018-08-01 07:13:12,151||FINEST|Tele|2673|FileName=media/audio/CloudEndpoint.cpp,LineNumber=325|GSRProvider::CheckStatus: EndpointID=5 Got event tag=0x1899f8c ok=true state=4|MPP227####
the final line of the snippet logs state = 4 is write_tag, so our app do write data through the gRPC tunnel.
and little bit later we got lines like :
#2018-08-01 07:13:12,283||FINEST|Tele|2673|FileName=media/audio/CloudEndpoint.cpp,LineNumber=325|GSRProvider::CheckStatus: EndpointID=5 Got event tag=0x1899f90 ok=false state=3|MPP227####
this event comes in as a read_tag and the ok tag is being set to google to false, from gRPC it means the tunnel being closed. So the speech recognition process stop before the tester even try to speak some meaningful content.
we have 2 lab sharing same build on the same area, one in ireland which always failed the test, one at usa always pass the same test.
Any Ideas?

Find out some packet we sent to google is corrupted.

Related

NestJS microservices error with "No matching message handler"

I'm building an application with microservices communicating through RabbitMQ (request-response pattern). Everything works fine but still I have a problem with error "There is no matching message handler defined in the remote service." - When I send POST to my Client app, it should simply send the message with data through client (ClientProxy) and the Consumer app should response. This functionality actually works, but always only for the second time. I know it sounds strange but on my first POST request there is always the error from Client and my every second POST request works. However this problem is everywhere in my whole application, so the particular POST request is just for the example.
Here is the code:
Client:
#Post('devices')
async pushDevices(
#Body(new ParseArrayPipe({ items: DeviceDto }))
devices: DeviceDto[]
) {
this.logger.log('Devices received');
return this.client.send(NEW_DEVICES_RECEIVED, devices)
}
Consumer:
#MessagePattern(NEW_DEVICES_RECEIVED)
async pushDevices(#Payload() devices: any, #Ctx() context: RmqContext) {
console.log('RECEIVED DEVICES');
console.log(devices);
const channel = context.getChannelRef();
const originalMsg = context.getMessage();
channel.ack(originalMsg);
return 'ANSWER';
}
Client has the RMQ settings with queueOptions: {durable: true} and the consumer as well queueOptions: {durable: true} with noAck: false
Please do you have any ideas what may causes the problem? I have tried sending the data with JSON.stringify and changing the message structure to {data: devices} but the error is still there.
I had same error and finally solve it today.
In my project, there is an api-gateway as a hybrid application to receive requests and pass data to other systems, every second request gives an error like below.
error: There is no matching message handler defined in the remote service.
Then I tried to remove the api-gateway hybrid application scope in the code below, the error is gone, hope this helps you out with this.
// api-gateway main.ts
const app = await NestFactory.create(AppModule);
// run as a hybrid app —→ remove it
app.connectMicroservice({
transport: Transport.RMQ,
noACK: false,
options: {
urls: [`amqp://${rmqUser}:${rmqPassword}#127.0.0.1:5672`],
queue: 'main_queue',
queueOptions: {
durable: false,
},
},
});
// run hybrid app
await app.startAllMicroservices(); —→ remove it
await app.listen(3000);
I solved this issue by placing the #EventPattern decorator on to a #Controller decorator method
I had this error while NOT using RabbitMQ. I found very little help online around this error message outside of it being related to RabbitMQ.
For me it was an issue where I was importing a DTO from another microservice in my microservice's Controller. I had a new DTO in my microservice that has a similar name to one in another microservice. I accidentally selected the wrong one from the automated list.
Since there wasn't any real indicator that my build was bad, just this error, I wanted to share in case others made the same mistake I did.
I encountered this same issue today and could not find any solution online and stumbled upon your question. I solved it in a hacky way and am not sure how it will behave when the application scales.
I basically added one #EventPattern (#MessagePattern in your case) in the controller of the producer microservice itself. And I called the client.emit() function twice.
So essentially the first time it gets consumed by the function that is in the producer itself and the second emit actually goes to the actual consumer.
This way only one POST call is sufficient.
Producer Controller:
#EventPattern('video-uploaded')
async test() {
return 1;
}
Producer client :
async publishEvent(data: VideosDto) {
this.client.emit('video-uploaded', data);
this.client.emit('video-uploaded', data);
}
I've experienced the same error in my another project and after some research I've found out that problem is in the way of distributing messages in RabbitMQ - named round-robin. In my first project I've solved the issue by creating a second queue, in my second project I'm using the package #golevelup/nestjs-rabbitmq instead of default NestJS library, as it is much more configurable. I recommend reading this question

Google embedded assistant service gives an error about text_config missing when it is included

I'm trying to use the embedded Google Assistant service (https://developers.google.com/assistant/sdk/reference/rpc/google.assistant.embedded.v1alpha2) to send some text queries from an app I'm writing in Rust. As there's no official client library and I haven't been able to get either of the GRPC libraries I've tried working, I'm POSTing an AssistRequest proto directly to https://embeddedassistant.googleapis.com/$rpc/google.assistant.embedded.v1alpha2.EmbeddedAssistant/Assist. After getting the appropriate OAuth token and registering a device ID, I send a proto like this:
config {
text_query: "what's the time"
audio_out_config {
encoding: MP3
sample_rate_hertz: 16000
}
screen_out_config {
screen_mode: PLAYING
}
dialog_state_in {
language_code: "en-US"
}
device_config {
device_id: "my_device_id"
device_model_id: "<my model id>"
}
}
(with a valid device_id and device_model_id filled in). However, I always get a 400 back, with the error
"Invalid \'AssistConfig\': audio_in_config or text_query must be provided."
Why am I getting this error, when text_query is clearly filled in? I get the same error if I try setting audio_in_config.
Answering my own question, it turned out I needed to wrap the request in a StreamBody proto, putting the serialised AssistRequest in the message field. This was not documented anywhere I could see though!

Track event to Google TagManager inside a ServiceWorker

I'm working on a service-worker (really a firebase cloud-messaging serviceworker like this) and I would like to track each time a user receives a push on Google TagManager.
Any help on how to include the script and send tracks within a SW?
Thanks.
The Service worker runs outside the main thread and does not have
access to the Window object, meaning that it cannot access the data
layer or the ga command queue to create trackers. In short, the
actions of a service worker cannot be tracked using the normal
on-page, JavaScript-based tracking snippets. What we can do, however,
is configure our service worker to send HTTP hits directly to GA.
Here is a sample code
fetch('https://www.google-analytics.com/collect', {
method: 'post',
body: JSON.stringify({
v: 1, // Version Number
t: eventName, // Hit Type
ec: eventCategory, // Event Category
ea: eventAction, // Event Action
el: 'serviceworker' // Event Label
})
})
If you want to get into more details, I would recommend reading this article. https://builtvisible.com/google-analytics-for-pwas-tracking-offline-behaviour-and-more/

Error 400 with Stripe iOS Payment

I'm using Stripe to process payments in my iOS Swift app and Firebase Cloud Functions for the backend. I setup an example app using Stripe's Example project located here:
Stripe iOS Standard Integration
When I load the CheckoutView I get an Error 400 response. The issue I believe is with the backendURL that I set in CheckoutViewController (customized using the link to the example above):
// 2) Next, optionally, to have this demo save your user's payment details, head to
// https://github.com/stripe/example-ios-backend/tree/v13.0.3, click "Deploy to Heroku", and follow
// the instructions (don't worry, it's free). Replace nil on the line below with your
// Heroku URL (it looks like https://blazing-sunrise-1234.herokuapp.com ).
let backendBaseURL: String? = "https://us-central1-app-1253c.cloudfunctions.net/https-client-donateToUser"
I get the following messages in my Cloud Function logs:
Request has incorrect Content-Type. application/x-www-form-urlencoded
Invalid request IncomingMessage
Function execution took 498 ms, finished with status code: 400
I tried using the URL of the actual Firebase app (ex: appname123.firebaseapp.com) but that returns an Error 404 instead.
Any ideas for a solution would be greatly appreciated. Thank you.
EDIT:
Thanks to #psmvac I fixed the backend URL. However, I'm now getting error The data couldn't be read because it isn't in the correct format. I believe this is because I don't have a cloud function to accept ephemeral keys. This is what I have so far, what else does this need in order to match the iOS Stripe Example? I'm struggling to find any Cloud Function examples of this online.
export const ephemeral_keys = functions.https.onCall(async (data, context) => {
const stripe_version = data.api_version
stripe.ephemeralKeys.create(data.customer_id,stripe_version)
}
)

Roblox: MarketplaceService:PromptGamePassPurchase error

So I have made a game pass, and in solo mode, if I check that the game pass (which I own) is owned, everything is fine. But when I test the game via the test tab, or upload it and connect with another account, the call in a server script:
clientWantsPass.OnServerEvent:connect(function(plr)
print("Prompting for purchase of " .. tostring(conf.changeSongPassID))
MarketplaceService:PromptGamePassPurchase(plr,conf.changeSongPassID)
end)
Produces the output on the server:
Prompting for purchase of 1059063949
And on the client:
04:14:25.798 - PurchasePromptScript: getProductInfo failed because MarketplaceService:getProductInfo() failed because HTTP 0 (HTTP 400 (HTTP/1.1 400 BadRequest)) Make sure a valid ID was specified
The pass does exist, I made it. calls to
game:GetService("GamePassService"):PlayerHasPass(plr, conf.changeSongPassID)
Return true for my character, and false for people who haven't bought it yet. I've tested putting the call to PromptGamePassPurchase on the server side, or in a local script. Always the same error.
Any help would be appreciated.
That happens because Roblox messed up the Gamepasses, and now they're a seperate 'category'.
You could try by using PromptPurchase, like MoonRunestar said?

Resources