Uncaught (in promise): Response with status: 0 in Angular2/Ionic2 - node.js

I have linked my app into NodeJS server, after the get request goes(sucsses) I get an error on the app Uncaught (in promise): Response with status: 0 for URL: null.
This is the lastest branch of the app:
https://github.com/eshk12/Parabi/tree/DB-LINKED
And this is the NodeJS server:
https://github.com/eshk12/parabiNodeJS
I am talking about the function CreateMedicine() inside /Services/NetworkServices.ts.
The function CreateMedicine() goes to http://localhost:3000/Medicines/add/ with its GET parameters and insert them to the database.
but unknown error appear.
Hope you guys may help me fix it.
Thanks!

I believe that happens when the OPTIONS call fails. Most likely due to the service being unavailable.
OPTIONS http://localhost/api/login net::ERR_CONNECTION_REFUSED

Related

WebHook call failed. Error: DEADLINE_EXCEEDED, State: URL_TIMEOUT, Reason: TIMEOUT_WEB calling from node

I am not sure what mistake I am doing. I have create a ChatBot in google dialog flow and did setup of WebHook in my local. Once I am hitting from dialogbox then reuqest is landing to code and processed successfully but in Dialogflow response I am getting failure due to some TimOut exception, there a way to fix this . I am facing WebHook call failed. Error: DEADLINE_EXCEEDED, State: URL_TIMEOUT, Reason: TIMEOUT_WEB calling from node.
Below is the index.json snippet :
Below is the console log
At the end of the function you need to resolve the promise.
return Promise.resolve();
Additionally, you're probably already handling errors but in a Firebase Function, if you need to throw an error, you can do that simply this way:
throw new functions.https.HttpsError(
'internal',
'Woops, that should not happen.',
);

"Error: Internal error encountered" while running RequestSync to Google Homegraph API - Node.js

I am using a Nodejs client to integrate with Google Smart Home.
When I request to RequestSync API, it sometimes shows the following error.
Error: Internal error encountered.
Although I saw the above error, it seems that the SYNC request has been triggered properly.
Does anyone know why this happens?
Since the request failed and returned an error, our app retries the RequestSync again and again, so I'd like to fix the error if possible.
Thank you.
Environment
#googleapis/homegraph: 3.0.2
Nodejs: 18.4.0

Azure app service some requests returns 400 Bad Request. The request could not be understood by the server due to malformed syntax

So we have a simple .net core 5.0 service that only serves some simple pages with mvc. We are starting to get 400 Errors (details below) on some of the requests. Our frontend is embedded in an iframe which forces us to use our own domain for our api-calls. The 400 errors disappears when we use the azure internal-urls. (*.azurewebsites.net instead of *.ourdomain.net). When I get to the "diagnose and solve problems" -> "availability and performance" -> HTTP 4XX ERRORS i can se below errors. Any ideas on what can cause this error?
Bad Request. The request could not be understood by the server due to malformed syntax. The client should not repeat the request without modifications.
So, the biggest problem above is that we do not get the correct errormessage. After a lot of experimentation we activated the ConnectionLogging for Kestrel.
WebHost.CreateDefaultBuilder(args)
.UseKestrel(options =>
{
options.ConfigureEndpointDefaults(listenOptions =>
{
listenOptions.UseConnectionLogging();
});
})
And after that we found some more intressting logs. One that said:
Connection id "0HMFSA73IA4LS" bad request data: "Malformed request: invalid headers."
Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Malformed request: invalid headers.
After some more investigation we could diff a succesful request from a failing request. And the problem was related to the certificate of *.ourdomain.se. In a part of the certificate we hade a string thats named "Stockholms län" in the cases where it failed the string decoded to l�n and when it succeeded the string decoded to l%C3%A4n. We are now investigating if this is a load balancer problem. But this app is running hostingmodel outofprocess. By changing this to inprocess and wrap our Kestrel in IIS the errors disapears.

Google Cloud API Environment Credentials on Node.js on Phusion Passenger server

I have the translation client library set up on my Windows home Node.js server and use set GOOGLE_APPLICATION_CREDENTIALS=[PATH] to instantiate the credentials when I start the machine. This works fine.
On the publicly hosted server I don't think the request gets as far as asking for credentials because a different error is thrown than the one saying The request is missing a valid API key. This would appear I forgot to set the credentials or defined the path incorrectly.
I've tried many variations of export GOOGLE_APPLICATION_CREDENTIALS="[PATH]" but the error I keep getting is:
UnhandledPromiseRejectionWarning: Error: Unexpected error determining execution environment: Unsuccessful response status code. Request failed with status code 404
at GoogleAuth.<anonymous> (/usr/home/.../public_nodejs/node_modules/google-auth-library/build/src/auth/googleauth.js:163:23)
at Generator.throw (<anonymous>)
at rejected (/usr/home/.../public_nodejs/node_modules/google-auth-library/build/src/auth/googleauth.js:20:65)
at process._tickCallback (internal/process/next_tick.js:68:7)
I think this is to do with setting the environment variable in Phusion Passenger, but it's odd to me that the error I get is different.

Internal server error Azure Functions with spfx react-search-refiners

I am deploying react-search-refiner with LUIS and Azure Functions https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-search-refiners/functions
Now, I passed through various problems and finally confirmed the communication from SPFx to Function App.
My problem is when searching after deploying according to the procedure, an internal Sever error occurs after Status Code 200. And nothing error message returns.
POST https://.azurewebsites.net/api/enhanceQuery 500
(Internal Server Error) Message: [NlpService.enhanceSearchQuery()]:
Error: '{"error":{"type":"function_error","message":"Error"}}' for url
'https://.azurewebsites.net/api/enhanceQuery'
On the application log, Function App is executed and succeeded return code 0. So, it doesn't return error code.
My checking is below that does not contains in README. Would someone help me?
Set local.settings.json to environment variable.
Change authlevel "function" to "anonymous" for simplization.
Local debug is succeeded.
POSTMAN didn't check because rawQuery from HttpRequest might be
included large keys and values.

Resources