Push Notification in production is not working - ios

I Have implemented this url.
Development mode notification is working but in production its not working. and shows errors.
dakshas-iMac:alootamatar daksha$ php push_demo.php
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Users/daksha/Desktop/alootamatar/push_demo.php on line 18
Warning: stream_socket_client(): unable to connect to ssl://gateway.push-apple.com:2195 (php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known) in /Users/daksha/Desktop/alootamatar/push_demo.php on line 18
Failed to connect: 0 php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known
iMac:alootamatar daksha$ php push_demo.php
Warning: stream_socket_client(): Unable to set private key file `/Users/daksha/Desktop/alootamatar/cert.pem' in /Users/daksha/Desktop/alootamatar/push_demo.php on line 18
Warning: stream_socket_client(): failed to create an SSL handle in /Users/daksha/Desktop/alootamatar/push_demo.php on line 18
Warning: stream_socket_client(): Failed to enable crypto in /Users/daksha/Desktop/alootamatar/push_demo.php on line 18
Warning: stream_socket_client(): unable to connect to ssl://gateway.push.apple.com:2195 (Unknown error) in /Users/daksha/Desktop/alootamatar/push_demo.php on line 18
Failed to connect: 0
After using APNS tester got response
2016-01-01 09:37:08 +0000: Set SSL connection
2016-01-01 09:37:08 +0000: Set peer domain name gateway.push.apple.com
2016-01-01 09:37:08 +0000: Keychain Opened
2016-01-01 09:37:08 +0000: Certificate data for Apple Production IOS Push Services: com.daksha.alootamatar initialized successfully
2016-01-01 09:37:08 +0000: Sec Identity created
2016-01-01 09:37:08 +0000: Client certificate created
2016-01-01 09:37:10 +0000: Connected
2016-01-01 09:37:10 +0000: Token: <f65ed342 4416c0bf e2a8c26a f3eb9a69 70780771 4eadb033 61ca8aec c28d454a>
2016-01-01 09:37:10 +0000: Written 92 bytes sending data to gateway.push.apple.com:2195
2016-01-01 09:37:10 +0000: Disconnected from server gateway.push.apple.com:2195

First of all make sure you install production APN certificates on your server, not development certificates.
After that make sure, you are sending the notification to right server URL
Sandbox: gateway.sandbox.push.apple.com, port 2195. (for
thedevelopment)
Production: gateway.push.apple.com, port 2195. (for the release)
Still you have the same problem, try this App. APN Tester

Related

Hyperledger Fabric V2.3 Snapshot: failed to create new connection: context deadline exceeded

I'm running Fabric v2.3 test network, and I'm trying to take a snapshot of the ledger.
When I run:
# peer snapshot submitrequest -c mychannel -b 0 --peerAddress peer0.org1.example.com:7051 --tlsRootCertFile /opt/gopath/src/github.com/hyperledger/fabric/peer/o
rganizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
I obtain:
Error: failed to retrieve snapshot client: snapshot client failed to connect to peer0.org1.example.com:7051: failed to create new connection: context deadline exceeded
The cli container can connect to peer1. Inspecting the orderer logs, it seems that a connection to 172.19.0.1 (on variable ports) is not successful: https://gist.github.com/RafaelAPB/962477f9bab5f34076add1a3b9f63588
Part of it:
2021-10-04 00:31:54.519 UTC [common.deliver] Handle -> WARN 066 Error reading from 172.19.0.8:53714: rpc error: code = Canceled desc = context canceled
By inspecting the logs of peer0.org1, it really seems that the problem is the connection with the orderer (in particular the TLS handshake): https://gist.github.com/RafaelAPB/6adf0c6e702387e4e0edd8de0dcf0a76
Part of it:
2021-10-04 00:52:03.595 UTC [comm.grpc.server] 1 -> INFO e6d unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.19.0.1:52374 grpc.code=OK grpc.call_duration=4.028085ms
2021-10-04 00:52:04.293 UTC [core.comm] ServerHandshake -> ERRO e6e Server TLS handshake failed in 33.508µs with error tls: first record does not look like a TLS handshake server=PeerServer remoteaddress=172.19.0.8:58532
2021-10-04 00:52:04.419 UTC [gossip.privdata] StoreBlock -> INFO e6f Received block [505] from buffer channel=mychannel
No configurations were added to the configtx.yaml regarding the snapshotting feature.
Any ideas on how to run the snapshot command successfully?

Hyperledger Fabric Error - Attempted to contact 2 Peers. Last error was Error: Failed to connect before the deadline

I bring up 4 peers using byfn.sh.
Everything comes up fine and I can see the orderer, peers, CA nodes, etc. running in docker containers
I then use a custom service layer application that uses the Fabric Node SDK to connect with this network.
I have no issues making the connection using byfn.sh generated TLS CA certificate (/usr/local/src/test_env/hlf_scripts/first-network/crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem)
Here are the docker log messages for the call Gateway.getNetwork(“mychannel”):
2020-01-14 22:12:20.981 UTC [comm.grpc.server] 1 -> INFO 083 unary call completed grpc.service=discovery.Discovery grpc.method=Discover grpc.peer_address=192.168.80.1:38858 grpc.code=OK grpc.call_duration=515.21µs
2020-01-14 22:12:21.012 UTC [comm.grpc.server] 1 -> INFO 084 unary call completed grpc.service=discovery.Discovery grpc.method=Discover grpc.peer_address=192.168.80.1:38858 grpc.code=OK grpc.call_duration=552.801µs
I then bring up another client application, that uses pretty much the same code, for manipulating the network. The first step here is to ensure that the user’s (admin in this case) identity exists and can be imported into a wallet. The same piece of code is used to generate this identity, and using the same connection profile (connection_org1.json). The identity can be created and imported into the filesystem wallet.
I can connect to the network using the Gateway.connect(…) method and using the connection profile connection_org1.json. However, the moment I invoke Gateway.getNetwork(“mychannel”), my issues start. Here is the error returned by the Fabric SDK:
[nodemon] starting `node ./dist/server.js`
Express server listening on port 3050
Wallet path: /usr/local/src/fabric-network-code/wallet
E0114 17:16:47.872273165 1998 ssl_transport_security.cc:1238] Handshake failed with fatal error SSL_ERROR_SSL: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed.
E0114 17:16:48.873788447 1998 ssl_transport_security.cc:1238] Handshake failed with fatal error SSL_ERROR_SSL: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed.
E0114 17:16:50.368082218 1998 ssl_transport_security.cc:1238] Handshake failed with fatal error SSL_ERROR_SSL: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed.
2020-01-14T22:16:50.869Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpcs://localhost:7051
2020-01-14T22:16:50.870Z - error: [Channel.js]: Error: Failed to connect before the deadline URL:grpcs://localhost:7051
E0114 17:16:50.877630619 1998 ssl_transport_security.cc:1238] Handshake failed with fatal error SSL_ERROR_SSL: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed.
E0114 17:16:51.876732084 1998 ssl_transport_security.cc:1238] Handshake failed with fatal error SSL_ERROR_SSL: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed.
E0114 17:16:53.263732590 1998 ssl_transport_security.cc:1238] Handshake failed with fatal error SSL_ERROR_SSL: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed.
E0114 17:16:53.303070959 1998 ssl_transport_security.cc:1238] Handshake failed with fatal error SSL_ERROR_SSL: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed.
2020-01-14T22:16:53.875Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpcs://localhost:8051
2020-01-14T22:16:53.875Z - error: [Channel.js]: Error: Failed to connect before the deadline URL:grpcs://localhost:8051
2020-01-14T22:16:53.875Z - error: [Network]: _initializeInternalChannel: Unable to initialize channel. Attempted to contact 2 Peers. Last error was Error: Failed to connect before the deadline URL:grpcs://localhost:8051
Unable to initialize channel. Attempted to contact 2 Peers. Last error was Error: Failed to connect before the deadline URL:grpcs://localhost:8051
[nodemon] app crashed - waiting for file changes before starting...
And here is the log from the docker container log for peer0.org1.example.com
2020-01-14 22:16:47.872 UTC [core.comm] ServerHandshake -> ERRO 085 TLS handshake failed with error EOF server=PeerServer remoteaddress=192.168.80.1:38886
2020-01-14 22:16:48.874 UTC [core.comm] ServerHandshake -> ERRO 086 TLS handshake failed with error EOF server=PeerServer remoteaddress=192.168.80.1:38890
2020-01-14 22:16:50.368 UTC [core.comm] ServerHandshake -> ERRO 087 TLS handshake failed with error EOF server=PeerServer remoteaddress=192.168.80.1:38894
2020-01-14 22:16:53.303 UTC [core.comm] ServerHandshake -> ERRO 088 TLS handshake failed with error EOF server=PeerServer remoteaddress=192.168.80.1:38910
I have tried various permutations and combinations of using different certs but not getting anywhere. Online forums indicate this is an issue of communication between orderer and the peer. However, there are no error messages in the orderer.
I have asked this question in chat.hyperledger.org but no response yet.
So extremely foolish of me. I had a crypto-config directory sitting in my node project folder (I don't know when I may have copied it over....) and that was throwing off the tlscacert variable.
I have removed the offending directory and now it is reading the correct one under .../first-network/crypto-config/.../<tlsca file>.pem
Sometimes (and quite often :-) ) the answer is right there but one is too stupid to see it!!!

Failed connect to localhost:2633 ; Connection refused

I have installed open-nebula and it's installed successfully.
But when i point to my IP. I can't access.
and when i checked log then it show this.
Mon Feb 5 02:03:32 2018 [Z0][SCHED][E]: Cannot contact oned, will
retry... Error: HTTP POST to URL 'http://localhost:2633/RPC2' failed.
libcurl failed even to execute the HTTP transaction, explaining:
Failed connect to localhost:2633; Connection refused
Help in this ??

Create & Join Channel in Hyperledger Fabric Build your First Network Walk Through

I am trying create a channel according to documentation
Hyperledger Fabric v1.0 docs
Have an issue with certificate. On the docker "hyperledger/fabric-tools" node I can find certificate with current name - tlsca.example.com. But the channel cannot be created. I have certificate hand shake issue. Should I check/mount certificate to the peer node ?
root#4b6423da537b:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com# peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
2017-07-27 16:49:58.949 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2017-07-27 16:49:58.949 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2017-07-27 16:49:58.954 UTC [grpc] Printf -> DEBU 003 Failed to dial orderer.example.com:7050: connection error: desc = "transport: authentication handshake failed: x509: certificate signed by unknown authority (possibly because of \"x509: ECDSA verification failure\" while trying to verify candidate authority certificate \"tlsca.example.com\")"; please retry.
Error: Error connecting due to rpc error: code = Internal desc = connection error: desc = "transport: authentication handshake failed: x509: certificate signed by unknown authority (possibly because of \"x509: ECDSA verification failure\" while trying to verify candidate authority certificate \"tlsca.example.com\")"
Usage:
Thanks.
i meet the same problem. And run this command to close the network.
./network_setup.sh down mychannel
The reason that cause my problem is that the source code exists a error. So i modify this code error and reopen the network. This problem work out.
It would seem that you are in the incorrect working directory. When running the sample manually, you start the cli container and it places you in the /opt/gopath/src/github.com/hyperledger/fabric/peer directory. That is where you should be running the peer command. It would seem from your post that you were running the peer command in the /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com directory in the container, and it is not finding the configuration files that were mounted for the example.

Unable to install grails plugin mongodb

I am using grails-2.0.4 version with GGTS ide. When i tried to install mongodb some errors occuring. I have tried in two ways.
**1)compile ":mongodb:1.0.0.GA"**
Then it is getting this error:
| Loading Grails 2.0.4
| Configuring classpath
:: problems summary ::
:::: ERRORS
Server access Error: Connection timed out: connect url=http://plugins.grails.org/grails-mongodb/tags/RELEASE_1_0_0_GA/mongodb-1.0.0.GA.pom
Server access Error: Connection timed out: connect url=http://plugins.grails.org/grails-mongodb/tags/RELEASE_1_0_0_GA/grails-mongodb-1.0.0.GA.jar
Server access Error: Connection timed out: connect url=http://repo.grails.org/grails/plugins//mongodb/1.0.0.GA/mongodb-1.0.0.GA.pom
Server access Error: Connection timed out: connect url=http://repo.grails.org/grails/plugins//mongodb/1.0.0.GA/mongodb-1.0.0.GA.jar
Server access Error: Connection timed out: connect url=http://repo.grails.org/grails/core//mongodb/1.0.0.GA/mongodb-1.0.0.GA.pom
Server access Error: Connection timed out: connect url=http://repo.grails.org/grails/core//mongodb/1.0.0.GA/mongodb-1.0.0.GA.jar
Server access Error: Connection timed out: connect url=http://svn.codehaus.org/grails/trunk/grails-plugins/grails-mongodb/tags/RELEASE_1_0_0_GA/mongodb-1.0.0.GA.pom
Server access Error: Connection timed out: connect url=http://svn.codehaus.org/grails/trunk/grails-plugins/grails-mongodb/tags/RELEASE_1_0_0_GA/grails-mongodb-1.0.0.GA.jar
Server access Error: Connection timed out: connect url=http://repo1.maven.org/maven2//mongodb/1.0.0.GA/mongodb-1.0.0.GA.pom
Server access Error: Connection timed out: connect url=http://repo1.maven.org/maven2//mongodb/1.0.0.GA/mongodb-1.0.0.GA.jar
| Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
:mongodb:1.0.0.GA
**2) grails install-plugin C:\Documents and Settings\marao18\Desktop\gorm-mongodb-0.5.4**
Then it is getting this error: Please help me anyone.
| Loading Grails 2.0.4
| Configuring classpath.
| Environment set to development.....
| Resolving plugin C:\Documents. Please wait...
:: problems summary ::
:::: ERRORS
Server access Error: Connection timed out: connect url=http://plugins.grails.org/grails-%5CDocuments/tags/RELEASE_and/%5CDocuments-and.pom
Server access Error: Connection timed out: connect url=http://plugins.grails.org/grails-%5CDocuments/tags/RELEASE_and/grails-%5CDocuments-and.zip
Server access Error: Connection timed out: connect url=http://repo.grails.org/grails/plugins/C/%5CDocuments/and/%5CDocuments-and.pom
Server access Error: Connection timed out: connect url=http://repo.grails.org/grails/plugins/C/%5CDocuments/and/%5CDocuments-and.zip
Server access Error: Connection timed out: connect url=http://repo.grails.org/grails/core/C/%5CDocuments/and/%5CDocuments-and.pom
Server access Error: Connection timed out: connect url=http://repo.grails.org/grails/core/C/%5CDocuments/and/%5CDocuments-and.zip
Server access Error: Connection timed out: connect url=http://svn.codehaus.org/grails/trunk/grails-plugins/grails-%5CDocuments/tags/RELEASE_and/%5CDocuments-and.pom
Server access Error: Connection timed out: connect url=http://svn.codehaus.org/grails/trunk/grails-plugins/grails-%5CDocuments/tags/RELEASE_and/grails-%5CDocuments-and.zip
Server access Error: Connection timed out: connect url=http://repo1.maven.org/maven2/C/%5CDocuments/and/%5CDocuments-and.pom
Server access Error: Connection timed out: connect url=http://repo1.maven.org/maven2/C/%5CDocuments/and/%5CDocuments-and.zip
| Error resolving plugin [name:\Documents, group:C, version:and]. Plugin not found.
| Error Plugin not found for name [C:\Documents] and version [and]

Resources