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

Tutorials with OSBrain as backend don't run with PyCharm on Windows #284

Open
anupam-prasad opened this issue Apr 22, 2022 · 5 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@anupam-prasad
Copy link
Collaborator

Tutorials don't run on Windows. The issue seems to be the address http://0.0.0.0:3333. They work after changing the backend to Mesa.

Related output:

C:\Users\vedurm01\agentMET4FOF\venv\Scripts\python.exe C:/Users/vedurm01/agentMET4FOF/agentMET4FOF_tutorials/tutorial_2_math_agent.py
Error on connecting to existing name server at http://0.0.0.0:3333: Could not locate the name server!
Starting NameServer...
Broadcast server running on 0.0.0.0:9091
NS running on 0.0.0.0:3333 (0.0.0.0)
URI = PYRO:[email protected]:3333
Traceback (most recent call last):
  File "C:\Users\vedurm01\agentMET4FOF\venv\lib\site-packages\Pyro4\core.py", line 511, in connect_and_handshake
    sock = socketutil.createSocket(connect=connect_location,
  File "C:\Users\vedurm01\agentMET4FOF\venv\lib\site-packages\Pyro4\socketutil.py", line 307, in createSocket
    sock.connect(connect)
OSError: [WinError 10049] Die angeforderte Adresse ist in diesem Kontext ungültig

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\vedurm01\agentMET4FOF\venv\lib\site-packages\Pyro4\core.py", line 2009, in _locateNS
    proxy._pyroBind()
  File "C:\Users\vedurm01\agentMET4FOF\venv\lib\site-packages\Pyro4\core.py", line 408, in _pyroBind
    return self.__pyroCreateConnection(True)
  File "C:\Users\vedurm01\agentMET4FOF\venv\lib\site-packages\Pyro4\core.py", line 596, in __pyroCreateConnection
    connect_and_handshake(conn)
  File "C:\Users\vedurm01\agentMET4FOF\venv\lib\site-packages\Pyro4\core.py", line 549, in connect_and_handshake
    raise ce
Pyro4.errors.CommunicationError: cannot connect to ('0.0.0.0', 3333): [WinError 10049] Die angeforderte Adresse ist in diesem Kontext ungültig

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\vedurm01\agentMET4FOF\venv\lib\site-packages\osbrain\proxy.py", line 43, in locate_ns
    Pyro4.locateNS(host, port)
  File "C:\Users\vedurm01\agentMET4FOF\venv\lib\site-packages\Pyro4\core.py", line 2016, in _locateNS
    raise e
Pyro4.errors.NamingError: Failed to locate the nameserver

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/vedurm01/agentMET4FOF/agentMET4FOF_tutorials/tutorial_2_math_agent.py", line 72, in <module>
    main()
  File "C:/Users/vedurm01/agentMET4FOF/agentMET4FOF_tutorials/tutorial_2_math_agent.py", line 51, in main
    agentNetwork = AgentNetwork()
  File "C:\Users\vedurm01\agentMET4FOF\agentMET4FOF\network.py", line 595, in __init__
    self.start_server_osbrain(ip_addr, port)
  File "C:\Users\vedurm01\agentMET4FOF\agentMET4FOF\network.py", line 668, in start_server_osbrain
    self.ns = run_nameserver(addr=ip_addr + ":" + str(port))
  File "C:\Users\vedurm01\agentMET4FOF\venv\lib\site-packages\osbrain\nameserver.py", line 233, in run_nameserver
    return NSProxy(addr)
  File "C:\Users\vedurm01\agentMET4FOF\venv\lib\site-packages\osbrain\proxy.py", line 329, in __init__
    locate_ns(nsaddr, timeout)
  File "C:\Users\vedurm01\agentMET4FOF\venv\lib\site-packages\osbrain\proxy.py", line 49, in locate_ns
    raise TimeoutError('Could not locate the name server!')
TimeoutError: Could not locate the name server!
@anupam-prasad anupam-prasad changed the title Tutorials with OSBrain don't run with PyCharm on Windows Tutorials with OSBrain as backend don't run with PyCharm on Windows Apr 22, 2022
@BjoernLudwigPTB
Copy link
Member

BjoernLudwigPTB commented Apr 22, 2022

That might be related and in fact affected by a running local firewall in a very unforeseeable way. If there is one running on your machine, could you please try to disable it temporarily for running the tutorial and report back if that changes anything?

@BjoernLudwigPTB BjoernLudwigPTB added the bug Something isn't working label Apr 26, 2022
@BjoernLudwigPTB
Copy link
Member

After short investigation today, we found that neither deactivating the local firewall nor changing agentMet4FoF.network.add_agent()'s IP solved the issue. I will dig deeper and keep you updated.

@BjoernLudwigPTB
Copy link
Member

@bangxiangyong Say, I recall, that something like this already occured earlier, right? Do you remember something similar? Does it actually work for you?

@bangxiangyong
Copy link
Member

That's strange.. I could be wrong but I'm quite sure it worked on my Windows PC before, i could try running this version sometime this week

@bangxiangyong
Copy link
Member

I can confirm that with the latest version of agentMET4FOF, I face the same problem. Backtracking to the previous commit 6a9171d , however, i was able to run the tutorials fine.

So, something must have changed that broke it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants