Parse-server on DigitalOcean - Error 502 - parse-platform

I've followed this tutorial: https://www.digitalocean.com/community/tutorials/how-to-migrate-a-parse-app-to-parse-server-on-ubuntu-14-04
All fine, except that when it comes to sending a POST request to the Parse-server, I get an error 502. Here are both POST and GET requests which return a 502 when using https and a 301 when using HTTP:
curl -X POST \
-H "X-Parse-Application-Id: AppId" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sammy","cheatMode":false}' \
https://domain.name/parse/classes/GameScore
curl -H "X-Parse-Application-Id: APPID" http://domain.name/parse/classes/GameScore
I specially wanted to check if
mongod.conf
is fine (mine is the same as the one on the tutorial) and if
/etc/nginx/sites-enabled/default
is also fine.
Here is the log:
2016/03/07 22:11:30 [error] 7288#0: *7 connect() failed (111: Connection refused) while connecting to upstream, client: myComputerIP, server: domain.name, request: "GET /parse/classes/GameScore HTTP/1.1", upstream: "http://127.0.0.1:1337/classes/GameScore", host: "domain.name"
Any ideas? Thanks

I was running into the same problem, in my case was an error due to the change of the path of an internal dependency during the migration.
I was able to troubleshoot it using:
pm2 logs 0
Hope it helps.

There was a syntax error in my cloud code.

Looks like your node.js server isn't running (or not listening on port 1337) - make sure it's up by running and if not, start the parse-server.

Related

How to make curl works with proxy?

I'm trying get html page, but need proxy, for get access:
curl -x https://user:pass#ip:port https://google.com
curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
without proxy I get google.com, for example, but not with proxy.
Whats wrong?

How to run docker successfully?

I am trying to run the docker example here.
http://chembl.blogspot.com/2020/01/new-chembl-ligand-based-target.html
I can start the docker correctly.
docker run -p 8080:8080 chembl/mcp:25
But when I run this
curl -X POST -H 'Accept: */*' -H 'Content-Type: application/json' -d '{"smiles": "CC(=O)Oc1ccccc1C(=O)O"}' http://127.0.0.1:8080
I got these logging messages.
2020/03/26 13:21:38 Started logging stderr from function.
2020/03/26 13:21:39 Started logging stdout from function.
2020/03/26 13:21:39 OperationalMode: http
2020/03/26 13:21:39 Timeouts: read: 10s, write: 10s hard: 10s.
2020/03/26 13:21:39 Listening on port: 8080
2020/03/26 13:21:39 Writing lock-file to: /tmp/.lock
2020/03/26 13:21:39 Metrics listening on port: 8081
2020/03/26 13:24:53 Upstream HTTP request error: Post http://127.0.0.1:5000/: dial tcp 127.0.0.1:5000: connect: connection refused
I use Mac OS X.
Does anybody know how to fix the problem? Thanks.
I was able to run into the same problem and managed to fix it. All I had to do was increase the resources on Docker Desktop for Mac OS X (the RAM, to be more specific). And also, wait a minute or two as it seems that the module loading is quite resource-intensive.

Not able to start Kibana in local ubuntu : Service Unavailable :: {"path":"/_cluster/settings"

I have installed elastic 6.6 on Ubuntu and it is running fine on port 9200.
I also created a new data using my json file.
curl -H "Content-Type: application/json" -XPOST "http://localhost:9200/product/default/_bulk?pretty" --data-binary "#test-data.json"
But when I start kibana it throws an error.
error [06:27:47.587] [warning][process] Service Unavailable ::
{"path":"/_cluster/settings","query":{"include_defaults":true},"statusCode":503,"response":"503
Service Unavailable\nNo server is available to handle this
request.\n\n\n"}
at respond (/home/svaibhav/Downloads/kibana-6.6.0-linux-x86_64/node_modules/elasticsearch/src/lib/transport.js:308:15)
at checkRespForFailure (/home/svaibhav/Downloads/kibana-6.6.0-linux-x86_64/node_modules/elasticsearch/src/lib/transport.js:267:7)
at HttpConnector. (/home/svaibhav/Downloads/kibana-6.6.0-linux-x86_64/node_modules/elasticsearch/src/lib/connectors/http.js:165:7)
at IncomingMessage.wrapper (/home/svaibhav/Downloads/kibana-6.6.0-linux-x86_64/node_modules/elasticsearch/node_modules/lodash/lodash.js:4935:19)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1094:12)
at process._tickCallback (internal/process/next_tick.js:63:19) log [06:27:48.009] [warning][admin][elasticsearch] Unable to revive
connection: http://localhost:9200/ log [06:27:48.009]
[warning][admin][elasticsearch] No living connections
EDIT:
IT IS RESOLVED NOW. There were two services running on 9200 port.
one on TCP other on tcpV6. Elastic was up on tcpv6, but kibana was looking on tcp 9200 port.
I changed the port on elastic and it worked.

pushy apns does not get through AWS load balancer

Trying to run a mock apns service on AWS EC2.
Connection works well with curl and simple go program using apns2 library.
However when using pushy the query gets stopped at the loadbalancer with a HTTP 1/1 400 Bad Request. So is not getting through to the mock apsn service.
It looks like pushy is trying to negotiate to use http2, but it is also resolving the CNAME of the hostname to make that request. The hostname of the EC2 instance does not have an SSL certificate, and AWS do not allow EC2 instances to have their own certificate. SSL is done via the load balancer. Which is why I guess it gets the Bad Request error.
Is there some way to get pushy.apns to go straight to h2, without the negotiation. The apple APNS service works simply by replacing the hostname in the curl and go examples I'm using.
The log output of a pushy request looks like
https 2018-10-12T08:19:30.301789Z app/pushproxy/7ba468ea0d0278b2 86.172.XX.230:61136 - -1 -1 -1 400 - 0 288 "- https://pushproxy-XXXXXXX.eu-west-2.elb.amazonaws.com:443- -" "-" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 - "-" "-" "arn:aws:acm:eu-west-2:914858662894:certificate/XXXXXX-d957-4e9d-bda6-00c2f42a6e3a" - 2018-10-12T08:19:30.286000Z "-" "-"
And a curl request looks like
h2 2018-10-12T08:13:43.142341Z app/pushproxy/7ba468ea0d0278b2 86.172.XX.230:60860 172.31.27.35:443 0.000 0.002 0.000 200 200 239 78 "POST https://pushproxy.mycompany.com:443/3/device/a9001c6cbf953a9b2820f4da9c7f8d37e84338460304a2ce0a04a32e85ca2532 HTTP/2.0" "curl/7.61.1" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 arn:aws:elasticloadbalancing:eu-west-2:914858662894:targetgroup/pushProxy/252675c1a61756ea "Root=1-5bc057b7-a61a4ca4d5880b40f00d17c0" "pushproxy.mycompany.com" "arn:aws:acm:eu-west-2:914858662894:certificate/XXXXXXX-a34f-415b-b687-8789cf21197f" 0 2018-10-12T08:13:43.140000Z "forward" "-"
curl command
curl -v -d '{"aps":{"alert":"<message>","badge":42}}' \
-H "apns-id: 45454554646445454433433334332344" \
-H "apns-topic: com.2mee.Bridge2Mee" \
-H "apns-priority: 10" --http2 \
--cert pushcert.pem https://pushproxy.mycompany.com/3/device/a9001c6cbf953a9b2820f4da9c7f8d37e84338460304a2ce0a04a32e85ca2532

Curl error while trying to connect

I always used the curl command, now i have some problems with it.
I do curl --verbose https://testflightapp.com and its failed. the result is:
About to connect() to testflightapp.com port 80 (#0) Trying 110.173.143.147...Operation timed out
If I try manually on the browser its OK.
any solutions?
It seems curl is going to the wrong port: You're requesting a https URL, which, by default, is on port 443, and curl is going to 80.
Check if you have a curl version that supports HTTPS (has openssl/tls bindings).
Cheers,
Ricardo

Resources