Avahi to Avahi not working [SOLVED]

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

Avahi to Avahi not working [SOLVED]

Post by CliveMcCarthy »

I'm using Avahi (Bonjour) as a general networking service between multiple Linux Mint machines. All too often I get dialog boxes such as this:
Screenshot at 2021-03-09 20-16-44.png
The various machines all show up (often more than once) yet I can't transfer files between machines. Yet sometimes, I can. This isn't a new problem but it is driving me mad :evil: . I resort to getting a thumb drive to transfer data between machines :roll:

It would be polite if the error message said what the "invalid argument" was. It is one of the most user hostile messages possible; it's almost as bad as "consult your system administrator".

Please help.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: Avahi to Avahi not working

Post by Moonstone Man »

CliveMcCarthy wrote: Wed Mar 10, 2021 12:47 am I'm using Avahi (Bonjour) as a general networking service between multiple Linux Mint machines.
I think you need to describe that in far more detail, what instructions you followed to set it up, link to the instructions, and provide much more technical information than you have.

Also, see the link at the top of the page where it says "Forum rules Before you post please read how to get help". I advise that because essentially all that you've told us is that you get an "error message ... "invalid argument"", and from that we can only infer that you associate it with 'Avahi to Avahi', which is unfathomable in terms of meaning.
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

Re: Avahi to Avahi not working

Post by CliveMcCarthy »

This is the response I got when I first had problems with Linux-to-Linux networking years back. And Kadaitcha Man, an error message, is an error message it is supposed to be informative. Error messages that don't inform are BAD. They are bugs. Thank you so very much for suggesting I read the posting rules :roll:

Code: Select all

When you have absolutely nothing else to do you might want to explore the 
miracle of avahi.

**Take one of your Linux machines and create a file:
Code:
sudo xed /etc/avahi/services/samba.service
** Add this content:
Code:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">avahi %h</name> ## Display Name
<service>
<type>_smb._tcp</type>
<port>445</port>
</service>
</service-group>
Make sure there are no spaces in front of that first line in the file.

**Restart avahi:
Code:
sudo service avahi-daemon restart
Two things should happen:

[1] The mac should automatically ( well... after a second or two ) list "Samba 
some-host-name" under Network on the left side panel in Finder.
[2] The other Linux boxes should show "Samba some-host-name" when Browse Network 
is selected - and it should show up in the same place the Mac does - outside of 
the "Windows Network" folder.
This has been my standard procedure ever since.
Last edited by CliveMcCarthy on Wed Mar 10, 2021 1:39 am, edited 1 time in total.
First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: Avahi to Avahi not working

Post by Moonstone Man »

CliveMcCarthy wrote: Wed Mar 10, 2021 1:08 am This is the response I got when I first had problems with Linux-to-Linux networking years back. And Kadaitcha Man, an error message, is an error message it is supposed to be informative. Error messages that don't inform are BAD. They are bugs. Thank you so very much for suggesting I read the posting rules :roll:
Yes, well, everyone here is a user, and we are here to help others, so there's no point getting on your high horse and putting on a drama show. Also, as a user, I have a choice about whom I give my free time to.

Good luck.
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

Re: Avahi to Avahi not working

Post by CliveMcCarthy »

Altair4? You out there? You helped me get into Avahi and it's better than the Windows networking stuff. But this isn't that reliable either.
First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: Avahi to Avahi not working

Post by altair4 »

I hope you don't mind a moment of reflection on my part since this is really a sad commentary about the nature of Samba on Linux systems.
This is what has happened to Samba as implemented on Linux:

The samba client "negotiates" with the SMB / Samba server to determine the best dialect of smb to use between a min and max value.

For years the max was set at SMB1 but then Samba decided to increase the max to SMB3 primarily because Windows 10 disabled SMB1 for security reasons.

Nobody told the Gnome developers about this and since it deals with samba they probably didn't think to check. The result was that broke the ability to discover any SMB / Samba server.

Gnome "fixed" this by forcing an SMB1 connection to at least get a list of servers but they messed it up in such a way that once it made the initial scan it got stuck at the SMB1 setting.

If the server has SMB1 disabled ( Windows 10, Ubuntu 20, Mint 20, .... ) when the client tries to connect to it the server doesn't understand the request and returns an "Invalid Argument".

The irony here is that all of this is in a bug in gvfsd-smb-browse whose function is to scan the network for servers based on their NetBIOS names. Avahi broadcasts by hostname not NetBIOS name but it's forced into using the same package. If it could divorce itself from that package the way MacOS does this wouldn't be a problem.
Anyhoo, there are only a few ways to get around this problem: viewtopic.php?f=42&t=322404

Also: You are using an avahi samba.service file. Samba does the equivalent by itself without requiring that file since Mint 19. You can keep the samba.service file if you want ( since it allows you to change the display name ) but if you do I would suggest disabling the way samba does it by adding the following line in smb.conf in the [global] section:

Code: Select all

multicast DNS register = no
Then restart samba.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

Re: Avahi to Avahi not working

Post by CliveMcCarthy »

Thank you Altair4, I knew I could count on you. :) Moments of reflection are most welcome because it puts frustrating things like this in context. And, perhaps, nudges these things to get fixed. It is a great shame that changes to Windows cause things to break in a Linux to Linux environment.

It seems to me that the server should respond with "SMB1 is disabled, SMB3 is required" not the obscure "Invalid Argument". A Google search for "Invalid Argument" will lead nowhere whereas "SMB1 is disabled SMB3 is required" could lead, perhaps, to something useful.

I'm on Mint 20.1 so, from what you say, I can stop adding the /etc/avahi/services/samba.service file to my new machines. :D
First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: Avahi to Avahi not working

Post by altair4 »

CliveMcCarthy wrote: Wed Mar 10, 2021 2:04 pm I'm on Mint 20.1 so, from what you say, I can stop adding the /etc/avahi/services/samba.service file to my new machines. :D
There are two advantages in keeping samba.service file and killing off the way samba itself does it:

[1] It allows the user to set a specific name to the server that differentiates itself from the rest of the servers you may have on that box. For example: I have a machine that is an Ubuntu samba server and also an SSH server. Without intervention the client will see 3 instances of that server all with the label of UbSrv (File Sharing).

But I can create a samba.servcie and a ssh.service avahi file so that one shows up as UbSrv SMB the other UbSrv SSH and the third one I can supress altogether.

[2] The other thing it does is fix a peculiar problem with a MacOS client. The Mac sees the Ubuntu server with a ? icon. That usually means it knows something is there but it doesn't exactly know where it is. It works OK but it just looks weird. It's a bug somewhere I just don't know where it is. A samba.service file fixes that.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

Re: Avahi to Avahi not working

Post by CliveMcCarthy »

Dear Altair4, Moments of reflection...
I remember a time when Windows had really no networking facilities. This was a time when Sun Microsystems declared "the network is the computer". As a consequence we used Sun's add-in cards to PCs with Sun's NFS software. Eventually Microsoft introduced networking and NFS went away.

So it is a sad thing that Linux is somehow stuck supporting Microsoft's late entry into networking. I wish there were a Linux networking module that didn't and wouldn't connect to other systems. Pure Linux to Linux but dependable and bulletproof.

Indeed whatever happened to NFS ?
First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: Avahi to Avahi not working

Post by altair4 »

I haven't seen NFS in the enterprise space in more than a human generation. It didn't fit very well with the ever increasing security model of that space. Conceptually NFS has always been about machine-to-machine whereas SMB has been about user-to-machine.

The thing about samba for better or worse is that it was graphical and has become ubiquitous. Even Apple has abandoned its own file sharing protocol - AFP - for its own version of Samba in MacOS Big Sur.

I'll grant you that with the demise of SMB1 "discovering" other SMB hosts has become an issue but there are other ways to connect.

I have a Win10 machine that I want to access. I can see it under Network in the file manager but cannot access it since WIn10 has no SMB1. But I can set up a declaration in fstab to have it mount on demand:
//win10.local/shared /media/Win10Shared cifs username=smbuser,password=smbuserpw,uid=1000,iocharset=utf8,noauto,user 0 0
CIFS is controlled by the Linux kernel so it doesn't have the bugs associated with the file manager, the samba client, or gvfs. The only difference is with CIFS you have to know the name - or the ip address - of the server and its share.

Sooner or later with NFS you will end up in the same place. Declaring an nfs mount in fstab to a specific machine. To be sure the syntax is different but the objective is the same.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

Re: Avahi to Avahi not working

Post by CliveMcCarthy »

I wasn't expecting to get NFS back :shock:

I did use CIFS facilities in a small script I wrote but it was no fun.To discover the ip address of a server, though possible, is a drag since the 'server' may well be a laptop with a DHCP assigned ip address. It was unreliable. It used something like this:

Code: Select all

IP_ADDRESS=`nmblookup ${TARGET} | grep -v "querying" | awk '{print $1}'`
Where TARGET was the hostname. But I digress.

I'll try your work arounds to get Samba to recognize other Samba hosts. (one would have thought this would be part of a regression test) I have a number of machines so I'll see if I can write a script to do the work.
First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: Avahi to Avahi not working

Post by altair4 »

But nmblookup searches for machines by their NetBIOS names. We aren't using NetBIOS.

You can find all of the avahi / Bonjour enabled hosts with a:

Code: Select all

avahi-browse -at
OR

Code: Select all

mdns-scan
Or you can install avahi-discover which is a graphical utility.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

Re: Avahi to Avahi not working SOLVED

Post by CliveMcCarthy »

This fixes my problem:
Are we talking about one Ubuntu 20.04 machine trying to connect to another 20.04 machine?
The problem is somewhat convoluted I'm afraid. Because of a bug in gvfsd-smb-browse the initial contact between client and server is with SMB1.
But the version of samba in Ubuntu 20.04 disables SMB1 for security reasons. That is the reference to "invalid argument".
Override the default settings and re-enable SMB1 ( what samba calls NT1 ) on both machines:
sudo xed /etc/samba/smb.conf and right under the workgroup = WORKGROUP line add:

Code: Select all

client min protocol = NT1
server min protocol = NT1
Which I found here:https://askubuntu.com/questions/1250885 ... st-upgrade
Now my various Mint machines can share data on the network. :)
First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Avahi to Avahi not working

Post by rene »

CliveMcCarthy wrote: Thu Mar 11, 2021 12:31 am Indeed whatever happened to NFS ?
Nothing much (other than if you'd care for it growing a version 4 with more native "enterprise" capabilities). But see e.g. viewtopic.php?p=1794109#p1794109 for a basic setup.
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

Re: Avahi to Avahi not working [SOLVED]

Post by CliveMcCarthy »

Now I have Avahi and SMB working again my nostalgia for NFS has declined. However, basic networking between Linux peers has always seemed a stepchild. Lots of focus on getting networking working with Windows. Somehow I expected robust Linux-to-Linux networking out of the box.

This server & client protocol saga which involves a security issue strikes me this way:

secure + non-functional
insecure + functional
insecure + non-functional
secure + functional

I guess I should be grateful we don't have option 3 by default.
First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

Re: Avahi to Avahi not working [SOLVED]

Post by CliveMcCarthy »

Rene,
NFS sounds just fine for homogeneous Linux networking which is what I have. So why doesn't Mint pre-install NFS and all the appropriate stuff to make it work out of the box? Samba is nice and Avahi is better but shouldn't NFS,or something like it, take precedence for Linux-to-Linux working? Mint has introduced Warpinator. Wouldn't that effort have been better spent building Mint with NFS pre-installed? Heck, a while back not even Samba was pre-installed. Avahi is something I 'hand' install on every one of my machines. It's a drag.

In my peculiar universe I have one Windows 10 machine to do unavoidable weird stuff. My wife has a Mac which I don't support: "sorry sweetheart, I don't do Apple". I have maybe a dozen or more Linux machines for my artwork (I'm an artist). Rather obviously, I'm my own amateur sys-admin.

Not that it should count for much, but I do send money to Mint so I'm no a complete and utter sponger.

Sorry, end of rant.
Clive.
First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Avahi to Avahi not working [SOLVED]

Post by rene »

NFS wasn't historically always technically wonderful in e.g. the context of concurrent access meaning that even among UNIX-oldhands it didn't have the best of reputations, and when then on Linux this combined with the circle-jerking desktop monkeys for whom needing to --- what say I?! being able to! --- edit a configuration file is a sure sign of never being as cool as Windows we end up with Ubuntu deciding that plugging UNIX-foreign technology such as CIFS is the much better idea on UNIX.

Don't look at me; I'm still shaking my head as well.
cinnamint
Level 1
Level 1
Posts: 6
Joined: Fri Dec 23, 2011 8:36 am

Re: Avahi to Avahi not working

Post by cinnamint »

Kadaitcha Man wrote: Wed Mar 10, 2021 1:12 am
CliveMcCarthy wrote: Wed Mar 10, 2021 1:08 am This is the response I got when I first had problems with Linux-to-Linux networking years back. And Kadaitcha Man, an error message, is an error message it is supposed to be informative. Error messages that don't inform are BAD. They are bugs. Thank you so very much for suggesting I read the posting rules :roll:
Yes, well, everyone here is a user, and we are here to help others, so there's no point getting on your high horse and putting on a drama show. Also, as a user, I have a choice about whom I give my free time to.

Good luck.
Sardonic and unhelpful
pdc_2
Level 10
Level 10
Posts: 3019
Joined: Mon May 11, 2009 1:21 am

Re: Avahi to Avahi not working [SOLVED]

Post by pdc_2 »

sadly KM seems no longer with us
Locked

Return to “Networking”