hyperledger fabric rest API to smart contract - hyperledger-fabric

I am making a custom API endpoint to my hyperledger fabric smart contract and i am using postman to test. The post is status of 200 but throws and error of cant read submitTransaction() function how to fix this error
terminal error:
TypeError: Cannot read property 'submitTransaction' of undefined
at Object.exports.invoke(/home/hlf/dpt_old/webapp/api/network.js:133:50)
at router.post (/home/hlf/dpt_old/web-app/api/routes/members.js:32:34)at <anonymous>at process._tickCallback(internal/process/next_tick.js:188:7)
POST /members/ 200 88.465 ms - 386
postman error:
"message": "Cannot read property 'submitTransaction' of undefined",
"stack": "TypeError: Cannot read property 'submitTransaction' of undefined\n at Object.exports.invoke (/home/hlf/dpt_old/web-app/api/network.js:133:50)\n at router.post (/home/hlf/dpt_old/web-app/api/routes/members.js:32:34)\n at <anonymous>\n at process._tickCallback (internal/process/next_tick.js:188:7)"

Related

HERE Api "errorMessage": "Cannot read property 'status' of undefined",

I have just created a geocoding lambda service using the
AWS Serverless Application Repository. This uses the HERE api.
When testing the api in API Gateway using the following url
https://geocode.json.search.hereapi.com/6.2/geocode.json?apikey=XXXXX&searchcode=glasgow
Which is generated by the lambda code generated by AWS
I see the error
{
"errorType": "TypeError",
"errorMessage": "Cannot read property 'status' of undefined",
"stack": [
"TypeError: Cannot read property 'status' of undefined",
" at getData (/var/task/geocode.js:38:36)",
" at processTicksAndRejections (internal/process/task_queues.js:97:5)"
]
}
I have probably made a simple error but can someone tell me how to resolve this. I cannot see in the Docs etc where the cause is.
Thanks
Check your lambda function where you have an undefined object :
You object is undefined before access to status attribut : yourObject.status

aws lambda edge TypeError modifying headers

I have been following the guide here to try out lambda#edge. only difference is I am using node.js 10.x since 6.10 mentioned in the docs is not longer available.
when testing the code with the 'AWS Cloudfront Modify Response Header' the lambda executes successfully. However when actually calling the website over cloudfront, the lambda shows the following error.
2021-04-25T14:45:47.820Z 5ab6e11c-02eb-4c87-a9d2-bba1eca75698 ERROR Invoke Error
{
"errorType": "TypeError",
"errorMessage": "Cannot read property 'headers' of undefined",
"stack": [
"TypeError: Cannot read property 'headers' of undefined",
" at Runtime.exports.handler (/var/task/index.js:3:30)",
" at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"
]
}
I am not a programmer, little experience I have is with python but suspect the event body it is receiving is not in the correct format needed to be?

Error while using node js sdk in hyperledger fabric?

I m using node sdk for hyperledger fabric.i got the below error while using apiserver.js file in sdk. It only happens if i excute same query multiple time.
2019-11-22T09:02:35.721Z - warn: [Query]: evaluate: Query ID "[object Object]" of peer "peer0.org1.example.com:7051" failed: message=transaction returned with failure: TypeError: Assignment to constant variable., stack=Error: transaction returned with failure: TypeError: Assignment to constant variable.
at self._endorserClient.processProposal (/home/cybrosys/VIRUS/ERC-20-with-Hyperledger-Fabric/fabcar/javascript/node_modules/fabric-client/lib/Peer.js:140:36)
at Object.onReceiveStatus (/home/cybrosys/VIRUS/ERC-20-with-Hyperledger-Fabric/fabcar/javascript/node_modules/grpc/src/client_interceptors.js:1207:9)
at InterceptingListener._callNext (/home/cybrosys/VIRUS/ERC-20-with-Hyperledger-Fabric/fabcar/javascript/node_modules/grpc/src/client_interceptors.js:568:42)
at InterceptingListener.onReceiveStatus (/home/cybrosys/VIRUS/ERC-20-with-Hyperledger-Fabric/fabcar/javascript/node_modules/grpc/src/client_interceptors.js:618:8)
at callback (/home/cybrosys/VIRUS/ERC-20-with-Hyperledger-Fabric/fabcar/javascript/node_modules/grpc/src/client_interceptors.js:845:24), status=500, , url=grpcs://localhost:7051, name=peer0.org1.example.com:7051, grpc.max_receive_message_length=-1, grpc.max_send_message_length=-1, grpc.keepalive_time_ms=120000, grpc.http2.min_time_between_pings_ms=120000, grpc.keepalive_timeout_ms=20000, grpc.http2.max_pings_without_data=0, grpc.keepalive_permit_without_calls=1, name=peer0.org1.example.com:7051, grpc.ssl_target_name_override=peer0.org1.example.com, grpc.default_authority=peer0.org1.example.com, isProposalResponse=true
Help will be appreciated!
The error you are receiving is tunneled from the chaincode to the sdk.
Essentially is not related to the SDK but the chaincode.
Go to the machine with Hyperledger installed, and open logs for the dev peer.
You will find the same error
[Query]: evaluate: Query ID "[object Object]" of peer "peer0.org1.example.com:7051" failed: message=transaction returned with failure: TypeError: Assignment to constant variable., stack=Error: transaction returned with failure: TypeError: Assignment to constant variable.
and you will get that the problem is related to the chaincode.
I don't know how did you write your contract, if Go or other languages, but the message is clear: you declared a const and you are assinging it a new value.
Check your code, re-deploy the contract and you solve.

Locomote player gives this error: Object {code: 731, message: "Socket reported a security error: Error #2048."}

I am using red5pro for rtsp streams and I need flash player to play live streams over rtsp.
Locomote is giving this error
Object {code: 731, message: "Socket reported a security error: Error #2048."}
I am not very familiar with the socket policy. Can somebody help me out in this?

Uncaught TypeError: Cannot call method 'postMessage' of null in cast_sender.js

I'm trying to update my chrome based chromecast app to the official SDK and I'm seeing intermittent initialization failures in cast_sender.js line 3383 with an error of :
Uncaught TypeError: Cannot call method 'postMessage' of null
Usually reloading makes it go away.
Is this a know issue ?

Resources