Saned port shows good but not connecting over network
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Saned port shows good but not connecting over network
Greetings. If this question is not in the appropriate location, please move it. Thanks.
I recently upgraded my file server to a current Mageia version. In doing so, I have lost some things despite restoring good backups. One of the things I'm missing is my network scanner. The scanner (details below) is connected to the server via USB and has been working just fine for years. It still works on the server locally, but I can no longer get my Mageia 7 desktop to connect to it. Again, it all worked just fine prior to the upgrade. I see this as network trouble rather than an issue with saned specifically. I may be wrong.
Here are some details.
Linux shuttle 5.4.2-desktop-1.mga7 #1 SMP Thu Dec 5 17:40:00 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
(from "scanimage -L" on the server) device `genesys:libusb:002:002' is a Canon LiDE 110 flatbed scanner
scanimage (sane-backends) 1.0.27; backend version 1.0.28
Scanner works locally on server (192.168.1.105), but does not work from a desktop on the LAN (192.168.1.106). I am unable to connect to port 6566 on the server via telnet. Connection closes immediately:
# telnet shuttle 6566
Trying 192.168.1.105...
Connected to shuttle.
Escape character is '^]'.
Connection closed by foreign host.
scanimage -L on the desktop fails to see the scanner
saned is running:
# systemctl status saned.socket
● saned.socket - saned incoming socket
Loaded: loaded (/etc/systemd/system/saned.socket; enabled; vendor preset: disabled)
Active: active (listening) since Sun 2019-12-15 20:41:33 MST; 13h ago
Listen: [::]:6566 (Stream)
Accepted: 36; Connected: 0;
Memory: 128.0K
CGroup: /system.slice/saned.socket
Dec 15 20:41:33 shuttle systemd[1]: Listening on saned incoming socket.
saned.socket shows open and listening per other tools as well:
nmap -sV shuttle -p 6566
Starting Nmap 7.70 ( https://nmap.org ) at 2019-12-16 10:34 MST
Nmap scan report for shuttle (192.168.1.105)
Host is up (0.00015s latency).
PORT STATE SERVICE VERSION
6566/tcp open tcpwrapped
Are you saying sane is looking for the scanner on 192.168.1.106 but it's living on 192.168.1.105? Can't you fix that on the network, or on /etc/sane.d/saned.conf?
Shut down the systemd socket and run saned -d (debug mode; saned listens on 6566 rather than getting started by systemd). Try connecting.
Trace packets on port 6566 on both client and server and try to make sense of the result. Wireshark is most comfortable, or use tcpdump, e.g.
Code:
tcpdump port 6566
Third: Your telnet test indicates that server's systemd accepts the connection request. It should then start saned and hand the connection over to it, which fails. Is that logged somewhere? Perhaps journalctl -u saned.socket, but I am not certain.
Are you saying sane is looking for the scanner on 192.168.1.106 but it's living on 192.168.1.105? Can't you fix that on the network, or on /etc/sane.d/saned.conf?
No, that's not what I'm saying at all. 192.168.1.105 is the host. All is well there.
192.168.1.106 is my desktop. The desktop can't see the sane port.
Shut down the systemd socket and run saned -d (debug mode; saned listens on 6566 rather than getting started by systemd). Try connecting.
Trace packets on port 6566 on both client and server and try to make sense of the result. Wireshark is most comfortable, or use tcpdump, e.g.
Code:
tcpdump port 6566
Third: Your telnet test indicates that server's systemd accepts the connection request. It should then start saned and hand the connection over to it, which fails. Is that logged somewhere? Perhaps journalctl -u saned.socket, but I am not certain.
Okay, I shut down the socket:
Code:
# systemctl status saned.socket
● saned.socket - saned incoming socket
Loaded: loaded (/etc/systemd/system/saned.socket; enabled; vendor preset: disabled)
Active: inactive (dead) since Mon 2019-12-16 15:42:21 MST; 2s ago
Listen: [::]:6566 (Stream)
Accepted: 71; Connected: 0;
Dec 16 12:23:22 shuttle systemd[1]: Closed saned incoming socket.
Dec 16 12:23:22 shuttle systemd[1]: Stopping saned incoming socket.
Dec 16 12:23:22 shuttle systemd[1]: Listening on saned incoming socket.
Dec 16 15:42:21 shuttle systemd[1]: saned.socket: Succeeded.
Dec 16 15:42:21 shuttle systemd[1]: Closed saned incoming socket.
Attempted to start saned in debug mode and failed:
Not sure what that's about. If you know anything, please do tell.
Restarted saned.socket.
Here is the tail from journalctl
Quote:
Dec 16 15:47:41 shuttle systemd[1]: Listening on saned incoming socket.
-- Subject: A start job for unit saned.socket has finished successfully
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailma.../systemd-devel
--
-- A start job for unit saned.socket has finished successfully.
Here is the tail from journalctl after I tried to telnet into port 6566 on the server:
Code:
Dec 16 15:49:00 shuttle saned[24912]: /usr/sbin/saned: symbol lookup error: /usr/sbin/saned: undefined symbol: sanei_w_init
Dec 16 15:49:00 shuttle systemd[1]: saned@71-192.168.1.105:6566-192.168.1.106:36174.service: Main process exited, code=exited, status=127/n/a
Dec 16 15:49:00 shuttle systemd[1]: saned@71-192.168.1.105:6566-192.168.1.106:36174.service: Failed with result 'exit-code'.
I really don't know what to make of the sanei_w_init issue.
Uninstalling and reinstalling and editing config files doesn't fix it and there's nothing determinative on the internet. Again, I'd be interested in hearing anything anyone else knows about it.
...
I really don't know what to make of the sanei_w_init issue.
Uninstalling and reinstalling and editing config files doesn't fix it and there's nothing determinative on the internet. Again, I'd be interested in hearing anything anyone else knows about it.
Well, you found the reason why you can connect to the socket (no network problems), but the connection is closed immediately. systemd fails launching saned.
saned doesn't run because of some version mismatch on your system, no doubt introduced by the recent update. It expects a library to define a symbol (probably a function) named sanei_w_init. This symbol is not defined. According to this question on the ask.ubuntu site, this could be related to having sane (the client) installed on the server.
Even if you need the sane client on the server, I would try to get rid of it for the sake of testing. In the long run, you need to ensure that all sane-related libraries on 192.168.1.105 are compatible. I don't have a magic recipe for that unfortunately, and I know very little about sane in the first place. But this is the direction you need to take.
made a pass at sniffing packets with Wireshark. I don't really know what to make of all this, but I see packets moving between a port on the desktop and port 6566 on the server. I'm not good at pcap analysis or anything else in this realm, but here is an excerpt from a capture taken while I was opening Xsane on the desktop and it was failing to find the scanner on the server:
Code:
No. Time Source Destination Protocol Length Info
854 14.291901815 192.168.1.106 192.168.1.105 TCP 74 37484 → 6566 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=3148581135 TSecr=0 WS=128
Frame 854: 74 bytes on wire (592 bits), 74 bytes captured (592 bits)
Ethernet II, Src: 40:16:7e:22:a1:ca, Dst: 00:19:d1:71:dd:e7
Internet Protocol Version 4, Src: 192.168.1.106, Dst: 192.168.1.105
Transmission Control Protocol, Src Port: 37484, Dst Port: 6566, Seq: 0, Len: 0
No. Time Source Destination Protocol Length Info
855 14.292019270 192.168.1.105 192.168.1.106 TCP 74 6566 → 37484 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM=1 TSval=1310428134 TSecr=3148581135 WS=128
Frame 855: 74 bytes on wire (592 bits), 74 bytes captured (592 bits)
Ethernet II, Src: 00:19:d1:71:dd:e7, Dst: 40:16:7e:22:a1:ca
Internet Protocol Version 4, Src: 192.168.1.105, Dst: 192.168.1.106
Transmission Control Protocol, Src Port: 6566, Dst Port: 37484, Seq: 0, Ack: 1, Len: 0
No. Time Source Destination Protocol Length Info
856 14.292031015 192.168.1.106 192.168.1.105 TCP 66 37484 → 6566 [ACK] Seq=1 Ack=1 Win=64256 Len=0 TSval=3148581135 TSecr=1310428134
Frame 856: 66 bytes on wire (528 bits), 66 bytes captured (528 bits)
Ethernet II, Src: 40:16:7e:22:a1:ca, Dst: 00:19:d1:71:dd:e7
Internet Protocol Version 4, Src: 192.168.1.106, Dst: 192.168.1.105
Transmission Control Protocol, Src Port: 37484, Dst Port: 6566, Seq: 1, Ack: 1, Len: 0
No. Time Source Destination Protocol Length Info
857 14.292089210 192.168.1.106 192.168.1.105 TCP 85 37484 → 6566 [PSH, ACK] Seq=1 Ack=1 Win=64256 Len=19 TSval=3148581135 TSecr=1310428134
Frame 857: 85 bytes on wire (680 bits), 85 bytes captured (680 bits)
Ethernet II, Src: 40:16:7e:22:a1:ca, Dst: 00:19:d1:71:dd:e7
Internet Protocol Version 4, Src: 192.168.1.106, Dst: 192.168.1.105
Transmission Control Protocol, Src Port: 37484, Dst Port: 6566, Seq: 1, Ack: 1, Len: 19
Data (19 bytes)
0000 00 00 00 00 01 00 00 03 00 00 00 07 6d 61 64 61 ............mada
0010 6d 73 00 ms.
No. Time Source Destination Protocol Length Info
858 14.292154830 192.168.1.105 192.168.1.106 TCP 66 6566 → 37484 [ACK] Seq=1 Ack=20 Win=65152 Len=0 TSval=1310428134 TSecr=3148581135
Frame 858: 66 bytes on wire (528 bits), 66 bytes captured (528 bits)
Ethernet II, Src: 00:19:d1:71:dd:e7, Dst: 40:16:7e:22:a1:ca
Internet Protocol Version 4, Src: 192.168.1.105, Dst: 192.168.1.106
Transmission Control Protocol, Src Port: 6566, Dst Port: 37484, Seq: 1, Ack: 20, Len: 0
No. Time Source Destination Protocol Length Info
859 14.305389777 192.168.1.105 192.168.1.106 TCP 66 6566 → 37484 [RST, ACK] Seq=1 Ack=20 Win=65152 Len=0 TSval=1310428147 TSecr=3148581135
Frame 859: 66 bytes on wire (528 bits), 66 bytes captured (528 bits)
Ethernet II, Src: 00:19:d1:71:dd:e7, Dst: 40:16:7e:22:a1:ca
Internet Protocol Version 4, Src: 192.168.1.105, Dst: 192.168.1.106
Transmission Control Protocol, Src Port: 6566, Dst Port: 37484, Seq: 1, Ack: 20, Len: 0
No. Time Source Destination Protocol Length Info
860 14.305506307 192.168.1.106 192.168.1.105 TCP 74 37486 → 6566 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=3148581149 TSecr=0 WS=128
Frame 860: 74 bytes on wire (592 bits), 74 bytes captured (592 bits)
Ethernet II, Src: 40:16:7e:22:a1:ca, Dst: 00:19:d1:71:dd:e7
Internet Protocol Version 4, Src: 192.168.1.106, Dst: 192.168.1.105
Transmission Control Protocol, Src Port: 37486, Dst Port: 6566, Seq: 0, Len: 0
No. Time Source Destination Protocol Length Info
861 14.305642205 192.168.1.105 192.168.1.106 TCP 74 6566 → 37486 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM=1 TSval=1310428147 TSecr=3148581149 WS=128
Frame 861: 74 bytes on wire (592 bits), 74 bytes captured (592 bits)
Ethernet II, Src: 00:19:d1:71:dd:e7, Dst: 40:16:7e:22:a1:ca
Internet Protocol Version 4, Src: 192.168.1.105, Dst: 192.168.1.106
Transmission Control Protocol, Src Port: 6566, Dst Port: 37486, Seq: 0, Ack: 1, Len: 0
No. Time Source Destination Protocol Length Info
862 14.305657535 192.168.1.106 192.168.1.105 TCP 66 37486 → 6566 [ACK] Seq=1 Ack=1 Win=64256 Len=0 TSval=3148581149 TSecr=1310428147
Frame 862: 66 bytes on wire (528 bits), 66 bytes captured (528 bits)
Ethernet II, Src: 40:16:7e:22:a1:ca, Dst: 00:19:d1:71:dd:e7
Internet Protocol Version 4, Src: 192.168.1.106, Dst: 192.168.1.105
Transmission Control Protocol, Src Port: 37486, Dst Port: 6566, Seq: 1, Ack: 1, Len: 0
No. Time Source Destination Protocol Length Info
863 14.305754215 192.168.1.106 192.168.1.105 TCP 85 37486 → 6566 [PSH, ACK] Seq=1 Ack=1 Win=64256 Len=19 TSval=3148581149 TSecr=1310428147
Frame 863: 85 bytes on wire (680 bits), 85 bytes captured (680 bits)
Ethernet II, Src: 40:16:7e:22:a1:ca, Dst: 00:19:d1:71:dd:e7
Internet Protocol Version 4, Src: 192.168.1.106, Dst: 192.168.1.105
Transmission Control Protocol, Src Port: 37486, Dst Port: 6566, Seq: 1, Ack: 1, Len: 19
Data (19 bytes)
0000 00 00 00 00 01 00 00 03 00 00 00 07 6d 61 64 61 ............mada
0010 6d 73 00 ms.
No. Time Source Destination Protocol Length Info
864 14.305865650 192.168.1.105 192.168.1.106 TCP 66 6566 → 37486 [ACK] Seq=1 Ack=20 Win=65152 Len=0 TSval=1310428148 TSecr=3148581149
Frame 864: 66 bytes on wire (528 bits), 66 bytes captured (528 bits)
Ethernet II, Src: 00:19:d1:71:dd:e7, Dst: 40:16:7e:22:a1:ca
Internet Protocol Version 4, Src: 192.168.1.105, Dst: 192.168.1.106
Transmission Control Protocol, Src Port: 6566, Dst Port: 37486, Seq: 1, Ack: 20, Len: 0
No. Time Source Destination Protocol Length Info
867 14.316032407 192.168.1.105 192.168.1.106 TCP 66 6566 → 37486 [RST, ACK] Seq=1 Ack=20 Win=65152 Len=0 TSval=1310428158 TSecr=3148581149
Frame 867: 66 bytes on wire (528 bits), 66 bytes captured (528 bits)
Ethernet II, Src: 00:19:d1:71:dd:e7, Dst: 40:16:7e:22:a1:ca
Internet Protocol Version 4, Src: 192.168.1.105, Dst: 192.168.1.106
Transmission Control Protocol, Src Port: 6566, Dst Port: 37486, Seq: 1, Ack: 20, Len: 0
I saved another capture while running scanimage -L from the desktop. No idea what it means.
Even if you need the sane client on the server, I would try to get rid of it for the sake of testing. In the long run, you need to ensure that all sane-related libraries on 192.168.1.105 are compatible. I don't have a magic recipe for that unfortunately, and I know very little about sane in the first place. But this is the direction you need to take.
I restarted the saned.socket and ran scanimage -L on the desktop. Here is the excerpt from journalctl:
Code:
Dec 16 18:00:36 shuttle systemd[1]: Started Scanner Service (192.168.1.106:37670).
Dec 16 18:00:36 shuttle saned[26138]: /usr/sbin/saned: symbol lookup error: /usr/sbin/saned: undefined symbol: sanei_w_init
Dec 16 18:00:36 shuttle systemd[1]: saned@85-192.168.1.105:6566-192.168.1.106:37670.service: Main process exited, code=exited, status=127/n/a
Dec 16 18:00:36 shuttle systemd[1]: saned@85-192.168.1.105:6566-192.168.1.106:37670.service: Failed with result 'exit-code'.
Dec 16 18:00:36 shuttle systemd[1]: Started Scanner Service (192.168.1.106:37672).
Dec 16 18:00:36 shuttle saned[26141]: /usr/sbin/saned: symbol lookup error: /usr/sbin/saned: undefined symbol: sanei_w_init
Dec 16 18:00:36 shuttle systemd[1]: saned@86-192.168.1.105:6566-192.168.1.106:37672.service: Main process exited, code=exited, status=127/n/a
Dec 16 18:00:36 shuttle systemd[1]: saned@86-192.168.1.105:6566-192.168.1.106:37672.service: Failed with result 'exit-code'.
I see no difference.
And I've seen that info from the ubuntu questions site. I don't really think it applies. I would also add that I have installed all this code from the Mageia 7 64-bit repositories.
Have you tried deinstalling everything sane-related, and installing it again?
If this doesn't solve the problem of the missing symbol, perhaps the good people at the Mageia project didn't package the sane backend correctly. You may want to reach out to them.
Have you tried deinstalling everything sane-related, and installing it again?
If this doesn't solve the problem of the missing symbol, perhaps the good people at the Mageia project didn't package the sane backend correctly. You may want to reach out to them.
I have. Just tried it again. Didn't see any change.
I'll head over to the Mageia forums, but I'm disinclined to believe it will be worthwhile and there's always the possibility of a beatdown. At any rate, thanks for the help. I really do appreciate your time and attention. You have a happy holidays, whatever those holidays may be.
The missing symbol sanei_w_init is declared in a section of sane named sanei, which seems to be some internal API. My guess is that sanei is somehow missing on your computer, or the saned program doesn't know how to find the corresponding library. In the latter case, it could be a matter of correctly setting the LD_LIBRARY_PATH variable for saned.
Perhaps the above information helps you get the attention of Mageia.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.