-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WARNING, Unable to connect to 'https://myurl/myserver'. Cloud code and push notifications may be unavailable! #4506
Comments
I have this issue too.
|
What’s the value of the json variable?
…On Jan 17, 2018, 10:20 -0500, Biromain ***@***.***>, wrote:
I have this issue too.
Seem come from src/ParseServer.js#L267.
My localhost/health and <reverseProxyUrl>/health responses are httpCode: 200 and body {"status":"ok"}
• No PM2 just a webpack build
• Docker container
• Traefik reverse proxy container
Edit After few tests, error = null and enter in if to warning in console.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
After try/catch : When i run same test externaly of parse-server (gulp file for imports & tests), test seems ok oO Edit Parse.Cloud.job("health_check", function(request, status) {
if(Parse.serverURL) {
const request = require('request');
request(Parse.serverURL.replace(/\/$/, "") + "/health", function (error, response, body) {
let json;
try {
json = JSON.parse(body);
} catch(e) {
json = null;
}
if (error || response.statusCode !== 200 || !json || json && json.status !== 'ok') {
status.error(`👎 error: ${error}, statusCode: ${response.statusCode}, body: ${body}`);
} else {
status.success("👍");
}
});
}else {
status.error("👎 No Parse server URL found");
}
}); |
Thanks, I also confirm that https://my.url/myserver/health return a json So it look like a false positive but still weird... |
As long as /health check is good and orchestrator dont kill process, it's good for me. But still weird. |
perhaps the |
I don't know if it's a consequence but I can't connect to the parse server form nodejs. It works fine with CURL or with the dashboard API Console... Any idea?
|
Your dashboard/script is on same domain? |
I find my error... It was a wrong ssl setup. I forgot to make a bundle certificate... Everything work perfectly now. Sorry for the wasting time |
@notlies, this warning was actually very helpful indeed :) do you want to add a line to the parse server guide in the docs repo about this particular behavior? This may help other users |
No problem to add a line in the parse server guide, but it was just a bad ssl configuration. I simply forgot this step below and directly use your_domain_name.crt instead of the bundle.crt. Concatenate the primary and intermediate certificates This cause the server to run perfectly without visuals error (Chrome validate the certificate and dashboard was perfectly running like CURL commands) But I understand the error when we tried to relaunch my nodejs script... |
Perhaps the line could read just that, in the tune of that this warning may be emitted when https is incorrectly configured. |
I faced this issue and this might help someone in the future. Note that this is one of the reasons why this warning might be thrown. This is for parse server version: 2.8.2 To create your own standalone parse server, using express, the basic steps involved are close to:
As soon as the mount is called, the parse-server will verify the url mentioned in the config by making a request to /health endpoint. If for some reason there is a delay in listening to the port (point 6) after mounting the API (point 4), then the above warning will be thrown. For example, in one case I was establishing a mongoose connection and only then started listening to the port. Because of this, the verification of URL from parse server failed, although everything worked fine after that. And one of the possible solutions is to get done with all such work before mounting the Parse API and ensuring no delay between mounting and listening to the port as described above. While this may not be the exact steps for everyone the idea is that: parse server will call verify URL on the server URL mentioned in the configs. And if there is a delay in starting the server after you have mounted the parse Apis, the above warning will be thrown. Hope it helps. |
Well when this happens, spend whole day and night debugging it. Cry for sometime thinking you are failure and finally give up and go to sleep. Next day reboot the system it will work properly . |
My parse-server/src/ParseServer.js Line 267 in 7223add
response :
{ Error: unable to verify the first certificate
at TLSSocket.onConnectSecure (_tls_wrap.js:1049:34)
at TLSSocket.emit (events.js:182:13)
at TLSSocket.EventEmitter.emit (domain.js:442:20)
at TLSSocket._finishInit (_tls_wrap.js:631:8) code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' } Of course this is happening because I'm trying to serve localhost data with a self-signed certificate. Any help on solving this would be so greatly appreciated! |
Ok. I got the error message to go away, but I'm not really sure if this is the most advisable way. Seeing as this only applies to development I don't think it carries any risk, but it's worth mentioning that setting In my case I was trying to use a self-signed certificate on localhost to serve the parse-server based app over HTTPS, so this is what I ended up with: let parseServer;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
var certs = {
key: fs.readFileSync('./ssl/localhost.key'),
cert: fs.readFileSync('./ssl/localhost.crt'),
}
parseServer = require('https').createServer(certs, app)
} else {
parseServer = require('http').createServer(app)
} Also, be sure to include app.use after the readFileSync calls above to avoid any delay between mounting and listening per @daksh019 app.use(process.env.PARSE_SERVER_MOUNT, api)
app.use('/dashboard', dashboard);
app.use(require('./controllers'))
parseServer.listen(process.env.PORT) On production obviously the http->https is handled upstream by NGINX so providing certs to Express is unnecessary. Shoutout to this stackoverflow thread for the breakthrough. Go there to see more of the why/how. If there's a way to set |
Issue Description
When I launch my parse server I got a warning
WARNING, Unable to connect to 'https://my.url/myserver/'. Cloud code and push notifications may be unavailable!
But my server is running, I can see datas, edit and read them in my parse dashboard and console.log put in cloud code file works.
I don't use push notification so I can't test them...
A precision, I change the domain name recently and change from a self signed certificate (letsencrypt) to a commercial certificate.
But every configuration linked to the old domain has been deleted in nginx and in every files linked to parse (I think so...)
I launch my parse server with pm2 and ecosystem.json :
and server.js :
EDIT : I fix the issue by using http instead of https in the serverURL parameter and using localhost instead of the domain url, but I don't understand why, it was working before with https with my old domain name
serverURL: 'http://localhost:1337/parse/'
Steps to reproduce
launch the server task with PM2
Expected Results
No warning...
Actual Outcome
get a warning
Environment Setup
Server
Database
Logs/Trace
WARNING, Unable to connect to 'https://my.url/myserver/'. Cloud code and push notifications may be unavailable!
The text was updated successfully, but these errors were encountered: