Apache Guacamole: RDP printer not working, “error parsing HTTP request header”, “Invalid character found” etc

If you’re using Apache Guacamole 1.0.0 behind an nginx reverse proxy, and Guacamole’s RDP printer doesn’t work, and browser console logs error 400, welcome to read further.

Possible log transcript:

guac guacd: Print job created
guac guacd: Created PDF filter process PID=...
guac guacd: Running gs
guac: org.apache.coyote.http11.AbstractHttp11Processor process
guac: INFO: Error parsing HTTP request header
guac: Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
guac: java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

I don’t know what exactly is causing the problem (misconfiguration or a bug), but I’ve discovered a couple of workarounds to mitigate the problem.

Workaround #1

Probably the user interface language of your Windows RDP host is not English. Change the user interface language to English, it may help. If you don’t want to do that, see workaround #2.

Workaround #2

Remove the URL path from proxy_pass directive in nginx’s config. For example, if your config looks like this:

location /guacamole {
	...
	proxy_pass http://192.168.1.1/guacamole/;
	...
}

Change it to:

location /guacamole {
	...
	proxy_pass http://192.168.1.1;
	...
}

Important: nginx’s location should match Guacamole’s Tomcat URL (by default it is /guacamole). So if your nginx’s location is not /guacamole, you need to update Guacamole’s Tomcat URL accordingly (how to do that — see my other post).

Quite possible there are better fixes that I am unaware of. If you know something, please comment.

This entry was posted in Solutions and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.