pypxe/PyPXE

NBD error: [Errno 32] Broken pipe

hetii opened this issue · 1 comments

hetii commented

Hello,
I use such config:

{   "NETBOOT_DIR" : "/mnt/samsung/tftpboot/",
    "NETBOOT_FILE" : "pxe/pxelinux.0",
    "DHCP_SERVER_IP" : "192.168.0.10",
    "DHCP_SERVER_PORT" : 67,
    "DHCP_OFFER_BEGIN" : "192.168.0.20",
    "DHCP_OFFER_END" : "192.168.0.150",
    "DHCP_SUBNET" : "255.255.255.0",
    "DHCP_ROUTER" : "192.168.0.10",
    "DHCP_DNS" : "8.8.4.4",
    "DHCP_BROADCAST" : "<broadcast>",
    "DHCP_FILESERVER" : "192.168.0.10",
    "SYSLOG_SERVER" : null,
    "SYSLOG_PORT" : 514,
    "USE_IPXE" : false,
    "USE_HTTP" : true,
    "USE_TFTP" : true,
    "USE_DHCP" : true,
    "DHCP_MODE_PROXY" : false,
    "NBD_BLOCK_DEVICE" : "nbddrive",
    "NBD_WRITE" : false,
    "NBD_COW" : true,
    "NBD_COW_IN_MEM" : false,
    "NBD_COPY_TO_RAM" : false,
    "NBD_SERVER_IP" : "0.0.0.0",
    "NBD_SERVER_PORT" : 10809,
    "MODE_DEBUG" : ""   }

Then by dd I create a file in: /mnt/samsung/tftpboot/nbddrive
Next execute: ./pypxe-server.py --config=./example_cfg.json --debug all --dhcp

After that I edit /etc/nbd-client on client side to test if nbd works:

KILLALL="false"
NBD_DEVICE[0]=/dev/nbd1
NBD_TYPE[0]="r"
NBD_HOST[0]="192.168.0.10"
NBD_PORT[0]="10809"
NBD_NAME[0]="nbddrive"
NBD_EXTRA[0]=

Next I restart client:

sudo /etc/init.d/nbd-client restart
Stopping NBD client process: 
Disconnecting /dev/nbd1
rmmod: ERROR: Module nbd is in use
nbd-client.
Starting NBD client process: Connecting...Negotiation: ..size = 953MB
bs=1024, sz=999997440 bytes
connected /dev/nbd1
Activating...
/dev/nbd1: raw selected. doing nothing.
nbd-client.

but on server side I get:

2016-03-22 13:36:48,746 [DEBUG] PyPXE.NBD Received request for nbddrive from ('192.168.0.25', 58246)
2016-03-22 13:36:48,747 [DEBUG] PyPXE.NBD.FS Copy-On-Write for ('192.168.0.25', 58246) in PyPXE_NBD_COW_192.168.0.25_58246
2016-03-22 13:36:49,067 [DEBUG] PyPXE.NBD.FS ('192.168.0.25', 58246) reading 1024 bytes from 0x0. Pages: 1
2016-03-22 13:36:49,072 [DEBUG] PyPXE.NBD.FS ('192.168.0.25', 58246) reading 1024 bytes from 0x400. Pages: 1
Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
  File "/usr/lib/python2.7/threading.py", line 763, in run
  File "/mnt/samsung/app/pypxe/pypxe/nbd/nbd.py", line 129, in handle_client
error: [Errno 32] Broken pipe

It looks like the client is disconnecting (either intentionally or via network failure) while the server is trying to read a block. Do the same reproduction steps always end in the same stacktrace?

Unfortunately I don't have any time for support of this project, but I can see what I can do.

Another note, the NBD server, and the rest of this project is not really stable enough for general usage, the NDB especially has only been tested in a single environment, when booting via the linux kernel, rather than using a standard client.