NetworkBlockDevice / nbd

Network Block Device
GNU General Public License v2.0
452 stars 119 forks source link

Negotiation: Error: INIT_PASSWD bad #54

Closed brauliobo closed 7 years ago

brauliobo commented 7 years ago

Server running on a router with LEDE and nbd-server 3.11

root@casa:~# nbd-server 192.168.21.1:9000 /dev/sdb

** (process:2534): WARNING **: Specifying an export on the command line is deprecated.        

** (process:2534): WARNING **: Please use a configuration file instead.                       
** Message: virtstyle ipliteral                
** Message: connect from 192.168.21.112, assigned file is /dev/sdb                            
** Message: Can't open authorization file /etc/nbd-server/allow (No such file or directory).  
** Message: Authorized client                  
** Message: Starting to serve                  
** Message: Size of exported file/device is 240057409536                                      
Error: Read failed: Connection reset by peer   
Exiting.                                  

Client running on Archlinux with nbd-client version 3.15.3

~/P/nbd ❯❯❯ sudo nbd-client 192.168.21.1 9000 /dev/nbd0                                                                                                             ⏎tags/nbd-3.11^0 ✭ ✚ ✱ ◼ 
Warning: the oldstyle protocol is no longer supported.                                        
This method now uses the newstyle protocol with a default export                              
Negotiation: Error: INIT_PASSWD bad            
Exiting.   

Error with version compiled from git tag nbd-3.11:

~/P/nbd ❯❯❯ sudo ./nbd-client -N ssd 192.168.21.1 9000 /dev/nbd0                                                                                                    ⏎tags/nbd-3.11^0 ✭ ✚ ✱ ◼ 
Negotiation: Error: Server closed connection   
Exiting.
brauliobo commented 7 years ago

If I add the client CIDR at /etc/nbd-server/allow I get the following error on the server (same error on the client):

root@casa:~# nbd-server 192.168.21.1:9000 /dev/sdb 

** (process:2755): WARNING **: Specifying an export on the command line is deprecated.        

** (process:2755): WARNING **: Please use a configuration file instead.                       
** Message: virtstyle ipliteral                
** Message: connect from 192.168.21.112, assigned file is /dev/sdb                            
** Message: Authorized client                  
** Message: Starting to serve                  
** Message: Size of exported file/device is 240057409536                                      
Error: Read failed: Address in use             
Exiting.                                       
** Message: Child exited with 1                
** Message: virtstyle ipliteral                
** Message: connect from 192.168.21.112, assigned file is /dev/sdb                            
** Message: Authorized client                  
** Message: Starting to serve                  
** Message: Size of exported file/device is 240057409536                                      
Error: Read failed: Connection reset by peer   
Exiting.                                       
** Message: Child exited with 1                
** Message: virtstyle ipliteral                
** Message: connect from 192.168.21.112, assigned file is /dev/sdb                            
** Message: Authorized client                  
** Message: Starting to serve                  
** Message: Size of exported file/device is 240057409536                                      
Error: Read failed: No child process           
Exiting.                              
yoe commented 7 years ago

In NBD 3.10, support for running the oldstyle negotiation protocol was removed, but some code paths (including the deprecated command line you try to run) still tried to use it. This was only fixed by 3.12.

In other words, you need to either upgrade your server or use a configuration file. The command line in 3.11 is broken and cannot be made to work.

brauliobo commented 7 years ago

thanks @yoe, will try the config file or cross compilation