Selecting Printer from Nethserver menu results in lhost.ldomain.test refused to connect

NethServer Version: NethServer release 7.3.1611 in VMware 12 VM Bridged NIC
Module: nethserver-printers, MariaDB (MySQL) server, Nextcloud, PhpMyAdmin, shellinabox

NOOB here. All modules listed are functioning correctly EXCEPT the Print Server module when attempting to access it from Nethserver menu. Hovering over Nethserver Printer menu shows “http://192.168.0.149:980/en-US/Printers”. Using Opera 47, Chrome 61.0.3163.79 or Safari 5.1.7 on Windows 10 Pro fails to open cups and the page error is “lhost.ldomain.test refused to connect.” Accessing cups directly from any browser using “lhost.ldomain.test:631” also fails.

Accessing cups directly from any browser using “http://192.168.0.149:631” connects to cups. I can authenticate, add printer, print test page, etc. Printer is listed under dashboard menu as enabled and idle. Printing a test page from cups results in “Filter Error”. Used a bogus file for PPD (since I cannot seem to find one for an Epson Artisan 837) just to get the printer added. I have a couple of HP inkjet printers I will try.

I have obtained the same results using Nethserver 6.9 and 7.3 with similar applications installed. I have looked for clues in the cups and httpd logs to no avail.

I am looking for coaching/clues/hints to enhance my own troubleshooting skills.


Update Forgot to mention:

NetBIOS domain name: LDOMAIN
LDAP server: 192.168.0.159
LDAP server name: nsdc-lhost.ad.ldomain.test
Realm: AD.LDOMAIN.TEST
Bind Path: dc=AD,dc=LDOMAIN,dc=TEST
LDAP port: 389
Server time: Tue, 19 Sep 2017 01:10:41 CDT
KDC server: 192.168.0.159
Server time offset: 0
Last machine account password change: Fri, 15 Sep 2017 11:39:11 CDT

Join is OK
whenChanged: 20170915163911.0Z
name: LHOST
objectSid: S-1-5-21-2894315363-1977128940-937714417-1103
accountExpires: 9223372036854775807
sAMAccountName: LHOST$
pwdLastSet: 131499671514049890
dNSHostName: lhost.ldomain.test
servicePrincipalName: HOST/LHOST
servicePrincipalName: HOST/lhost.ldomain.test
lastLogon: 131502750419981010
distinguishedName: CN=LHOST,CN=Computers,DC=ad,DC=ldomain,DC=test

Hi @Burns,

You may try to ping lhost.ldomain from your Win 10 client. You will be able to ping with IP but not with hostname. The Windows 10 Pro client can’t resolve the hostname lhost.ldomain.test. You have to set Nethserver as DNS server. Then your Win client should be able to get the right IP for lhost.ldomain.test and printer module should work.

But nethserver-printers is the only module where this “static hostname forwarding” problem occurs and the only one acting like an applications button (no NS menu anymore). Is it already a bug?

Alternative solution, if you want to use IP addresses and no hostnames:

You may edit the function prepareView in file /usr/share/nethesis/NethServer/Module/Printers.php and change "Location: https://$hostname.$domain:$port" to "Location: https://".$_SERVER['SERVER_ADDR'].":$port"

public function prepareView(\Nethgui\View\ViewInterface $view)
    {
        parent::prepareView($view);
        $port = $this->getPlatform()->getDatabase('configuration')->getProp('cups','TCPPort');
        $hostname = $this->getPlatform()->getDatabase('configuration')->getType('SystemName');
        $domain = $this->getPlatform()->getDatabase('configuration')->getType('DomainName');
        // redirect to CUPS web interface
        // commented out this line!   $view->getCommandList()->httpHeader("Location: https://$hostname.$domain:$port");
        // inserted the next line:
        $view->getCommandList()->httpHeader("Location: https://".$_SERVER['SERVER_ADDR'].":$port");
    }

Now it should work even with IP address.