Bug 1614978 - Network printers with dnssd: urls no longer seem to work due change in /etc/nsswitch.conf
Summary: Network printers with dnssd: urls no longer seem to work due change in /etc/n...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: authselect
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Pavel Březina
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-10 22:23 UTC by Bill Gianopoulos
Modified: 2018-12-06 16:08 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-10 10:27:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
My printers.conf file (1.09 KB, text/plain)
2018-08-13 20:00 UTC, Bill Gianopoulos
no flags Details
Output from commands requested by needinfo (14.02 KB, text/plain)
2018-08-13 20:08 UTC, Bill Gianopoulos
no flags Details
Output from commands requested by needinfo (37.08 KB, text/plain)
2018-08-13 20:15 UTC, Bill Gianopoulos
no flags Details
Output from commands requested by needinfo for Office printer (36.29 KB, text/plain)
2018-08-13 20:35 UTC, Bill Gianopoulos
no flags Details
cups daemon log (105.71 KB, text/plain)
2018-08-14 10:57 UTC, Bill Gianopoulos
no flags Details
cups-broswed log (11.04 KB, text/plain)
2018-08-14 10:58 UTC, Bill Gianopoulos
no flags Details
/etc/nsswitch.conf file if install from rawhide live image (502 bytes, text/plain)
2018-08-16 12:42 UTC, Bill Gianopoulos
no flags Details
/etc/nsswitch.conf file if update from fedora28 (1.72 KB, text/plain)
2018-08-16 12:43 UTC, Bill Gianopoulos
no flags Details
output from authselect check on system installed form rawhide live image (194 bytes, text/plain)
2018-08-16 12:44 UTC, Bill Gianopoulos
no flags Details

Description Bill Gianopoulos 2018-08-10 22:23:04 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. add a new printer usiing a dnssd: url
2. try to print the test page


Actual results:

You get an unable to late printer error


Expected results:

the test page should print

Additional info:

Comment 1 Bill Gianopoulos 2018-08-10 22:24:05 UTC
that should have said unable to locate printer.

Comment 2 Bill Gianopoulos 2018-08-10 22:25:09 UTC
I realize this is pre-alpha quality software, but wanted to get this in early because this issue, if it still exists at beta time, should probably block the beta.

Comment 3 Zdenek Dohnal 2018-08-13 07:14:35 UTC
Hi Bill,

thank you for reporting this issue! Would you mind clarifying how you add a new printer, what url do you use?
Anyway, would you mind following steps here https://fedoraproject.org/wiki/How_to_debug_printing_problems and attach the requested archive?

Comment 4 Zdenek Dohnal 2018-08-13 11:17:50 UTC
And please add output of following commands into a output file:

$ ping <IP of the printer>
$ nmap <IP of the printer>
$ /usr/lib/cups/backend/snmp
$ sudo /usr/lib/cups/backend/dnssd
$ /usr/lib/cups/backend/snmp <IP of the printer>
$ lpinfo -v
$ avahi-browse -a -v -t -r
$ avahi-browse -a -v -c -r
$ ifconfig
$ route

Comment 5 Bill Gianopoulos 2018-08-13 12:06:10 UTC
I am away form the location where I have this issue, but I will add what I can and provide the rest of the info probably later on today.

The printer was added the way I always have added it.  I used the system-config-printer GUI and just took all the defaults, so the URL was that that was created by this utility.  I also tried copying a working /etc/cups/printers.conf file from a fedora28 system and that failed with the same error.

I will attach the printers.conf file as well as the rest of the information asked for when I get back home.

Comment 6 Bill Gianopoulos 2018-08-13 12:15:31 UTC
I should have also mentioned that printing using an IP address seems to work just fine.  However, one of my printers seems to have no method of configuring a static IP so printing by IP address on that device would mean redoing the cups config after every power outage.

Comment 7 Bill Gianopoulos 2018-08-13 20:00:42 UTC
Created attachment 1475665 [details]
My printers.conf file

Comment 8 Bill Gianopoulos 2018-08-13 20:08:05 UTC
Created attachment 1475666 [details]
Output from commands requested by needinfo

Comment 9 Bill Gianopoulos 2018-08-13 20:15:13 UTC
Created attachment 1475667 [details]
Output from commands requested by needinfo

I guess it would be more useful with the missing packages installed.

Comment 10 Bill Gianopoulos 2018-08-13 20:35:34 UTC
Created attachment 1475670 [details]
Output from commands requested by needinfo for Office printer

Output from requested commands for the "Office" printer.  The previous output was for the default "Kitchen" printer.

Comment 11 Bill Gianopoulos 2018-08-13 20:36:31 UTC
I should mention neither one works.  both have worked for several back versions of fedora configured exactly the same way in cups.

Comment 12 Bill Gianopoulos 2018-08-13 20:41:41 UTC
Like I said this is not a problem with printing.  I can't print on these printers if i use IP addresses this is an issue with dnssd it does not seem to be able to find the printer IP address from the name.

Comment 13 Zdenek Dohnal 2018-08-14 09:57:11 UTC
Thank you for the files! Would you mind attaching cups log when you tried to print the test page (all things you need to do are described in the how to link mentioned above)?
I would like to know what CUPS actually says when you try to print.

Comment 14 Jan Kurik 2018-08-14 10:26:16 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 15 Bill Gianopoulos 2018-08-14 10:57:34 UTC
Created attachment 1475812 [details]
cups daemon log

Comment 16 Bill Gianopoulos 2018-08-14 10:58:13 UTC
Created attachment 1475813 [details]
cups-broswed log

Comment 17 Bill Gianopoulos 2018-08-14 13:05:46 UTC
Hmm and yet another wrinkle in this I updated another external usb drive from fedora28 to rawhide and it does not show this issue.  the one that does was installed form rawhide live media.  Both should obviously work.  I have not been able to ascertain the difference yet.

Comment 18 Zdenek Dohnal 2018-08-14 13:19:31 UTC
What cups versions are on both systems?

Comment 19 Bill Gianopoulos 2018-08-14 13:24:28 UTC
The system that has the issue was built from a fedora rawhide live image from July 25th.

Comment 20 Bill Gianopoulos 2018-08-14 13:25:58 UTC
I already tried disabling firewalld but that did not help

Comment 21 Bill Gianopoulos 2018-08-14 13:47:51 UTC
On the upgraded from fedora28 image deleting the printer and re-adding using system-config-printer results in a working printer.  I am sort of at a loss here.  it seems this is only an issue if you start with a rawhide live image.  Both system have been upgraded to latest rawhide and also done a dnf repoquery --extras and downgrading or uninstalling as appropriate.  they should be equivalent.

Comment 22 Zdenek Dohnal 2018-08-14 14:15:24 UTC
Can you please tell me what cups versions are on both systems? IIUC you have two systems - one with rawhide live image, second with system, which was Fedora 28 and you upgraded it to rawhide.

Then if I understood it correctly, please do '$ rpm -q cups' on both systems and show output here. I need to see if their versions differ (because live image can contain older builds - but I'm not so sure about it, I'm not the guy who takes care of live images). If they don't differ, then error can be deeper.

Comment 23 Bill Gianopoulos 2018-08-14 14:32:18 UTC
(In reply to Zdenek Dohnal from comment #22)
> Can you please tell me what cups versions are on both systems? IIUC you have
> two systems - one with rawhide live image, second with system, which was
> Fedora 28 and you upgraded it to rawhide.
> 
> Then if I understood it correctly, please do '$ rpm -q cups' on both systems
> and show output here. I need to see if their versions differ (because live
> image can contain older builds - but I'm not so sure about it, I'm not the
> guy who takes care of live images). If they don't differ, then error can be
> deeper.

OK so this is from the one that was upgraded from fedora28.  cups-2.2.8-2.fc29.x86_64

Comment 24 Bill Gianopoulos 2018-08-14 14:41:59 UTC
and form the one that does not work.  like I said I upgraded form both the fedora28 and the live image install to the latest versions of everything from today and downgraded anything on both versions that had been backed out.  both version should be the same so here is from the other version cups-2.2.8-2.fc29.x86_64  looks the same to me as I said it was originally.  It is fine if being able to print from upgrading from fedora 28 works but if a fresh install from a live image of fedora29 can not print that is not so good.  this might not be a cups issue at all but it would be great if you could find something looking at all the information you asked for to determine where the issue lies.

Comment 25 Zdenek Dohnal 2018-08-14 16:23:03 UTC
I see from logs:

Aug 14 06:52:02 rawhide.wg9s.com cupsd[2819]: Unable to locate printer \"EPSON050E62.local\".

This message comes from dnssd backend, but I'm not sure why the printer doesn't print - all other outputs - like avahi-browse or dnssd finds printer correctly. 

You can check config file in /etc/cups - maybe you made some changes in the past (on machine which you upgraded to F29), so dnf creates new conf files (with .rpmnew suffix) if there were changes and cups still uses the old ones. But on fresh install you don't have any old configs, so it uses the current ones. That can be one source of different behavior.

Comment 26 Bill Gianopoulos 2018-08-15 15:09:12 UTC
OK I figured what is wrong here.  the following changed had to be made to /etc/nsswitch.conf and to make it clear I did NOT have to do this on the fedora28 system that was upgraded vie dnf system-upgrade to rawhide.  This was only needed to be done on the system that I installed form the rawhide live image.  My understanding is this change should have been made by system-config-printer when I added the first printer with a dnssd url.

I had to change the line:

hosts:     files dns myhostname

to:

hosts:      files mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns myhostname

Comment 27 Bill Gianopoulos 2018-08-15 15:30:53 UTC
OK I figured what is wrong here.  The following change had to be made to be made to /etc/nsswitch.conf and to make it clear I did NOT have to do this on the fedora28 system that was upgraded via dnf system-upgrade to rawhide.  This was only needed to be done on the system that I installed form the rawhide live image.  My understanding is this change should have been made by system-config-printer when I added the first printer with a dnssd url.

I had to change the line:

hosts:     files dns myhostname

to:

hosts:      files mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns myhostname

Comment 28 Bill Gianopoulos 2018-08-15 16:13:31 UTC
OK I figured what is wrong here.  The following change had to be made to /etc/nsswitch.conf and to make it clear I did NOT have to do this on the fedora28 system that was upgraded via dnf system-upgrade to rawhide.  This was only needed to be done on the system that I installed from the rawhide live image.  My understanding is this change should have been made by system-config-printer when I added the first printer with a dnssd url.

I had to change the line:

hosts:     files dns myhostname

to:

hosts:      files mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns myhostname

Comment 29 Zdenek Dohnal 2018-08-16 05:19:27 UTC
Thank you for finding out this one! I found out the option:

mdns_minimal [NOTFOUND=return]

is added to /etc/nsswitch.conf when when nss-mdns is installed. It was installed by default in F27 and previous Fedoras, but it seems it is no longer installed - and users who upgrades from older Fedoras have still old working config.
Currently I'm not sure what dragged nss-mdns to system, because rpm requires are the same on F27 and F28, and CUPS or system-config-printer or other printing packages don't require it.

The fix will be adding nss-mdns as Requires of a package - probably CUPS - but I would like to find out why that line isn't there anymore and what change caused it.

Comment 30 Bill Gianopoulos 2018-08-16 10:16:04 UTC
My case was different than what you describe. nss-mdns WAS installed, yet the hosts line did not include the above.

I backed out my changes to /etc/nsswitch.conf and did a "dnf reinstall nss-mdns" and that correctly added the mdns_minimal [NOTFOUND=return].

The only thing I can think of is that somehow the package was installed too early and /etc/nsswitch.conf was recreated after nss-mdns was installed.

Comment 31 Bill Gianopoulos 2018-08-16 12:39:53 UTC
OK I found the real underlying issue here.  installing from the rawhide live image resulted in a /etc/nsswitch.conf file that was under control of authselect such that had editing of the files outside of authselect (like what the nss-mdns install does) is subject to being overridden by authselect redoing its saved configuration.

I am not sure why this is and if the correct fix is to not allow authselect to control this file or if it is that things like nss-mdns need to see if the file can be edited directly or if it is under control of authselect and do its changes accordingly.

Comment 32 Bill Gianopoulos 2018-08-16 12:42:38 UTC
Created attachment 1476421 [details]
/etc/nsswitch.conf file if install from rawhide live image

Comment 33 Bill Gianopoulos 2018-08-16 12:43:37 UTC
Created attachment 1476422 [details]
/etc/nsswitch.conf file if update from fedora28

Comment 34 Bill Gianopoulos 2018-08-16 12:44:38 UTC
Created attachment 1476423 [details]
output from authselect check on system installed form rawhide live image

Comment 35 Bill Gianopoulos 2018-08-16 12:45:51 UTC
authselect check on the system upgraded from fedora28 gets no errors.

Comment 36 Zdenek Dohnal 2018-08-16 15:13:12 UTC
This really seems like something outside of printers... maybe authselect maintainer will know more. I'll reassign it to authselect.

Comment 37 Pavel Březina 2018-08-20 10:56:50 UTC
There has been lots of comments here and I want to make sure that I understand it correctly. There seems to be two cases - upgrade from F28 to rawhide and direct installation of rawhide through live cd.

1) Upgrade from F28 to rawhide: nsswitch.conf has correct values
2) Direct installation: nsswitch.conf has INcorrect values

It this true?

Comment 38 Bill Gianopoulos 2018-08-20 11:36:12 UTC
Yes, that is correct

Comment 39 Pavel Březina 2018-08-20 13:13:04 UTC
During installation, Anaconda calls "authselect select sssd --force" which *previously* overwrote any changes to nsswitch.conf. This is not called on upgrade.

If mdns is pulled as a dependency during packages installation, it makes changes to nsswitch.conf upon installation and these changes are then overwrote by Anaconda authselect call.

However, there is a new feature in authselect 1.0 which is already in F28 (testing, waiting to be pushed) and rawhide which should solve this. See [1]. I pushed this version few days after this BZ was created.

Please, if possible, retest this with recent rawhide.

Additionally, I plan to provide a unified way to package maintainers to modify nsswitch.conf in F30 scope, see [2].

[1] https://github.com/pbrezina/authselect/wiki/Design-Document:-nsswitch.conf-modification
[2] https://github.com/pbrezina/authselect/issues/77

Comment 40 Pavel Březina 2018-09-07 11:14:18 UTC
Bill, could you please test it with current rawhide?

Comment 41 Bill Gianopoulos 2018-09-08 13:58:10 UTC
(In reply to Pavel Březina from comment #40)
> Bill, could you please test it with current rawhide?
Not sure at all what you are asking here.  If you want me to reinstall from a new rawhide to make sure this does not happen, that is too big an ask.  I finally have this computer running as expected and have no interest in having to spend another week doing it over again.

If you could provide the old script that was run to update nsswitch.conf and the new one I could verify that the change to the script fixes my issue without having to trash my entire fedora installation as you seem to be wanting me to do.

Comment 42 Pavel Březina 2018-09-10 10:27:45 UTC
Yes, the test would be to reinstall from current rawhide. It is OK if you are not willing to do it, I fully understand that.

I am closing this bug as resolved as it should be fixed per comment #39. Feel free to reopen it if you run into it again.

Comment 43 Bill Gianopoulos 2018-09-17 11:44:42 UTC
Sorry, I thought I had cleared the needinfo.


Note You need to log in before you can comment on or make changes to this bug.