I want to insert new car or query using a web application. Within this app.js, I use POST and GET method to insert new car or view all.
But every time, when I try to submit a new car or click "View All cars", it returns this error
[SOLVED]
await gateway.disconnect();
This is the villain, HA!! It disconnects the gateway and errupts the connection between chaincode. Thus, I am getting this "can not read from peer" error. I just omit this line and now it is working fine.
Related
I want to create a wallet for new rest api server, but whenever I call code to generate new Wallet I'm getting error like
"Decoding SignatureHeader failed: Error illegal buffer ..."
Here is screen shot of my code, it is taken from virtual machine
I'm using hyperledger fabric 2.2 and run under the fabric-samples/test-network
I was clone this HyperledgerFabroc
Here is also print screen of the error:
I would appreciate if someone can navigate me how to manage successfully to create a wallet ?
Your error looks to be occurring within a chaincode transaction function. You should not be using the client SDK to do a transaction invocation from within chaincode. Instead look to use the invokeChaincode function on the stub:
https://hyperledger.github.io/fabric-chaincode-node/release-1.4/api/fabric-shim.ChaincodeStub.html#invokeChaincode
I'm testing Azure SQL Serverless and from SSMS it seems to work fine, but from my ASP.NET Core application it never wakes up.
Using SSMS I can open a connection to a sleeping Serverless SQL database and after a delay the connection will go through.
Using my ASP.NET Core application I tried the same. From the login page I tried to login, which opens a connection to the database. After 10 or 11 seconds (I looked up the default timeout and its supposed to be 15 seconds but in this case it always seems to be about 10.5 seconds +/-0.5s). According to the docs, the first connection attempt may fail but subsequent ones should succeed, but I can send multiple queries to the database and it always fails with the following error:
Microsoft.Data.SqlClient.SqlException (0x80131904): Database 'myDb' on server
'MyDbSvr.database.windows.net' is not currently available. Please retry the connection later. If the
problem persists, contact customer support, and provide them the session tracing ID of
'{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'.
If I wake the database up using SSMS then the login web page can connect to the database and succeeds.
I have added Connect Timeout=120; to the connection string.
The connection does happen during an HTTP request that is marked async on the Controller, thought I don't know if that makes any difference.
Am I doing something wrong or is there something additional I need to do to get the DB to wake?
[updte]
as an extra test wrote the following test
void Main()
{
SqlConnection con = new SqlConnection("Server=mydbsvr.database.windows.net;Database=mydb;User Id=abc;Password=xyz;Connect Timeout=120;");
Console.WriteLine(con.ConnectionTimeout);
con.Open();
var cmd = con.CreateCommand();
cmd.CommandText = "select getdate();";
Console.WriteLine(cmd.ExecuteScalar());
}
and got the same error.
I figured it out and its the dumbest thing.
This Azure SQL Server instance was migrated from another subscription and the group that migrated it gave it a new name, but they did something that allowed the use of the old name also. I'm researching to figure out how that was done. I will update this answer when I find out what that was.
As it turns out, using the old name with an Serverless Database won't wake up the db. Don't know why. But if you change to use the new/real server name it works. you do have to add a retry to the connection as it may fail the first few times.
[Update]
The new server allows logins using the old name by using a Azure SQL Database Alias https://learn.microsoft.com/en-us/azure/sql-database/dns-alias-overview
I'm using Azure Logic App. This is the architecture:
I have a Scope Insert Row that include an insert statement in database.
I would like to send via mail the message of the exception of the insertion.
For example if the Insert statement failed with Foreign key exception, i would like to send this message.
How can I refer to this error message inside the 'Send error Msg' feature?
Thanks a lot guys :)
You could set the Configure run after value to implement it. Set the Send an email action run after Insert row has failed.
If the Insert action success, the send mail won't execute and if it fails the send mail would work. You could also add the run after action value like the time out or is skipped, they are all kind of exceptions.
UPDATE: If this is your error message, you could add it with #{body('Insert_row')?['message']} in code view mode.
And here is my error message and the subject setting.
You can make use of Filter Array and result function to capture the actual error of an action failed in a Scope.
For more insights with example see following article - How can I handle exception in Azure Logic App
Thanks,
Maheshkumar Tiwari
TechFindings...by Maheshkumar Tiwari
I am using appRTC to make demo app. I have setup following things successfully but got stack with JSON format that return in response of Turn-server API.
Use SSL for secure connect to make it work on Google Chrome (Done)
Implement custom WebSockets (Done)
Develop custom API for TurnServer (Done)
I am getting following error in console log.
Create PeerConnection exception: Failed to construct 'RTCPeerConnection': Malformed RTCIceServer
Failed to start signaling: Cannot read property 'addStream' of null
I have tried following responses as ice server object
Current object:
{"iceServers":[{"urls":["stun:stun.l.google.com:19302"]},{"urls":["turn:domain.com:8080?transport=udp","turn:domain.com:8080?transport=tcp","turn:domain.com:8080"],"username":"test","credential":"password"}],"lifetimeDuration":"86400s","blockStatus":"NOT_BLOCKED","iceTransportPolicy":"all"}
Have also tried:
[{"urls":["stun:stun.l.google.com:19302"]},{"urls":["turn:domain.com:8080?transport=udp","turn:domain.com:8080?transport=tcp","turn:domain.com:8080"],"username":"test","credential":"password"}]
and also tried this one:
[{"urls":["turn:domain.com:8080?transport=udp","turn:domain.com:8080?transport=tcp","turn:domain.com:8080"],"username":"test","credential":"password"}]
You have a typo here:
[{"urls":["stun:stun.l.google.com:19302"}
trying to close urls without closing the array.
This should be
[{"urls":["stun:stun.l.google.com:19302"]}
This doesn't result in an error about malformed RTCIceServer though.
Based on your comment it seems to be a result of calling
new RTCPeerConnection({"iceServers":[{}]})
-- an empty object is not a valid RTCIceServer.
I would also recommend not passing
"lifetimeDuration":"86400s","blockStatus":"NOT_BLOCKED"
to the RTCPeerConnection as it doesn't know about these.
I am getting this error in background page when responding to request
from content script.
Does anyone know what can be causing this error?
Full stack trace:
Uncaught Error: Attempting to use a disconnected port object chrome/RendererExtensionBindings:147
chrome.Port.postMessage chrome/RendererExtensionBindings:147
chromeHidden.Port.dispatchOnConnect.connectEvent chrome/RendererExtensionBindings:89
myExtension.foo.sendResponse.state background.js:1573
db.readTransaction.tx.executeSql.paramStr background.js:1038
This only happens after a couple of hours of browsing reloading extension is not helping - not that it would be a solution after restarting chrome browser all gets back to normal for couple of hours content script can keep sending request to background but NO response
from background can be sent back Is there any way I could catch this Uncaught error and reset the listener?
I am using chrome.extension.onRequest.addListener for my communication. Before I respond I query DB and I do not send any other response before query is finished.
Thanks,
Marek
This is caused when a connection get closed. For example if you open a tab that has the content_script injected, it opens a connection, the tab is closed, and then the background_page tries to pass a message. It will fail because the tab is no longer active to receive the message.
In your case I would guess that as tabs close and new tabs open you are attempting to post messages with the old tabId instead of creating a new connection to the new tab. I would recommend reading through the long-lived connections section again.
In my case, however, I needed to provide the sendResponse function to the chrome.runtime.sendMessage(msg, responseCallbackMissingHere), which will give you the "Attempting to use a disconnected port object" error.