thespianpy / Thespian

Python Actor concurrency library
MIT License
316 stars 63 forks source link

Unable to start multprocTCPBase on thespian shell #74

Open jemferraz opened 2 months ago

jemferraz commented 2 months ago

Hi, I've been trying to create an actor system in my windows 10 laptop, without success: I keep receiving the message thespian.actors.InvalidActorAddress: ActorAddr-(T|:1900) is not a valid ActorSystem admin, although this port is not being used by any program, as given by netstat -ano -p tcp:

C:\Users\josee>netstat -ano -p tcp

Active Connections

  Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       1616
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:2179           0.0.0.0:0              LISTENING       3324
  TCP    0.0.0.0:5040           0.0.0.0:0              LISTENING       7148

I then tried to start the the actor system in the thespian shell, to no avail:

Microsoft Windows [Version 10.0.19045.4894]
(c) Microsoft Corporation. All rights reserved.

C:\Users\josee>d:

D:\>cd D:\Dados\quant\research\actor_model

D:\Dados\quant\research\actor_model>python -m thespian.shell
Thespian Actor shell.  Type help or '?' to list commands.'

thespian> start multprocTCPBase
Starting multprocTCPBase ActorSystem
Capabilities: {}
***ERROR starting ActorSystem with specified Base: multprocTCPBase
Traceback (most recent call last):
  File "D:\ProgramData\Anaconda3\lib\site-packages\thespian\shell.py", line 122, in do_start
    self.system = ActorSystem(base, caps)
  File "D:\ProgramData\Anaconda3\lib\site-packages\thespian\actors.py", line 637, in __init__
    systemBase = self._startupActorSys(
  File "D:\ProgramData\Anaconda3\lib\site-packages\thespian\actors.py", line 673, in _startupActorSys
    module = importlib.import_module('thespian.system.' + systemBase)
  File "D:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'thespian.system.multprocTCPBase'
thespian>

I've already tried to turn off Mcafee firewall, as well as uninstall and re-install thespian, but without success.

Do you have any idea of what might be happening and what can I do? Thank you for your attention,

dpeschman commented 2 months ago

Howdy. Regarding the shell start, the base has an “i” in multi - multiprocTCPBase.

jemferraz commented 2 months ago

@dpeschman Thank you very much for your observation! That was a very stupid error...

However, I am still unable to create the actor system:

Microsoft Windows [Version 10.0.19045.4894]
(c) Microsoft Corporation. All rights reserved.

C:\Users\josee>d:

D:\>cd D:\Dados\quant\research\actor_model

D:\Dados\quant\research\actor_model>cd
D:\Dados\quant\research\actor_model

D:\Dados\quant\research\actor_model>python -m thespian.shell
Thespian Actor shell.  Type help or '?' to list commands.'

thespian> start multiprocTCPBase
Starting multiprocTCPBase ActorSystem
Capabilities: {}
***ERROR from Actor System: ActorAddr-(T|:1900) is not a valid ActorSystem admin
thespian>

Any idea?

kquick commented 1 month ago

This may be due to some Windows firewall or virus protection. You might check those settings, or try a different port (those above 16384 are commonly used for users).

On Tue, Sep 24, 2024, 14:43 jemferraz @.***> wrote:

@dpeschman https://github.com/dpeschman Thank you very much for your observation! That was a very stupid error...

However, I am still unable to create the actor system:

Microsoft Windows [Version 10.0.19045.4894] (c) Microsoft Corporation. All rights reserved.

C:\Users\josee>d:

D:>cd D:\Dados\quant\research\actor_model

D:\Dados\quant\research\actor_model>cd D:\Dados\quant\research\actor_model

D:\Dados\quant\research\actor_model>python -m thespian.shell Thespian Actor shell. Type help or '?' to list commands.'

thespian> start multiprocTCPBase Starting multiprocTCPBase ActorSystem Capabilities: {} ***ERROR from Actor System: ActorAddr-(T|:1900) is not a valid ActorSystem admin thespian>

Any idea?

— Reply to this email directly, view it on GitHub https://github.com/thespianpy/Thespian/issues/74#issuecomment-2371516098, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGAHXNRRYWBM3GURWO4PATZYF3B7AVCNFSM6AAAAABOYGQGM6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZRGUYTMMBZHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jemferraz commented 1 month ago

@kquick Thank you very much for your suggestions!

However, after turning off both the antivirus firewall (McAfee LiveSafe) and the Windows firewall & network protection (Domain, Private and Public networks), I was still unable to start the actor system. I've also tried to use different ports (1901 and 16385), and I've also added an inbound rule for ports 1901 to 1950 in the Windows Defender Firewall to allow Pyhon programs, but none of these actions worked out, and I kept on receiving the same type of error, namely:

ActorAddr-(T|:16385) is not a valid ActorSystem admin

Sorry to bother, but do you have any suggestion? Do you think that there might be a problem in the hardware (I am currently testing using a Dell Inspiron 7580 laptop, with Windows 10 Pro, but previously I have run the model in a different machine, a Dell desktop without any problem...)?

mistrey commented 1 month ago

This bug is a regression that was introduced after version 3.10.5. This version is still working for me with the multiprocTCPBase implementation under Windows. The newest version doesn't.

jemferraz commented 1 month ago

@mistrey Ah, got it... May have to revert back to the previous version then. Thanks for the insight!