Skip to content
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

Server crashes when editing routes.py #1

Open
testautomation opened this issue Nov 17, 2019 · 9 comments
Open

Server crashes when editing routes.py #1

testautomation opened this issue Nov 17, 2019 · 9 comments

Comments

@testautomation
Copy link

When I apply changes to routes.py the server crashes with the error below.
For example I added another route

@app.route('/foo')
def foo():
    return "FOO!"
...
'/home/wlad/projects/venv/lib/python3.7/site-packages/tornado/platform/asyncio.py':
 1546356710.0})
    Traceback (most recent call last):
      File "/home/wlad/projects/venv/lib/python3.7/site-packages/tornado/ioloop.py", line 907, in _run
        return self.callback()
      File "/home/wlad/projects/venv/lib/python3.7/site-packages/tornado/autoreload.py", line 188, in _re
load_on_update
        _check_file(modify_times, path)
      File "/home/wlad/projects/venv/lib/python3.7/site-packages/tornado/autoreload.py", line 203, in _ch
eck_file
        _reload()
      File "/home/wlad/projects/venv/lib/python3.7/site-packages/tornado/autoreload.py", line 210, in _re
load
        fn()

      File "/home/wlad/projects/venv/lib/python3.7/site-packages/livereload/server.py", line 315, in <lam
bda>
        add_reload_hook(lambda: IOLoop.instance().close(all_fds=True))
      File "/home/wlad/projects/venv/lib/python3.7/site-packages/tornado/platform/asyncio.py", line 89, i
n close
        self.asyncio_loop.close()
      File "/usr/lib/python3.7/asyncio/unix_events.py", line 55, in close
        super().close()
      File "/usr/lib/python3.7/asyncio/selector_events.py", line 83, in close
        raise RuntimeError("Cannot close a running event loop")
    RuntimeError: Cannot close a running event loop
[I 191117 23:12:58 handlers:95] Reload 1 waiters: /home/wlad/projects/flask-livereload/app/routes.py
[W 191117 23:12:58 iostream:975] Write error on <socket.socket [closed] fd=-1, family=AddressFamily.AF_IN
ET, type=SocketKind.SOCK_STREAM, proto=6>: [Errno 9] Bad file descriptor
Task exception was never retrieved
future: <Task finished coro=<WebSocketProtocol13.write_message.<locals>.wrapper() done, defined at /home/
wlad/projects/venv/lib/python3.7/site-packages/tornado/websocket.py:1102> exception=WebSocketClosedError(
)>
Traceback (most recent call last):
  File "/home/wlad/projects/venv/lib/python3.7/site-packages/tornado/websocket.py", line 1104, in wrapper
    await fut
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wlad/projects/venv/lib/python3.7/site-packages/tornado/websocket.py", line 1106, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
@frozenpandaman
Copy link

FYI, for anyone who may encounter this in the future, I was able to fix this by using livereload v2.5.1 instead of 2.6.3.

@SmartManoj
Copy link

Did you use tornado?

@frozenpandaman
Copy link

frozenpandaman commented Dec 11, 2020

LiveReload uses Tornado.

@SmartManoj
Copy link

SmartManoj commented Dec 11, 2020

@frozenpandaman asked @ghost as tornado is in the stacktrace

@SmartManoj
Copy link

SmartManoj commented Dec 11, 2020

@frozenpandaman v2.5.1 browser does not reload when there is a change in strings?
Edit: works if The HTML files are valid.

@frozenpandaman
Copy link

@SmartManoj ghost is GitHub's name for a deleted user. ;)

@alexzanderr
Copy link

with 2.5.1 the server its not raising errors anymore, but when writing some changes to a file, it doesnt reload the page automatically. (sometimes it does, most of the times it doesnt)

@alexzanderr
Copy link

my config is good and everything is fine.
on what conditions does livereload reloads the browser page?

@frozenpandaman
Copy link

FYI, for anyone who may encounter this in the future, I was able to fix this by using livereload v2.5.1 instead of 2.6.3.

Oh hey, thanks past me for helping me solve this again over two years later!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants