Re: Stockmarket tutorial help
Irmen de Jong <[email protected]> Thu, 27 Feb 2014 00:15:56 +0100
| Newsgroups | gmane.comp.python.pyro |
|---|---|
| Message-ID | <[email protected]> |
On 24-2-2014 22:11, Marcell Legeza wrote: > Hello! > > I would like to ask for help regarding the stockmarket tutorial. I have a clean ubuntu > installation in which i copy-pasted the code of the tutorial. I start the nameserver and > the stockmarket cannot connect to it. The full error is here: [...] > Pyro4.errors.NamingError: Failed to locate the nameserver > > I have tried it with ufw disabled and enabled with corresponding rules, and still no > change. The interesting part is that the warehouse example (with servesimple) works > exactly as it is descripted in the tutorial. (with nameserver turned on) > The stockmarket stucks at the line: locateNS(). > > Environment: Ubuntu 64 desktop in VMWare workstation > > I am really new to this, please help me! Hello Marcell, It would help a little bit more if you also provide the exact python and pyro versions that you are using, but I have an idea what could be wrong. Have you started the name server with the PYRO_SERIALIZERS_ACCEPTED setting modified to include pickle? See here: http://pythonhosted.org//Pyro4/tutorials.html#running-the-final-program This setting is not required for the warehouse example, but as explained in earlier paragraphs in the tutorial section, the stockmarket example needs this tweak. If you don't run the name server with this tweak as well, the stockmarket components cannot communicate with it because the name server won't respond to the wire protocol that is used. I suspect you're using python 2.x because when using python 3.x, the actual stacktrace being printed from the failed locateNS() call would contain a nested exception that would tell you in more detail why it failed. If my suspicion is correct, the stacktrace would have included something like the following when running on python 3.x: Pyro4.errors.ProtocolError: serializer 'serpent' is unknown or not available This is the actual error that occurs *in the name server* and is being re-raised on the client side. TL;DR: stop your nameserver, set the correct SERIALIZERS_ACCEPTED as per the instructions in the tutorial, restart the nameserver, and try again :-) (and use Python 3.x for even more profit in some circumstances) Regards Irmen de Jong ------------------------------------------------------------------------------ Flow-based real-time traffic analytics software. Cisco certified tool. Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer Customize your own dashboards, set traffic alerts and generate reports. Network behavioral analysis & security monitoring. All-in-one tool. http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk