rpwong
(Russ)
October 16, 2022, 7:23pm
1
I’ve been using the IPP binding since OH2. After upgrading from OH 3.2 to OH 3.3, I started getting these warning messages in the log:
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 posted an issue on GIthub, and after setting the CUPS log to DEBUG I saw this:
E [11/Oct/2022:21:52:24 -0700] [Client 1] Request from "192.168.1.100" using invalid Host: field "localhost".
The issue appears to be due to a problem in the cups4j library, which was updated in 3.3. The solution is to edit the CUPS configuration (cupsd.conf) to include this line:
ServerAlias localhost
I’m posting here in case anyone else runs into this problem.
rpwong
(Russ)
October 16, 2022, 7:26pm
2
For more details, see the Github issue.
opened 10:58PM - 07 Oct 22 UTC
closed 07:09PM - 16 Oct 22 UTC
bug
## Expected Behavior
I implemented IPP to connect to a CUPS print server, whi… ch 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](https://www.cups.org/doc/sharing.html) 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)