How is Interface/Host defining posible.
Hi @coburnw, I know it may be some time since you did something on this Project, but I wanted to ask if and how it is Possible to define the Interface/Host Address the VXI server listens.
To make it more clear what I want, I have a system with multiple Interfaces/IP Addresses and want to say that the VRI-Server should listen on 10.42.42.10 but not on 10.42.42.8 I tried setting the host='' to host='10.42.42.10' but this only gave me raise RPCUnpackError('MSG_DENIED: AUTH_ERROR: %r' % (stat,))
So if there is a way to do this it would be a big help.
Thx.
Hi Tobias,
Of this library, the rpc code is for me the least understood...
- xdr is reaching eol in stock Python, see here: https://docs.python.org/3/library/xdrlib.html Please verify that you arnt bumping against that by using too new a version python.
- Who's log is reporting the auth_error, the client or server? As a curiosity, what client library are you using?
- if you leave the host entry empty at server initialization, can you access the server at its default address? Is the library functioning just not on the home ip you would like?
- rpcbind plays a big part in this part of the code. Look into the -h and the -i option of rpcbind.
If you can get the stock time-device examples to work (with an empty hostname) my sense is an rpcbind (portmapper) problem. The vxi11 server registers itself with the portmapper here: https://github.com/coburnw/python-vxi11-server/blob/9f53707dfd5bf553f64070320e7d0bb20b27c72a/vxi11_server/rpc.py#L734 I wonder if this is where things are falling down when you specify a hostname for the server?
Keep me posted. c.
Here is the full message Log:
Press Ctrl+C to exit
INFO:__main__:starting time_device
INFO:vxi11_server.instrument_server:abortServer started...
Traceback (most recent call last):
File "/home/tobias/Downloads/python-vxi11-server-master/demo_servers/time-device.py", line 79, in <module>
instr_server_inst1.listen()
File "/home/tobias/Downloads/python-vxi11-server-master/demo_servers/vxi11_server/instrument_server.py", line 596, in listen
self.coreServer.register()
File "/home/tobias/Downloads/python-vxi11-server-master/demo_servers/vxi11_server/rpc.py", line 722, in register
self.unregister()
File "/home/tobias/Downloads/python-vxi11-server-master/demo_servers/vxi11_server/rpc.py", line 746, in unregister
if not p.unset(self.mapping):
^^^^^^^^^^^^^^^^^^^^^
File "/home/tobias/Downloads/python-vxi11-server-master/demo_servers/vxi11_server/rpc.py", line 476, in unset
return self.make_call(PMAPPROC_UNSET, mapping, \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/tobias/Downloads/python-vxi11-server-master/demo_servers/vxi11_server/rpc.py", line 185, in make_call
self.do_call()
File "/home/tobias/Downloads/python-vxi11-server-master/demo_servers/vxi11_server/rpc.py", line 279, in do_call
xid, verf = u.unpack_replyheader()
^^^^^^^^^^^^^^^^^^^^^^
File "/home/tobias/Downloads/python-vxi11-server-master/demo_servers/vxi11_server/rpc.py", line 144, in unpack_replyheader
raise RPCUnpackError('MSG_DENIED: AUTH_ERROR: %r' % (stat,))
vxi11_server.rpc.RPCUnpackError: MSG_DENIED: AUTH_ERROR: 5
and I start it with python 3.11 /usr/bin/python3.11 /home/tobias/Downloads/python-vxi11-server-master/demo_servers/time-device.py
if you leave the host entry empty at server initialization, can you access the server at its default address? Is the library functioning just not on the home ip you would like?
Yes, if I use host='' than everything works fine like normal.
And thanks for now
If you can get the stock time-device examples to work (with an empty hostname) my sense is an rpcbind (portmapper) problem. The vxi11 server registers itself with the portmapper here:
python-vxi11-server/vxi11_server/rpc.py
Line 734 in 9f53707 def register_pmap(self): I wonder if this is where things are falling down when you specify a hostname for the server?
When I put a print("Server Address: " + str(self.server_address)) in there it doesnt even print it so I think the problem is somwhere earlyer.
It appears you are getting an auth error from rpcbind when the vxi11 library is testing its connection to the portmapper.
By default, rpcbind (the portmapper) requires that configuration settings be requested from a secure interface, ie the loopback interface. Im guessing that when you define a hostname, the library then uses that to interact with rpcbind, and you get the auth failure.
Im coming at this from a debian systemd perspective:
Start by running the command rpcinfo -p myserver.local on the client machine on the network of interest. If rpcbind isnt visible from the desired network, it will be impossible to access your vxi11 server, running properly or not.
If portmapper visibility was a problem and is now fixed, try your vxi11 server again with an empty hostname to see if routing can now route to the server.
If the portmapper is visible from the network of interest, an empty hostname isnt working, and you are still getting an auth error from the portmapper, investigated the '-i' switch of rpcbind. Dig into the man page for rpcbind or whatever rpc portmapper that your os provides to tell the portmapper to allow configuration from insecure interfaces. If you are on an open network, do your research and make the right decision.
Let me dig into the code side of this for a bit. It might be easy to use localhost for configuration and the requested hostname for operation. In any case, better error messages would be helpful.
Start by running the command rpcinfo -p myserver.local on the client machine on the network of interest. If rpcbind isnt visible from the desired network, it will be impossible to access your vxi11 server, running properly or not.
From the same system as I want to run the server I get:
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
from another System on the Network, I get:
10.42.42.10: RPC: Remote system error - Address already in use
Let me dig into the code side of this for a bit. It might be easy to use localhost for configuration and the requested hostname for operation. In any case, better error messages would be helpful.
Thanks
Is the 'other system on the network' the system with your planned vxi11 client? if so, there are no changes we can make to the server library that will fix the 'remote server error'. That is a problem with rpcbind configuration and you will have to sort that out.
- start your vxi11 server app on myserver.local with an empty hostname.
- on that server run
rpcinfo -p myserver.localand note the output. It should look something like:
cnv@desk:~ $ rpcinfo -p anabus.local
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
395183 1 tcp 41909
- run the same command on the target client system to the server system. You should see the same thing.
program 100000 is the portmapper service that rpcinfo connected to to get the list it presented to you. Program 395183 is the vxi11 service running on the server and in my case it can be found on tcp port 41909.
If the output on the client system is RPC: Remote system error as you say above, then you will have to put on your sysadmin hat and get the portmapper operational on a multihomed server. If program 395183 is missing then we need to do some work on getting the vxi11 server registered with the portmapper.
Let me know what you find.
Ah ok, I am just dumm, trying to run rpcinfo from a windows subsystem for linux does not work and brings me the addres alrey given, runing it from an other physikal Linux system(TrueNAS) as client it gives me:
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
admin@truenas[~]$
Do not ask why I did not do this from the beginning, I don't know my self
Also when runing the Server with host='' and then run the rpcinfo comand from a client I get an extra line:
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
395183 1 tcp 43597
I have run it down to p = TCPPortMapperClient(host) line 739 and 748 in rpc.py, when I set the host to '' one server starts and it can be found on on IP but as soon as I start a second server every server stops working.
While looking through the code, I saw that in RPCRequestHandler(rpc.py), one can get the laddr out of the address, which states on what local address the request came in.
And some small testing with a simple if statement that does not run socketserver.Base.... if it is not from the desired local address where positive. The only problem was that LXI-tools search did find the server if it was accepting 10.42.42.10 but not with 10.42.42.47, but I think that is either a routing, DNS or LXI-Tools problem since when setting the IP in txi-tools manual to 10.42.42.47 worked fine.
So my idea was that I just have one VXI/RPC server, but this server behaves differently depending on which laddr the request came in.