sbs20 / scanservjs

SANE scanner nodejs web ui
https://sbs20.github.io/scanservjs/
GNU General Public License v2.0
766 stars 145 forks source link

hplip scanner not found #701

Open ThomasCr opened 1 year ago

ThomasCr commented 1 year ago

Describe the bug I use the docker image from docker-hub at sbs20/scanservjs:latest I have set up my scanner with

environment:
  - DEVICES="hpaio:/net/photosmart_prem_c410_series?ip=192.168.99.134&queue=false"

But it seams, that hpaio is not build in the image. Because a scanimage --device-name="hpaio:/net/photosmart_prem_c410_series?ip=192.168.99.134&queue=false" -A inside the container errors out: scanimage: open of device hpaio:/net/photosmart_prem_c410_series?ip=192.168.99.134&queue=false failed: Invalid argument

But after I installed the package libsane-hpaio is works. But not at the web gui... there I am getting a dbus error...

A echo hpaio >> /etc/sane.d/dll.conf like shown in your Dockerfile is not need, because it is already there after installing the package:

root@1b54a25693ed:/usr/lib/scanservjs# cat /etc/sane.d/dll.d/hplip 
# dll.conf snippet for hplip
#

hpaio

The dbus error I get is:

{"message":"Command failed: /usr/bin/scanimage -L\nCreated directory: /var/lib/snmp/cert_indexes\ndbus[1896]: arguments to dbus_connection_send() were incorrect, assertion \"connection != NULL\" failed in file ../../../dbus/dbus-connection.c line 3317.\nThis is normally a bug in some application using the D-Bus library.\n\n D-Bus not built with -rdynamic so unable to print a backtrace\nAborted (core dumped)\n","code":134}

Question on that point - is scanimage -L really needed, when I have set my DEVICE environment variable? It will newer find a scanner automatically, because of the routed docker network.

EDIT:

Ok, I could fix the DBUS error by mount the dbus run dir to the host

    volumes:
      - /var/run/dbus:/var/run/dbus

But the device is still not presented.. It seams, that DEVICES is not handet by current entrypoint.sh

At least I tested to create a config.local.js with the line (like mentioned in https://sbs20.github.io/scanservjs/docs/03-sane.html):

config.devices.push('hpaio:/net/photosmart_prem_c410_series?ip=192.168.99.134&queue=false');

but then I get this error:

+ node ./server/server.js
/etc/scanservjs/config.local.js:1
config.devices.push('hpaio:/net/photosmart_prem_c410_series?ip=192.168.99.134&queue=false');
^
ReferenceError: config is not defined
    at Object.<anonymous> (/etc/scanservjs/config.local.js:1:1)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32)
    at Module._load (node:internal/modules/cjs/loader:922:12)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at new UserOptions (/usr/lib/scanservjs/server/classes/user-options.js:9:22)
    at Application.userOptions (/usr/lib/scanservjs/server/application.js:29:27)
    at Application.config (/usr/lib/scanservjs/server/application.js:39:38)

EDIT2:

okay, got it working with

module.exports = {
  /**
   * @param {Configuration} config
   */
  afterConfig(config) {
        config.devices.push('hpaio:/net/photosmart_prem_c410_series?ip=192.168.99.134&queue=false');
  }
}

but after container restart the addition installed package is lost. Thats not a final solutions.....

Expected behavior make it possible to use hplip drivers with the docker-hub build.

ameer1234567890 commented 1 year ago

I have this exact problem. Installing libsane-hpaio and refreshing the device list resolves the issue. Please fix.

itechrene commented 11 months ago

I have this exact problem.

FoxxMD commented 6 months ago

@ThomasCr @ameer1234567890 @itechrene the PR I opened (#726) installs the driver and binary plugin automatically for you when using docker installation. Please check out the docker image I published and let me know if it works for you.