Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.11.0 does not see scanners any more (v2.1.1 does) #221

Closed
rmarkus opened this issue Apr 28, 2021 · 4 comments
Closed

V2.11.0 does not see scanners any more (v2.1.1 does) #221

rmarkus opened this issue Apr 28, 2021 · 4 comments

Comments

@rmarkus
Copy link

rmarkus commented Apr 28, 2021

Hi,

I use scanservjs since 7 months very happily and tried to update to v2.11. today. I use docker install inside a linux box with the USB scanner attached directly.
Sane is working fine, and the old version (v.2.1.1 ) is also working fine and very reliable.
I have pulled again the latest docker image

sudo docker image ls
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
sbs20/scanservjs    latest              123821983974        2 days ago          732MB
sbs20/scanservjs    <none>              549af2fd50ee        5 months ago        740MB

If I run the new one, it does not identify any scanners.

When I return to the old one, it works again.

any hints? I used this command to run the new image.
sudo docker run -d -p 8080:8080 -e SANE_USB_WORKAROUND=1 -v /var/run/dbus:/var/run/dbus --restart unless-stopped --device=/dev/bus/usb/001/002:/dev/bus/usb/001/002 --name scanservjs-container2 --privileged sbs20/scanservjs:latest

@sbs20
Copy link
Owner

sbs20 commented Apr 28, 2021

Hmm. Not too sure off the top of my head. It may be that it changed in this release: https://github.com/sbs20/scanservjs/releases/tag/v2.9.0 - there's now an unprivileged user inside docker.

I'd need to find the docker image from the release before to check, which I can't do right now as it was before there was automated docker tagging. I'll see if I can dig it out.

@rmarkus
Copy link
Author

rmarkus commented Apr 28, 2021

Hi, thanks for the feedback. In the meantime, I have found the thread #202. I have now run the docker with the SANED_NET_HOSTS variable. So appearantly scanimage within the docker seems to look for the scanner over network. That works.

sudo docker run -d -p 8080:8080 -e SANE_USB_WORKAROUND=1 -v /var/run/dbus:/var/run/dbus --restart unless-stopped -e SANED_NET_HOSTS="192.168.2.102" --name scanservjs-container2 --privileged sbs20/scanservjs:latest

So I re-read your message about the unpriv user .... and it nagged me to have the thing access over network on the same machine.

I applied a chmod /dev/bus/usb/001/002

b@c:~$ ls -l /dev/bus/usb/001/002
crw-rw-r-- 1 root lp 189, 1 Apr 28 22:01 /dev/bus/usb/001/002
b@c:~$ sudo chmod a+rw /dev/bus/usb/001/002
b@c:~$ ls -l /dev/bus/usb/001/002
crw-rw-rw- 1 root lp 189, 1 Apr 28 22:01 /dev/bus/usb/001/002

rmed the container, then restarted it with

sudo docker run -d -p 8080:8080 -e SANE_USB_WORKAROUND=1 -v /var/run/dbus:/var/run/dbus --restart unless-stopped --device=/dev/bus/usb/001/002:/dev/bus/usb/001/002 --name scanservjs-container2 --privileged sbs20/scanservjs:latest

and now it works also via USB.

Then - just to reproduce - I did a chmod 664 to /dev/bus/usb/001/002 -- and scanservjs-container2 continues to work. restarted the container - continues to work. ok, after a chmod o-w and restart of the container it does not find the usb scanner any more. then chmod a+w and restart - and it works again. So it really is the access rights. On my system, the "lp" group has access, saned is in that group. So I googled the docker and the groups, which leads me to

sudo docker run -d -p 8080:8080 --group-add lp -e SANE_USB_WORKAROUND=1 -v /var/run/dbus:/var/run/dbus --restart unless-stopped --device=/dev/bus/usb/001/002:/dev/bus/usb/001/002 --name scanservjs-container2 --privileged sbs20/scanservjs:latest

and now it seems that it finally works all as expected.

Sorry for the long post, maybe it helps other people with the same issue.

Looking forward to a long use of this version ;-)

@rmarkus rmarkus closed this as completed Apr 28, 2021
@sbs20
Copy link
Owner

sbs20 commented Apr 28, 2021

Oh you're brilliant! This is really useful information. Thank you so much for sharing. I'll make sure to update the docs.

@sbs20
Copy link
Owner

sbs20 commented Apr 29, 2021

I wonder if you added user 2001 on the host group lp if it would also work. If you need to create the user then useradd -u 2001 -ms /bin/bash scanservjs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants