openhab-addons: [IPP] "bad request" warnings in OH log.

Expected Behavior

I implemented IPP to connect to a CUPS print server, which worked without issue for a long time. I expected that this would continue after I upgraded from OH 3.2 to OH 3.3.

Current Behavior

After upgrading to OH 3.3 this past week, I’m getting this warning message spammed in the log endlessly:

2022-10-07 15:24:09.310 [WARN ] [ethz.vppserver.ippclient.IppResponse] - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
	<TITLE>Bad Request - CUPS v2.2.10</TITLE>
	<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
</HEAD>
<BODY>
<H1>Bad Request</H1>
<P></P>
</BODY>
</HTML>

I thought that maybe I need to remove and re-add the thing that was carried over from OH3.2. I did that and there were no warnings for 12+ hours, but then the warnings started again and continued until I disabled the thing. Every minute, there are three warnings every minute (likely corresponding to the default 60-second refresh rate of the IPP binding). After the warnings start, CUPS stops talking openHAB.

If I go back to OH 3.2, there are no warnings and everything works fine.

Possible Solution

I’m not sure if this is a bug with the IPP binding or if it’s an issue with my cupsd.conf configuration. I’m able to access the CUPS server remotely from my Windows desktop PC, and connections from openHAB definitely work for a period of time before the warning starts. I ran the cupsctl --share-printers command in the CUPS documentation to ensure my cupsd.conf is baseline.

I’m guessing that these warnings are now showing up due to this commit by @wborn, which seems to be the only change to the IPP binding between the stable releases of 3.2 and 3.3. Nothing has changed on my CUPS 2.2.10 server, which is on a different Raspberry Pi on the same network. There doesn’t appear to be a newer CUPS version available for Debian at this time.

https://github.com/openhab/openhab-addons/commit/03e626018d26ef548d0ca80da3ae4e13a13e5a0a

Since these are just warnings, I thought about raising the log level for the binding. However, it now seems that they are communication between openHAB and CUPS is not being maintained.

Steps to Reproduce (for Bugs)

  1. Set up a CUPS server and printer on Debian
  2. Connect to the CUPS server from openHAB using the IPP binding
  3. Monitor log to see if warnings appear

Your Environment

  • Version used: OH 3.3 (stable), stable IPP binding
  • CUPS 2.2.10 runs on an octoPi image (Raspian Buster)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I think it may be a bug in cups4j. Seems like https://github.com/harwey/cups4j/pull/42 changed with https://github.com/harwey/cups4j/commit/956990c0dbdeb29d521892c5d0b4e5aab5974c07 how the Host: header is set in 0.7.9.

I have the same issue. I searched for that invalid Host message and just found out that adding ServerAlias localhost to /etc/cups/cupsd.conf on the machine running cups fixes the issue. If anyone sees that error message with something other than localhost, my guess is that you should add that other hostname instead.

You can use this org.openhab.binding.ipp-3.2.0.jar to test if the library upgrade caused any issues.