# HP OfficeJet 5610 Cups & Samba not printing from windows

## Badmaster

Hi all,

I have setup my linux server to share the OfficeJet 5610 on Samba using CUPS.

The problem I am facing now is that I can print from the cmdline and the CUPS webinterface, but not from windows.

I get the following output in /var/log/cups/error_log:

```

D [29/Dec/2007:17:54:29 +0100] cupsdProcessIPPRequest: 9 status_code=406 (client-error-not-found)

D [29/Dec/2007:17:54:29 +0100] cupsdCloseClient: 9

D [29/Dec/2007:17:54:29 +0100] cupsdAcceptClient: 9 from localhost (Domain)

D [29/Dec/2007:17:54:29 +0100] cupsdReadClient: 9 POST / HTTP/1.1

D [29/Dec/2007:17:54:29 +0100] cupsdAuthorize: No authentication data provided.

D [29/Dec/2007:17:54:29 +0100] Get-Printer-Attributes ipp:///printers/printers

D [29/Dec/2007:17:54:29 +0100] Get-Printer-Attributes client-error-not-found: The printer or class was not found.

D [29/Dec/2007:17:54:29 +0100] cupsdProcessIPPRequest: 9 status_code=406 (client-error-not-found)

D [29/Dec/2007:17:54:29 +0100] cupsdCloseClient: 9

D [29/Dec/2007:17:54:29 +0100] cupsdAcceptClient: 9 from localhost (Domain)

D [29/Dec/2007:17:54:29 +0100] cupsdReadClient: 9 POST / HTTP/1.1

D [29/Dec/2007:17:54:29 +0100] cupsdAuthorize: No authentication data provided.

D [29/Dec/2007:17:54:29 +0100] Get-Jobs ipp://localhost/printers/OfficeJet_5610

D [29/Dec/2007:17:54:29 +0100] cupsdProcessIPPRequest: 9 status_code=0 (successful-ok)

D [29/Dec/2007:17:54:29 +0100] cupsdReadClient: 9 POST / HTTP/1.1

D [29/Dec/2007:17:54:29 +0100] cupsdAuthorize: No authentication data provided.

D [29/Dec/2007:17:54:29 +0100] Get-Printer-Attributes ipp://localhost/printers/OfficeJet_5610

D [29/Dec/2007:17:54:29 +0100] cupsdProcessIPPRequest: 9 status_code=0 (successful-ok)

D [29/Dec/2007:17:54:29 +0100] cupsdCloseClient: 9

D [29/Dec/2007:17:54:29 +0100] cupsdAcceptClient: 9 from localhost (Domain)

D [29/Dec/2007:17:54:29 +0100] cupsdReadClient: 9 POST / HTTP/1.1

D [29/Dec/2007:17:54:29 +0100] cupsdAuthorize: No authentication data provided.

D [29/Dec/2007:17:54:29 +0100] Get-Printer-Attributes ipp:///printers/printers

D [29/Dec/2007:17:54:29 +0100] Get-Printer-Attributes client-error-not-found: The printer or class was not found.

D [29/Dec/2007:17:54:29 +0100] cupsdProcessIPPRequest: 9 status_code=406 (client-error-not-found)

D [29/Dec/2007:17:54:29 +0100] cupsdCloseClient: 9

D [29/Dec/2007:17:54:29 +0100] cupsdAcceptClient: 9 from localhost (Domain)

D [29/Dec/2007:17:54:29 +0100] cupsdReadClient: 9 POST / HTTP/1.1

D [29/Dec/2007:17:54:29 +0100] cupsdAuthorize: No authentication data provided.

D [29/Dec/2007:17:54:29 +0100] Get-Printer-Attributes ipp:///printers/printers

D [29/Dec/2007:17:54:29 +0100] Get-Printer-Attributes client-error-not-found: The printer or class was not found.

D [29/Dec/2007:17:54:29 +0100] cupsdProcessIPPRequest: 9 status_code=406 (client-error-not-found)

D [29/Dec/2007:17:54:29 +0100] cupsdCloseClient: 9

D [29/Dec/2007:17:54:29 +0100] cupsdAcceptClient: 9 from localhost (Domain)

D [29/Dec/2007:17:54:29 +0100] cupsdReadClient: 9 POST /printers/OfficeJet_5610 HTTP/1.1

D [29/Dec/2007:17:54:29 +0100] cupsdAuthorize: No authentication data provided.

D [29/Dec/2007:17:54:29 +0100] Print-Job ipp://localhost/printers/OfficeJet_5610

D [29/Dec/2007:17:54:29 +0100] print_job: request file type is application/vnd.cups-raw.

D [29/Dec/2007:17:54:29 +0100] add_job: requesting-user-name="till"

D [29/Dec/2007:17:54:29 +0100] Adding default job-sheets values "none,none"...

I [29/Dec/2007:17:54:29 +0100] Adding start banner page "none" to job 23.

D [29/Dec/2007:17:54:29 +0100] Discarding unused job-created event...

I [29/Dec/2007:17:54:29 +0100] Adding end banner page "none" to job 23.

I [29/Dec/2007:17:54:29 +0100] Job 23 queued on "OfficeJet_5610" by "till".

D [29/Dec/2007:17:54:29 +0100] Job 23 hold_until = 0

D [29/Dec/2007:17:54:29 +0100] Discarding unused printer-state-changed event...

D [29/Dec/2007:17:54:29 +0100] job-sheets=none,none

D [29/Dec/2007:17:54:29 +0100] banner_page = 0

D [29/Dec/2007:17:54:29 +0100] [Job 23] argv[0]="OfficeJet_5610"

D [29/Dec/2007:17:54:29 +0100] [Job 23] argv[1]="23"

D [29/Dec/2007:17:54:29 +0100] [Job 23] argv[2]="till"

D [29/Dec/2007:17:54:29 +0100] [Job 23] argv[3]="smbprn.00000088 Test Page"

D [29/Dec/2007:17:54:29 +0100] [Job 23] argv[4]="1"

D [29/Dec/2007:17:54:29 +0100] [Job 23] argv[5]="job-uuid=urn:uuid:18e5647d-6cf3-3da5-4199-a25f3d7dc575"

D [29/Dec/2007:17:54:29 +0100] [Job 23] argv[6]="/var/spool/cups/d00023-001"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[0]="CUPS_CACHEDIR=/var/cache/cups"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[1]="CUPS_DATADIR=/usr/share/cups"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[2]="CUPS_DOCROOT=/usr/share/cups/html"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[4]="CUPS_REQUESTROOT=/var/spool/cups"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[5]="CUPS_SERVERBIN=/usr/libexec/cups"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[6]="CUPS_SERVERROOT=/etc/cups"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[7]="CUPS_STATEDIR=/var/run/cups"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[8]="PATH=/usr/libexec/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[9]="SERVER_ADMIN=root@hal"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[10]="SOFTWARE=CUPS/1.2.12"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[11]="TMPDIR=/var/spool/cups/tmp"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[12]="USER=root"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[13]="CUPS_SERVER=/var/run/cups/cups.sock"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[14]="CUPS_ENCRYPTION=IfRequested"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[15]="CHARSET=utf-8"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[16]="LANG=en_US"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[17]="PPD=/etc/cups/ppd/OfficeJet_5610.ppd"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[18]="RIP_MAX_CACHE=8m"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[19]="CONTENT_TYPE=application/vnd.cups-raw"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[20]="DEVICE_URI=hp:/usb/Officejet_5600_series?serial=CN7AFDF51S04B2"

D [29/Dec/2007:17:54:29 +0100] [Job 23] envp[21]="PRINTER=OfficeJet_5610"

I [29/Dec/2007:17:54:29 +0100] Started backend /usr/libexec/cups/backend/hp (PID 10099) for job 23.

D [29/Dec/2007:17:54:29 +0100] Discarding unused job-state event...

D [29/Dec/2007:17:54:29 +0100] cupsdProcessIPPRequest: 9 status_code=0 (successful-ok)

D [29/Dec/2007:17:54:29 +0100] cupsdCloseClient: 9

D [29/Dec/2007:17:54:29 +0100] Discarding unused job-progress event...

D [29/Dec/2007:17:54:32 +0100] Discarding unused printer-state-changed event...

D [29/Dec/2007:17:54:32 +0100] PID 10099 (/usr/libexec/cups/backend/hp) exited with no errors.

D [29/Dec/2007:17:54:32 +0100] [Job 23] File 0 is complete.

D [29/Dec/2007:17:54:32 +0100] Discarding unused printer-state-changed event...

D [29/Dec/2007:17:54:32 +0100] Discarding unused job-completed event...

D [29/Dec/2007:17:54:33 +0100] Unloading job 23...

```

there is no file "/var/spool/cups/d00023-001" only "/var/spool/cups/d00023" is this the problem?

/etc/cups/cupsd.conf:

```

#

# "$Id: cupsd.conf.in 5454 2006-04-23 21:46:38Z mike $"

#

#   Sample configuration file for the Common UNIX Printing System (CUPS)

#   scheduler.  See "man cupsd.conf" for a complete description of this

#   file.

#

# Log general information in error_log - change "info" to "debug" for

# troubleshooting...

LogLevel debug

ServerName hal

# Administrator user group...

SystemGroup lpadmin

# Only listen for connections from the local machine.

Listen 192.168.1.1:631

Listen /var/run/cups/cups.sock

# Show shared printers on the local network.

Browsing On

BrowseOrder allow,deny

BrowseAllow @LOCAL

# Default authentication type, when authentication is required...

DefaultAuthType Basic

# Restrict access to the server...

<Location />

  AuthType Basic

  Require user @bewohner root

  Order allow,deny

  Deny all

  Allow localhost

  Satisfy any

</Location>

# Restrict access to the admin pages...

<Location /admin>

#  Encryption Required

  AuthType Basic

  Require user @AUTHORS

  Order allow,deny

  Allow localhost

  Allow From 192.168.1.0/24

</Location>

# Restrict access to configuration files...

<Location /admin/conf>

  AuthType Basic

  Require user @SYSTEM

  Order allow,deny

  Allow localhost

  Allow From 192.168.1.76

</Location>

# Set the default printer/job policies...

<Policy default>

  # Job-related operations must be done by the owner or an adminstrator...

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>

    Require user @OWNER @SYSTEM @AUTHORS

    Order deny,allow

  </Limit>

  # All administration operations require an adminstrator to authenticate...

  <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default>

    AuthType Basic

    Require user @SYSTEM

    Order deny,allow

  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...

  <Limit Cancel-Job CUPS-Authenticate-Job>

    Require user @OWNER @SYSTEM

    Order deny,allow

  </Limit>

  <Limit All>

    Order deny,allow

  </Limit>

</Policy>

#

# End of "$Id: cupsd.conf.in 5454 2006-04-23 21:46:38Z mike $".

#

```

output of testparm:

```

[global]

        workgroup = LAN

        server string = Samba Server %v

        interfaces = lo, eth_lan, eth_wlan

        log file = /var/log/samba/log.%m

        max log size = 50

        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

        printcap name = cups

        dns proxy = No

        remote announce = 192.168.1.255 192.168.5.255

        hosts allow = 192.168.1., 192.168.5., 127.

        hosts deny = 0.0.0.0/0

        printing = cups

        cups options = "raw"

        print command =

        lpq command = %p

        lprm command =

[homes]

        comment = Home Directories

        read only = No

        browseable = No

[printers]

        comment = All Printers

        path = /var/spool/samba

        printer admin = root, @AUTHORS

        printable = Yes

        browseable = No

[print$]

        path = /var/lib/samba/printers

        write list = @adm, root

        guest ok = Yes

```

Help on this matter would be GREATLY apreciated  :Smile: 

thanks in advance!

----------

## Badmaster

is the information I provided not sufficent or is the problem this delicate?  :Smile: 

----------

## darkphader

I get *load of the same type errors:

```
 D [29/Dec/2007:17:54:29 +0100] cupsdAcceptClient: 9 from localhost (Domain) 

 D [29/Dec/2007:17:54:29 +0100] cupsdReadClient: 9 POST / HTTP/1.1 

 D [29/Dec/2007:17:54:29 +0100] cupsdAuthorize: No authentication data provided. 

 D [29/Dec/2007:17:54:29 +0100] Get-Printer-Attributes ipp:///printers/printers 

 D [29/Dec/2007:17:54:29 +0100] Get-Printer-Attributes client-error-not-found: The printer or class was not found. 

 D [29/Dec/2007:17:54:29 +0100] cupsdProcessIPPRequest: 9 status_code=406 (client-error-not-found) 
```

What keeps looking for for a printer named printers?

----------

## Badmaster

i think printers is the queue, samba is using for cups...

----------

## darkphader

I don't get those problems on my local network - but I don't have any Windows systems connected currently.

----------

## russK

You don't say which Windows you are using, but I have had good luck with XP and above, skipping Samba and going straight to CUPS by putting using the CUPS URL for ipp.

In the control panel for Add Printer, you can put the URL for an Internet printer in a format something like this:

http://<linux-cups-ip>:631/printers/printername

Maybe you will have better luck this way.

----------

## Badmaster

 *russK wrote:*   

> You don't say which Windows you are using, but I have had good luck with XP and above, skipping Samba and going straight to CUPS by putting using the CUPS URL for ipp.
> 
> In the control panel for Add Printer, you can put the URL for an Internet printer in a format something like this:
> 
> http://<linux-cups-ip>:631/printers/printername
> ...

 

wow, I already had tried that once but made some mistake... well.. works now =)

thanks a ton mate!

now, is there any way to keep track which user is using up how much ink? hp-levels displays ink levels, so in theory it should be possible  :Wink: 

TIA!  :Very Happy: 

----------

## russK

Sorry I don't know how to figure out who is using up ink, although I agree it might be possible but it may be difficult if you have to determine who is connecting through the IPP URL, I don't know.

One thing I do here is I run hp-levels in a weekly cron job that gets mailed me so I know if it's time to order new ink.

----------

## Mben

I'm not sure what's in the default Gentoo configuration these days (been just upgrading my config for quite a while now) but you may have a log of the number of pages printed but what user (and some more info) in /var/log/cups (mine's called page_log)

The format of the file and how to enable it is is described at http://www.cups.org/doc-1.1/sam.html#7_12_3  (search for PageLog) 

You can also find similar info in the web interface under the jobs tab (click "show all")

To get accurate stats you would need to setup some sort of authentication though (the log uses whatever username is supplied to cups, generally but not necessarily the username doing the printing).

You could also force cups to keep the postscript files that are sent to it for you to look at and try to gauge ink consumption. 

As for polling the printer about ink consumption and logging that, I don't know of a way to do it.

----------

