Automounting fails with mount-start-limit-hit

ok, I’ll test it in few minutes.

please copy paste the content of the konsole - no images - they are useless

 $ journalctl -xe
feb 15 12:54:39 tiger systemd[1]: home-fh-media-data.automount: Got automount request for /home/fh/media/data, triggered by 67436 (bash)
feb 15 12:54:39 tiger systemd[1]: Mounting nas...
░░ Subject: A start job for unit home-fh-media-data.mount has begun execution
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ A start job for unit home-fh-media-data.mount has begun execution.
░░ 
░░ The job identifier is 2711.
feb 15 12:54:39 tiger kernel: CIFS: Attempting to mount \\nas.net.nix.dk\data
feb 15 12:54:40 tiger systemd[1]: Mounted nas.
░░ Subject: A start job for unit home-fh-media-data.mount has finished successfully
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ A start job for unit home-fh-media-data.mount has finished successfully.
░░ 
░░ The job identifier is 2711.

Do you access the folder using a script?
A script which expects the folder to be instantly available?
You may need to alter the script to allow the mountpoint to be ready.

If that’s the case, shouldn’t he/she/it rather make a systemd unit with a requirement for the mount?

This is not known - just asking …

I know, but I think a systemd unit can have a start delay. I just don’t know if that delay is from it’s invoked, or from it’s dependencies are all met…

And, just saw this:

You can run the sleep command before your ExecStart with ExecStartPre :

[Service]
ExecStartPre=/bin/sleep 30

Fist of all - in journalctl - no error about mounting.

I access the folder for example with Dolphin.
And yes, some of my programs expect NAS to be constantly available, that’s why I removed TimeoutIdleSec option from automount.

If you only access the folder with dolphin - then it works as expected

I think you should code your programs to not hammer your mountpoint.

If it is python you can use below construction to handle when the mount is not readily available

try:
except:

That would take the heat of your mountpoint.

Or you could could parse the output of mount to ensure the mountpoint is actually mounted.

1 Like

No error, but any other message? Maybe there’s some clue there:

journalctl --unit=smb.service --no-pager

Ok. I’m loosing the idea :slight_smile:

So if I plug a USB Dongle it just pops up, mounts and works :slight_smile:

If I want to mount SMB share I have to do some trickery with scripts :smiley:

Is there any way to diagnose the problem or is it just trying. If not working then trying something else?

for .mount:
mount error(101): Network is unreachable

for automount:

ome-adrian-media-DANE.automount: Failed with result 'mount-start-limit-hit'.

Which programs? Your own?

That is not what I said - you said some of my programs which to me infer you are using some kind of scripting or programming tools which is hammering your mount before it has become available - instead of handling the missing connection gracefully - thus the errormessage.

But you have not explained what the issue is? - The only info we got were the error message from your automount unit.

That is the cause of your problem - you see - the automount unit activates the mount unit - the mount unit reponds with Network is unreachable.

So to fix your issue you need to ensure your service is connected to the network - otherwise you will never get it to work.

1 Like

Not to be obvious, but it seems there’s your problem.

The issue is: It does not mount the share.
I thought it’s clear from the beginning.

That is the cause of your problem - you see - the automount unit activates the mount unit - the mount unit reponds with Network is unreachable.

So to fix your issue you need to ensure your service is connected to the network - otherwise you will never get it to work.

It is connected all the time.
If I manually mount it, it works instantly.

Problem is only with automount.

A problem which I have tested above and I cannot reproduce it.

So you are likely having an XY problem where you ask about one thing but in reality it is something else that is bugging you.

So could you please replace your screenshot above with a copy pasted text of the console output?

journalctl for mount unit:

Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: Mounting serwer...
Feb 15 13:14:56 adrian-tobefilledbyoem mount[1087]: mount error(101): Network is unreachable
Feb 15 13:14:56 adrian-tobefilledbyoem mount[1087]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.mount: Mount process exited, code=exited, status=32/n/a
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.mount: Failed with result 'exit-code'.
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: Failed to mount serwer.
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.mount: Start request repeated too quickly.
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.mount: Failed with result 'exit-code'.
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: Failed to mount serwer.

for automount:

-- Boot 6c890c58ee824d1c96ec4a7a10697e85 --
Feb 15 13:14:29 adrian-tobefilledbyoem systemd[1]: Set up automount DANE automount.
Feb 15 13:14:30 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.automount: Got automount request for /home/adrian/media/DANE, triggered by 862 (python)
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.automount: Got automount request for /home/adrian/media/DANE, triggered by 863 (python)
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.automount: Got automount request for /home/adrian/media/DANE, triggered by 863 (python)
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.automount: Got automount request for /home/adrian/media/DANE, triggered by 863 (python)
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.automount: Got automount request for /home/adrian/media/DANE, triggered by 862 (python)
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.automount: Got automount request for /home/adrian/media/DANE, triggered by 862 (python)
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.automount: Failed with result 'mount-start-limit-hit'.

Something else, no I don’t know what, except that it’s most likely a python script, is hammering the share, as @linux-aarhus said. And heree’s your proof:

-- Boot 6c890c58ee824d1c96ec4a7a10697e85 --
[...]
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.automount: Got automount request for /home/adrian/media/DANE, triggered by 863 (python)
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.automount: Got automount request for /home/adrian/media/DANE, triggered by 863 (python)
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.automount: Got automount request for /home/adrian/media/DANE, triggered by 863 (python)
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.automount: Got automount request for /home/adrian/media/DANE, triggered by 862 (python)
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.automount: Got automount request for /home/adrian/media/DANE, triggered by 862 (python)
Feb 15 13:14:56 adrian-tobefilledbyoem systemd[1]: home-adrian-media-DANE.automount: Failed with result 'mount-start-limit-hit'.

Those 6 attempts, by python all happened in less than a second. So, no wonder you get:

mount-start-limit-hit

…error. It would seem, as mentioned by @linux-aarhus, the python script/program would need to be adjusted somehow.

That is not possible - the automount activates the mount unit - if the mount unit works alone then the automount unit will work as well.

Although - when manually checked - the moununit must be stopped before starting the automount.

Yes - but why - the automount fail - but why

And that only became clear when you posted this

If your mountpoint is mounted and available - and you can browse the share using dolphin - why does your automount unit complain with Network is unreachable when the python process access it?

A python script process is accessing your mount point and this process fails whith the message

The big question is when is this python script accessing your mountpoint?

Have you tried access the mountpoint with dolphin - thus verifying if the mountpoint is available?

Or have you activated a VPN service in between - this will most certainly sever the connection to your local file service.

ok, so the task now is to find out what is 862 and 863 process and disable it or slow it down.

1 Like

No - the task is to identify the cause for your network connection changing - because the network address defined in your mount unit //192.168.0.100/sharename has gone awol.

That is why your automount fails.

As your mount point is inside your home - logic states that you have to have logged onto your system.

The question is - when does your network connection come up?

The next question is - which application is autostarted?

We know the application is python based - but which one?

1 Like

I just checked.
The first trigger happened 50 secs before system was loaded with graphics environment so it probably happens before Network connection is established.

I have to figure out which program it is…

Thanks so far for your help.