SimulPiscator / AirSane

Publish SANE scanners to MacOS, Android, and Windows via Apple AirScan.
GNU General Public License v3.0
251 stars 26 forks source link

AirSANE - last error was 98: Address already in use #36

Closed technofox01 closed 4 years ago

technofox01 commented 4 years ago

To whom it may concern:

I have been getting this error message with AirSANE:

stable unique name: genesys:Canon LiDE 110:1 uuid: d8945d57-e60e-5593-9694-3343e3b55408 /etc/airsane/options.conf: regex 'genesys:.*' matches device name 'genesys:libusb:001:003' published as 'Canon LiDE 110 #2' server finished with error status -1, last error was 98: Address already in use

Can some please help with this?

I have tried Googling for a solution, but I cannot find any problem that is similar to the one I am having. I appreciate any help or guidance.

technofox01 commented 4 years ago

I am also getting this error message when attempting to scan using the web interface:

Error: Aborted: InvalidScanTicket

I performed the following command and got the following output: sudo lsof -i :8090 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME airsaned 448 saned 59u IPv4 13942 0t0 TCP localhost:8090 (LISTEN) airsaned 448 saned 87u IPv4 13943 0t0 TCP Scan-Server:8090 (LISTEN) airsaned 448 saned 91u IPv6 13944 0t0 TCP localhost:8090 (LISTEN) airsaned 448 saned 92u IPv6 13945 0t0 TCP [fe80::::4dbb]:8090 (LISTEN)

I had edited some of the info for privacy reasons.

Here is what I am getting this error message when examining the logs: sudo airsaned --debug=true --access-log=- reading device options from '/etc/airsane/options.conf' enumerating local devices... sane_init(nullptr, nullptr) sane_get_devices() ... ... sane_get_devices() -> SANE_Status Success sane_exit() server finished with error status -1, last error was 98: Address already in use

I hope this helps.

SimulPiscator commented 4 years ago

It seems you are trying to run two instances of AirSane in parallel. This is indicated by the fact that your scanner's mDNS name got a "#2", and that the listening address is already in use. If you want to experiment with AirSane settings, make sure to stop the running instance by running

sudo service airsaned stop
technofox01 commented 4 years ago

How do I make sure only one instance is running?

I really appreciate your help on this.

technofox01 commented 4 years ago

Ok so I stopped the instance, but now nothing shows up when I attempt to use the web interface.

SimulPiscator commented 4 years ago

Now you can run airsaned from the command line, as you intended.

technofox01 commented 4 years ago

Ok. I did that and have started the airsaned again. I used this command to and received the following output:

sudo lsof -i :8090 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME airsaned 1014 saned 59u IPv4 16513 0t0 TCP Pihole-Scan-Server:8090 (LISTEN) airsaned 1014 saned 87u IPv6 16514 0t0 TCP [fe80::2718:42a4:819d:4dbb]:8090 (LISTEN)

technofox01 commented 4 years ago

I get this error message now:

Error: Aborted: InvalidScanTicket

It's only listening to the same port under IPv4 and IPv6. There is only one instance of airsaned working based upon this command:

sudo ps -ef | grep airsaned saned 460 1 1 12:20 ? 00:00:01 /usr/local/bin/airsaned --interface=wlan0 --listen-port=8090 --access-log= --hotplug=true --mdns-announce=true --local-scanners-only=true --options-file=/etc/airsane/options.conf

I think we are getting close to a resolution. Is there something else that could be amiss?

SimulPiscator commented 4 years ago

I can scan from the web interface without error. Could it be that only specific settings in the web interface will trigger the error message?

technofox01 commented 4 years ago

I appreciate all of your help.

Here is what I am finding in /var/log/messages

warning: process `airsaned' used the deprecated sysctl system call with 8.1.2

technofox01 commented 4 years ago

I am running this on a Pi Zero using Raspbian Stretch to avoid the issues that Buster is having.

SimulPiscator commented 4 years ago

Do you get the "InvalidScanTicket" error always when you try to use the web interface, or only with certain web interface settings?

technofox01 commented 4 years ago

I have tried every iteration of trying to get it to work. I am using the Brave browser and made sure the shields are down. I am still getting this error message:

Error: Aborted: InvalidScanTicket

SimulPiscator commented 4 years ago

Can you give Firefox or Chrome a try?

technofox01 commented 4 years ago

Just tried Chrome, still the same error message. Could it be due to this deprecated system call per this log file error message?

warning: process `airsaned' used the deprecated sysctl system call with 8.1.2

SimulPiscator commented 4 years ago

That sysctl warning message is really strange because no current library code should be using that kernel function any more, and the function itself has been removed from the kernel in 2019. Unless you linked airsaned to a very ancient library on your system, the systctl warning should not appear at all, as airsaned itself is not calling this function.

technofox01 commented 4 years ago

Do you know what library that it could be calling?

I am running Raspbian Stretch - its based on Debian for Raspberry Pi computers.

SimulPiscator commented 4 years ago

Stretch should be ok. I'm running Buster now but used Stretch before without problems.

SimulPiscator commented 4 years ago

From what I read on the net, glibc and/or pthread would use sysctl.

technofox01 commented 4 years ago

I just did sudo apt-get update && sudo apt-get upgrade -y to ensure all of my libraries were up-to-date; apparently one wasn't. As soon as I reboot the Pi - boom works like a charm.

The only issue, and it's minor, is if I do a preview first and then attempt to scan and download right away; it will error out, but allow me to scan a few seconds later. I really appreciate your help, you do not know how happy my wife will be when she gets home and can scan using her iPhone. I am going to close the ticket and hopefully, all of our posts will help someone else in the future.