nxbt icon indicating copy to clipboard operation
nxbt copied to clipboard

Error with trying to run webapp (TimeoutError)

Open OrangeMan74 opened this issue 2 years ago • 1 comments

I'm trying to run the webapp and it spits out TypeError: cannot set 'is_timeout' attribute of immutable type 'TimeoutError'

 File "/usr/local/bin/nxbt", line 8, in <module>
   sys.exit(main())
 File "/usr/local/lib/python3.10/dist-packages/nxbt/cli.py", line 321, in main
   from .web import start_web_app
 File "/usr/local/lib/python3.10/dist-packages/nxbt/web/__init__.py", line 1, in <module>
   from .app import start_web_app
 File "/usr/local/lib/python3.10/dist-packages/nxbt/web/app.py", line 10, in <module>
   from flask_socketio import SocketIO, emit
 File "/usr/local/lib/python3.10/dist-packages/flask_socketio/__init__.py", line 9, in <module>
   from socketio import socketio_manage  # noqa: F401
 File "/usr/local/lib/python3.10/dist-packages/socketio/__init__.py", line 9, in <module>
   from .zmq_manager import ZmqManager
 File "/usr/local/lib/python3.10/dist-packages/socketio/zmq_manager.py", line 5, in <module>
   import eventlet.green.zmq as zmq
 File "/usr/local/lib/python3.10/dist-packages/eventlet/__init__.py", line 17, in <module>
   from eventlet import convenience
 File "/usr/local/lib/python3.10/dist-packages/eventlet/convenience.py", line 7, in <module>
   from eventlet.green import socket
 File "/usr/local/lib/python3.10/dist-packages/eventlet/green/socket.py", line 4, in <module>
   __import__('eventlet.green._socket_nodns')
 File "/usr/local/lib/python3.10/dist-packages/eventlet/green/_socket_nodns.py", line 11, in <module>
   from eventlet import greenio
 File "/usr/local/lib/python3.10/dist-packages/eventlet/greenio/__init__.py", line 3, in <module>
   from eventlet.greenio.base import *  # noqa
 File "/usr/local/lib/python3.10/dist-packages/eventlet/greenio/base.py", line 32, in <module>
   socket_timeout = eventlet.timeout.wrap_is_timeout(socket.timeout)
 File "/usr/local/lib/python3.10/dist-packages/eventlet/timeout.py", line 166, in wrap_is_timeout
   base.is_timeout = property(lambda _: True)
TypeError: cannot set 'is_timeout' attribute of immutable type 'TimeoutError'

I know this is similar to issue #75 but I installed the specific versions of things and got this. It also referenced #61 which referenced #67 , but I don't really know much and don't know how to use this pull request. Also, #85 seems like it would be valuable to me if I am able to get the web app running because I just want to use this for a macro.

If anyone could help me by telling me what to type into the terminal, I would appreciate it. I've gotten the remote_tui to work, but even the sample macro sudo nxbt macro -c "B 0.1s\n 0.1s" -r didn't do anything, unless I did it wrong but I don't think I did.

I would also accept a workaround of something that can emulate keypresses that could be used with the remote_tui, I have tried Actiona but it wouldn't emulate the keypresses in the terminal, but it worked with typing elsewhere.

Edit: Had a thought about using a .txt file for the macro (which I had tried and it didn't work for me) and I wanted to expand on my results with it.

$ sudo nxbt macro -c "./Documents/test3.txt"
Creating controller...
Waiting for connection...
Connected!
Running macro...
Controller crashed while running macro
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/nxbt/controller/server.py", line 106, in run
    self.mainloop(itr, ctrl)
  File "/usr/local/lib/python3.10/dist-packages/nxbt/controller/server.py", line 155, in mainloop
    self.input.set_protocol_input(state=self.state)
  File "/usr/local/lib/python3.10/dist-packages/nxbt/controller/input.py", line 202, in set_protocol_input
    self.macro_timer_length = float(timer_length)
ValueError: could not convert string to float: './Documents/test3.tx'

I don't know what is happening, the file is just

B 0.1s
1.0s
B 0.1s
1.0s

and so on for testing purposes.

I would be totally fine if I could make it work with a text file as long as I can make it loop a certain amount of times after some inputs that would be needed to setup in-game.

Edit 2: I tried again the next day, and I had been using "remote_tui" because regular "tui" threw an error the first time. I tried tui and it worked, and Actiona also works now, so I can write my macro in that and it'll work. I'll leave this up though because this is a wacky workaround.

OrangeMan74 avatar Dec 06 '22 03:12 OrangeMan74

TypeError: cannot set 'is_timeout' attribute of immutable type 'TimeoutError'

try: sudo pip install jinja2==3.0.3 itsdangerous==2.0.1 Werkzeug==2.0.2 eventlet==0.33.0 dnspython==2.2.1

YiZhiRikka avatar Dec 07 '22 07:12 YiZhiRikka