jaylagorio / Nightscout-on-Windows-Server

A walk-through showing Nightscout and all of its dependencies and services installed on Windows Server.
19 stars 25 forks source link

Using Internet Explorer http://localhost/ shows no connection #4

Closed Sven-needs-help closed 4 years ago

Sven-needs-help commented 4 years ago

Dear jaylagorio,

thank you for spending so much time to create the SW and instructions in order to be independent to Internet based solutions. The issue I encounter is similar to the once from "Alloho" back in Feb. 2019, which is closed. I followed your instructions and it works until step:"When you see the emitted clear_alarm to all clients line". However once "emitted clear_alarm to all clients" was showing up I tried "try to connect to it using Internet Explorer by going to http://localhost/." the browser screen shows: Connection failed after the timeout. I obtain the same result both the browsers Internet Explorer and Mozilla Firefox. I disabled the entire Firewall, but the output didn't change. I updated NPM thorugh NPM update command. But after update the error persists. I assume I oversaw any adjustment necessary to get it to work. I'd appreciate to get some useful advices or just let me know which logfile could help to figure out what the issue is. Please advice step by step what I should do since I'm neither much experienced w/ SW development nor configuration.

Regards Sven

jaylagorio commented 4 years ago

Hey, Sven,

Lots of follow up questions for you:

Let me know?

Sven-needs-help commented 4 years ago

Hey Jay, I suppose my message didn't come through I replied on May 25th. Thus I post a copy:

Hi Jay,

I intended to provide the information you asked for. However I had issues to start the server again. I assume I don't know how to shutdown the server correctly. Once the Windows is up and running, I saw the Mongo.exe was started as service via Task Manager. Thus I tried to start:

node server.js

the output reflects Port 443 is already in use. I tried w/ db.shutdownServer(), even w/ uninstall of Mongo DB, Python, Git and Node.js. After that I used EUSING to clean up the registry. Once the re-installation of Mongo DB was done according to your instructions, I tried to add the user

db.createUser({user: "username", pwd: "password", roles:["readWrite"]})

and got the response the user is already existing!? I don't know if the error investigation would lead to too high effort. Wouldn't the better approach be re-install the entire Machine?

At least I can answer this question: What version of Windows are you running on? Is this in a VM? As specified: Windows Server 2016 but German NLS. I never installed nor configured a VM ever in my live. Thus I don't know if Windows Server comes w/ a VM. I just followed your instruction exactly. There is a deviation of the version of Mongo DB compared to your instructions. I obtained and installed a version which is higher than yours. Is this important for investigation?

I'd appreciate any help or hints from you...

Regards Sven

jaylagorio commented 4 years ago

OK, I think I see the problem. IIS is probably already sitting on port 443, so in this section (https://github.com/jaylagorio/Nightscout-on-Windows-Server/#installation-and-configuration) change your PORT environment variable to 8443. Rebooting is the easiest way to pick that change up, so reboot and once you start Mongo and Nightscout again try accessing using http://localhost:8443/

If that works and you'd like to use IIS to serve your site on the standard port use this section with localhost:8443 in all of the places it asks for your Nightscout URL: https://github.com/jaylagorio/Nightscout-on-Windows-Server/#reverse-proxy-with-iis

Let me know if this worked.

Sven-needs-help commented 4 years ago

Hey Jay,

I finally found the time to incorporate your proposal. I didn't get far since the Node.js throw still the error:

WARNING: Node version v10.15.2 and Microsoft Azure are not recommended. WARNING: Please migrate to another hosting provider. Your Node version is outdated and insecure Parsing config URL from IMPORT_CONFIG failed Security settings: INSECURE_USE_HTTP= true , SECURE_HSTS_HEADER= true Listening on port 8443 null events.js:174 throw er; // Unhandled 'error' event ^

Error: listen EADDRINUSE: address already in use :::8443 at Server.setupListenHandle [as _listen2] (net.js:1277:14) at listenInCluster (net.js:1325:12) at Server.listen (net.js:1412:7) at booted (C:\Nightscout\server.js:50:30) at Object.boot (C:\Nightscout\node_modules\bootevent\index.js:46:9) at saw.next (C:\Nightscout\node_modules\chainsaw\index.js:62:18) at finishBoot (C:\Nightscout\lib\server\bootevent.js:271:14) at Object. (C:\Nightscout\node_modules\bootevent\index.js:12:7) at EventEmitter.saw.nest (C:\Nightscout\node_modules\chainsaw\index.js:86:12) at Object.acquire (C:\Nightscout\node_modules\bootevent\index.js:10:9) Emitted 'error' event at: at emitErrorNT (net.js:1304:8) at process._tickCallback (internal/process/next_tick.js:63:19) at Function.Module.runMain (internal/modules/cjs/loader.js:745:11) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)

I assume I did any kind of error due to my limited knowledge. I know it was working further before (as I mentioned above until the step of the local host). Node.js was running w/o issues and printed an output cyclicly. I suppose it's easier to reinstall the entire system and perform all steps again of your instruction. Or do you see another chance to solve the issue easily?

If so don't hurry as I'm anyway busy the next days and will come back to the issue earliest next week.

Regards Sven

jaylagorio commented 4 years ago

OK, unless you manually assigned another process to use that port nothing should be using it by default. Are you running Nightscout as Administrator or an account in the Administrators group?

Sven-needs-help commented 2 years ago

Dear Jay, I resumed the work to fix the issue. I set back all changes to the ones from your instructions. First the issues persisted. However, the issue was solved by deviating from your instructions in following way: http://localhost/ -> http://:443 Would you like to add the port information into your instructions for unexperienced persons like me?