Setup OctoPrint on Windows Server


#1

Hello you all!

What is the problem?
After installing OctoPrint exactly like discribed here I cannot connect to the Webinterface. Also stopping OctoPrint with Ctrl-C only gets the program stuck so I have to kill the task and even killing it takes 10min.
When leaving the firefoxtab on my client with serverip:5000 open during Octoprintstartup, I once got a message like "Octoprint is still starting" followed by "Something went wrong, couldn't start, check octoprint.log", so the firewall probably is not the issue and my firewallexception works.

What did you already try to solve it?

  • deleting the Octoprint-folder including the one in the userfolder and installing again.
  • I checked if another program uses port 5000, nope (also tried on port 8080)
  • rebooting
  • reinstalling whole python installation
  • install octoprint to user-folder (so no folderpermission issue can occur)

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)
OctoPrint Version 1.3.6 running on Windows Server 2012R2 with Python 2.7.14

octoprint.log:

2018-04-05 14:21:30,420 - octoprint.startup - INFO - ******************************************************************************
2018-04-05 14:21:30,420 - octoprint.startup - INFO - Starting OctoPrint 1.3.6
2018-04-05 14:21:30,420 - octoprint.startup - INFO - ******************************************************************************
2018-04-05 14:21:30,497 - octoprint.plugin.core - INFO - Loading plugins from c:\octoprint\venv\lib\site-packages\octoprint\plugins, C:\Users\admin.SERVER\AppData\Roaming\OctoPrint\plugins and installed plugin packages...
2018-04-05 14:21:31,295 - octoprint.plugin.core - WARNING - Plugin "OctoPi Support Plugin" did not pass check
2018-04-05 14:21:31,420 - octoprint.plugins.discovery - INFO - pybonjour is not installed, Zeroconf Discovery won't be available
2018-04-05 14:21:31,420 - octoprint.plugin.core - INFO - Found 7 plugin(s) providing 7 mixin implementations, 4 hook handlers
2018-04-05 14:21:31,716 - octoprint.server - INFO - Intermediary server started
2018-04-05 14:21:31,716 - octoprint.plugin.core - INFO - Loading plugins from c:\octoprint\venv\lib\site-packages\octoprint\plugins, C:\Users\admin.SERVER\AppData\Roaming\OctoPrint\plugins and installed plugin packages...
2018-04-05 14:21:31,716 - octoprint.plugin.core - WARNING - Plugin "OctoPi Support Plugin" did not pass check
2018-04-05 14:21:31,779 - octoprint.plugin.core - INFO - Found 7 plugin(s) providing 7 mixin implementations, 4 hook handlers
2018-04-05 14:21:31,779 - octoprint.printer.profile - ERROR - Profile _default does not exist, creating _default again and setting it as default
2018-04-05 14:21:31,872 - octoprint.filemanager.storage - INFO - Initializing the file metadata for C:\Users\admin.SERVER\AppData\Roaming\OctoPrint\uploads...
2018-04-05 14:21:31,872 - octoprint.filemanager.storage - INFO - ... file metadata for C:\Users\admin.SERVER\AppData\Roaming\OctoPrint\uploads initialized successfully.
2018-04-05 14:21:33,200 - octoprint.util.pip - INFO - Using "c:\octoprint\venv\scripts\python.exe -m pip" as command to invoke pip
2018-04-05 14:21:34,263 - octoprint.util.pip - INFO - Version of pip is 9.0.3
2018-04-05 14:21:34,263 - octoprint.plugin.core - INFO - Initialized 7 plugin implementation(s)
2018-04-05 14:21:34,295 - octoprint.plugin.core - INFO - 7 plugin(s) registered with the system:
|  Announcement Plugin (bundled) = c:\octoprint\venv\lib\site-packages\octoprint\plugins\announcements
|  Core Wizard (bundled) = c:\octoprint\venv\lib\site-packages\octoprint\plugins\corewizard
|  CuraEngine (<= 15.04) (bundled) = c:\octoprint\venv\lib\site-packages\octoprint\plugins\cura
|  Discovery (bundled) = c:\octoprint\venv\lib\site-packages\octoprint\plugins\discovery
|  Plugin Manager (bundled) = c:\octoprint\venv\lib\site-packages\octoprint\plugins\pluginmanager
|  Software Update (bundled) = c:\octoprint\venv\lib\site-packages\octoprint\plugins\softwareupdate
|  Virtual Printer (bundled) = c:\octoprint\venv\lib\site-packages\octoprint\plugins\virtual_printer
2018-04-05 14:21:34,872 - octoprint.environment - INFO - Detected environment is Python 2.7.14 under Windows (win32). Details:
|  hardware:
|    cores: 4
|    freq: 3100.0
|    ram: 34279292928
|  os:
|    id: windows
|    platform: win32
|  python:
|    pip: 9.0.3
|    version: 2.7.14
|    virtualenv: c:\octoprint\venv
2018-04-05 14:21:34,872 - octoprint.server - INFO - Reset webasset folder C:\Users\admin.SERVER\AppData\Roaming\OctoPrint\generated\webassets...
2018-04-05 14:21:34,872 - octoprint.server - INFO - Reset webasset folder C:\Users\admin.SERVER\AppData\Roaming\OctoPrint\generated\.webassets-cache...
2018-04-05 14:21:34,920 - octoprint.server - INFO - Shutting down intermediary server...
2018-04-05 14:21:35,263 - octoprint.server - INFO - Intermediary server shut down
2018-04-05 14:21:35,263 - octoprint.events - INFO - Processing startup event, this is our first event
2018-04-05 14:21:35,263 - octoprint.events - INFO - Adding 0 events to queue that were held back before startup event
2018-04-05 14:21:35,263 - octoprint.filemanager - INFO - Adding backlog items from all storage types to analysis queue...
2018-04-05 14:21:35,279 - octoprint.filemanager - INFO - Added 0 items from storage type "local" to analysis queue
2018-04-05 14:21:35,279 - octoprint.plugins.cura - INFO - Path to CuraEngine has not been configured or does not exist (currently set to None), Cura will not be selectable for slicing
2018-04-05 14:21:35,295 - octoprint.server - INFO - Listening on http://0.0.0.0:5000
2018-04-05 14:21:35,295 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance on SERVER for SSDP

hope you can help me :confused:


#2

That looks actually completely fine. What happens when you try to open a browser on the server and navigate to http://127.0.0.1:5000? You only said something about serverip:5000 so far, so I'm assuming you've only tried to connect to it from a different machine, and considering that you are not able to connect I'd check if the easiest approach works first.

If it doesn't work, please share what you get instead, connection refused, some kind of error...


#3

Thanks for your reply!
since I only have Internet Explorer with very strict security settings on my server I normally just go to my client for testing, but I tried http :// localhost:5000 on the server without any luck. (have to put spaces into links, because I just registered here)

I just tried just leaving octoprint open after hitting Ctrl-C without killing the task waiting for an error, and indeed after 9 minutes I got the error "Could not fetch channel _important from https :// octoprint. org/feeds/imporant.xml [...]" and after some more time it shut down correctly.

I figured it might have to do with Internet-Explorers restrictions in Server OSes, since octoprint works fine when installed on my workstation. But an exception for *.octoprint. org in IE didn't help.

here's the log of that, maybe it helps with diagnosis:

[...]
2018-04-05 16:16:40,605 - octoprint.server - INFO - Listening on http :// 0.0.0.0:5000
2018-04-05 16:19:40,836 - octoprint.server - INFO - Shutting down...
2018-04-05 16:28:40,857 - octoprint.events - INFO - Processing shutdown event, this will be our last event
2018-04-05 16:28:40,857 - octoprint.plugins.announcements - ERROR - Could not fetch channel _important from https :// octoprint. org/feeds/important.xml: HTTPSConnectionPool(host='octoprint. org', port=443): Max retries exceeded with url: /feeds/important.xml (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:661)'),))
Traceback (most recent call last):
  File "c:\octoprint\venv\lib\site-packages\octoprint\plugins\announcements\__init__.py", line 355, in _get_channel_data_from_network
    r = requests.get(url, timeout=30)
  File "c:\octoprint\venv\lib\site-packages\requests\api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "c:\octoprint\venv\lib\site-packages\requests\api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "c:\octoprint\venv\lib\site-packages\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\octoprint\venv\lib\site-packages\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "c:\octoprint\venv\lib\site-packages\requests\adapters.py", line 506, in send
    raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='octoprint .org', port=443): Max retries exceeded with url: /feeds/important.xml (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:661)'),))
2018-04-05 16:28:40,857 - octoprint.plugins.pluginmanager - ERROR - Could not fetch plugins from repository at https ://plugins.octoprint .org/plugins.json: HTTPSConnectionPool(host='plugins.octoprint .org', port=443): Max retries exceeded with url: /plugins.json (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:661)'),))
Traceback (most recent call last):
  File "c:\octoprint\venv\lib\site-packages\octoprint\plugins\pluginmanager\__init__.py", line 738, in _fetch_repository_from_url
    r = requests.get(repository_url, timeout=30)
  File "c:\octoprint\venv\lib\site-packages\requests\api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "c:\octoprint\venv\lib\site-packages\requests\api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "c:\octoprint\venv\lib\site-packages\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\octoprint\venv\lib\site-packages\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "c:\octoprint\venv\lib\site-packages\requests\adapters.py", line 506, in send
    raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='plugins.octoprint. org', port=443): Max retries exceeded with url: /plugins.json (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:661)'),))
2018-04-05 16:28:40,872 - octoprint.events - INFO - Event loop shut down
2018-04-05 16:40:40,874 - octoprint.server - INFO - Goodbye!
2018-04-05 16:40:41,030 - octoprint.plugins.pluginmanager - INFO - Loaded plugin notices data from https ://plugins.octoprint .org/notices.json
2018-04-05 16:40:41,078 - octoprint.plugins.announcements - INFO - Loaded channel _releases from https :// octoprint. org/feeds/releases.xml in 0.24s
2018-04-05 16:40:41,326 - octoprint.plugins.announcements - INFO - Loaded channel _blog from https://octoprint.org/feeds/octoblog.xml in 0.19s
2018-04-05 16:40:41,515 - octoprint.plugins.announcements - INFO - Loaded channel _plugins from https://plugins.octoprint.org/feed.xml in 0.14s
2018-04-05 16:40:41,796 - octoprint.plugins.announcements - INFO - Loaded channel _octopi from https :// octoprint. org/feeds/octopi.xml in 0.19s
2018-04-05 16:40:43,217 - octoprint.util.pip - INFO - Using "c:\octoprint\venv\scripts\python.exe -m pip" as command to invoke pip
2018-04-05 16:40:45,921 - octoprint.util.pip - INFO - pip installs to c:\octoprint\venv\Lib\site-packages\, --user flag needed => no, virtual env => yes
2018-04-05 16:40:45,937 - octoprint.plugins.softwareupdate - INFO - Saved version cache to disk

#4

What does "without any luck" mean? Connection refused? Blank page? What happens?

All I can tell you from the logs is that it looks pretty much exactly like it looks when I fire up OctoPrint every single day on my development machine (which is running Windows) and it works fine there. So from an application log point of view, you are in the clear (as a side note, I'll have to check why it demands to wait for the announcement timeouts to shutdown, it shouldn't be doing that).

My next step would be checking netstat if the server is actually listening on port 5000. And if that is the case but you get a connection refused in your local IE, I'd take a look at firewall settings, maybe port 5000 is blocked after all.


#5

"without any luck" means IE just shows "the page cannot be displayed" (roughly translated from german), so not connection refused, just as if there is no response on http://localhost:5000

On the OctoPrint installation on my Workstation which I installed for testing purposes I get an entry in the server log as soon as i connect with a browser, which I don't get on the serverinstallation.

netstat shows amongst many other connections obviously:
TCP 0.0.0.0:5000 0.0.0.0:0 LISTENING
I'll double check the firewall then...

*edit: checked again, excepted python.exe and pythonw.exe from venv\Scripts as well, then wen't over to allow all traffic over port 5000 TCP and UDP and then even tried disabling the firewall completely. Still didn't work, so firewall is most likely not the issue.


#6

Sorry, no idea then. If you don't even get a hit in the server, the request never actually reads reaches the server, so something in between is blocking it. I have absolutely no experience with Windows Server 2012R2, so I don't know what else could be checked here.


#7

well, thats unfortunate :confused: I'll experiment on another Server 2012R2 VM (just for testing purposes since I can't pass the printer through to the VM) and report here if I get it to work. If not I'll get a RPi.

thanks for your help foosel!

*edit: works perfectly fine in the VM, so the issue is hidden somewhere else...


#8

I have some news now. I tried uninstalling and reinstalling VC for Python27 as well as clearing the venv and reinstalling octoprint (with the updated installation-routine, thanks for the pip command and getting rid of git by the way :stuck_out_tongue:) and now on the first startup two new lines showed up:

2018-04-09 22:07:04,621 - octoprint.server - INFO - Listening on http://0.0.0.0:5000
2018-04-09 22:07:05,107 - tornado.access - WARNING - 404 GET /intermediary.gif?=1523304423046 (127.0.0.1) 94.00ms
2018-04-09 22:07:05,168 - tornado.access - WARNING - 404 GET /intermediary.gif?
=1523304420530 (127.0.0.1) 0.00ms

I installed Firefox for testing purposes and had a tab opened with localhost:5000 during first startup, showing the "octoprint is still starting"-thingy and then not showing the final webinterface, stuck at "Reloading page..."

Does that somehow enclose the error?

*edit: also I noticed that the webassets folder as well as .webassets-cache in the AppData\Roaming-Folder are empty. Is that supposed to be like that?