-
Notifications
You must be signed in to change notification settings - Fork 148
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
AIRSCAN_DEVICES - sed: couldn't open temporary file Permission denied #352
Comments
I don't have an automated solution for the editing of the airscan.conf file, but I did find this:
So with just starting the dbus service it finds my Canon scanner. So current questions:
|
Hi. I'm sorry for the very slow reply. And thank you for sharing the problem and your investigations.
I was sure that I had tested the airscan change (hence the change of owner here) - however, it doesn't seem to work for you and I haven't tested recently enough to know if that's something specific to your setup or a wider issue. I will look into it.
Hmm - quite possibly. I only have the rather lame excuse that it works for me. Would you be prepared to try and build your own Docker container from the Dockerfile, check it fails, and then add a line to start the dbus service and check it works? |
Hi! No worries. I'm quite happy you taking the time to help me out. It's no problem to build a container from the Dockerfile. I won't have time for that for the next few hours, but I will get back to you on that. |
No hurry for me - real life keeps getting in the way of me doing this! |
I thought I could do this, but it seems I don't have enough experience with building from scratch. Could you tell me the best/easiest way to do this? I've done this in a separate (empty) directory:
All steps succeed, so I follow up by:
|
Not sure. Rather than use a hash, I usually just use the image name but I doubt that's it. My guess is that the container is throwing an error and docker is attempting to restart it. You could try removing Alternatively, instead of running the container, you can shell into the image and attempt to manually run stuff there to see where it goes wrong:
|
When I run that and so a So I mounted the config file which already has my scanner configured:
And then if I execute
So now I want to adjust the Dockerfile (I assume) to start the dbus service. But this needs to be done by root user. I don't believe a RUN command will do, and CMD command just gets attached to the entrypoint as an argument right? So how would I be able to run the |
That is a good question. I think you're right. The more I deal with Docker for this project, the more I come to the conclusion that the hardware integration part of it (i.e. interfacing with the scanner) should be on the host, not in the container. The container should not run as root, but it needs to to make this work. Are you able to make this work if you setup the airscan on the host and then connect to to it over the network from the container? |
I prefer to keep as much containerized as possible which allows me to quickly change setups and software, or recover from a backup, but I guess there are some limitations here.
When I first was aware of scanservjs I didn't quite get all the tools (saned, sane-airscan, ipp-usb, etc.), how they were supposed to work together, and what the minimum tools were to make it work for me. I still don't to be honest. So what I did at first was install all kinds of tools on my host which I thought were necessary according to different documentations. I figured some devices needed to be available or installed on the host, and passed through to the container. But at one point it dawned to me your docker image might already have all the tools needed. So I thought I'd get your container to work first and then uninstall all the tools I've unnecessarily installed on my host later. So before working with your container I was at one point trying to make my host see my scanner over the network. If I look at the current state of my host now with regards to my scanner:
Not sure how to continue from here. I'm way out of my league with this, but I'm always willing to challenge myself. By the way, if this becomes an issue out of scope for scanservjs, just let me know. |
I also got this error
Since the script probably runs in userland the issue is that /etc/sane.d/ is not writable for the script since it is owned by root, hence it can not add a line to the airscan.conf As a temporary fix I started the container with the root user ( |
That turns out to be my working trick as well. I'm running the container as root, which allows the |
Re opening because I want to keep track of a better long term solution. |
I'm hoping that the new staging image (yet to be promoted) requires no manual intervention for you.
|
I was running into the same permission issues on |
I'm trying to add my Canon Pixma TS5150 scanner. It is not connected by USB to my server running Ubuntu Server 20.04, so I'm connecting to sane-airscan. I know the string for my device should be:
So I've added this environmental variable to my docker run command:
But the logs keep returning:
When I run the container without this env variable, and bash into the container I could do some more investigation.
So the sed command cannot be executed as user
2001(scanservjs)
because it's trying to create a temporary file inside the/etc/sane.d
folder, which is owned byroot:root
.I've tried running the container as
root:root
, and this does write the correct string to airscan.conf. But when I try to do aairscan-discover -d
(with debugging) I get another error:MDNS: avahi_client_new failed: Access denied
.I've read the documentation over and over, but it's late, so I might've missed it. Hope someone has a solution.
The text was updated successfully, but these errors were encountered: