Accessing a samba share from two different Ubuntu boxes

I have a raspberry pi acting as a nas on my network. I have no problem accessing the nas via the GNOME ‘files’ screen. An application which I would like to run only sees the local file system so in order for it to talk to the nas, I have to mount the network share on the local file system. No problem I say, I have two Ubuntu 25.04 boxes. Both boxes can temporarily mount the network share with the ‘mount.cifs’ command. Great, now I figure I should have the sharers mounted on bootup by adding them to my fstab files. I added the same command line into the fstab file for both computers. Computer #1 is happy and mounts the share without issues. Using the same command line in the fstab file of computer #2 will show the share but reports an error when I try to access it. I get an error of mount.cifs: permission denied. However, if I run a ‘sudo mount -a’ command then I have full access to the share. I have spent several hours trying to figure out why this is happening but have run out of things to try.
To sum up - two Ubuntu 25.04 boxes, identical commands in the fstab file on both computers, one works as expected but the other gives permission errors until I run ‘sudo mount -a’

Hello,

You’ve got two Ubuntu computers. Both can manually mount a NAS share just fine. One mounts it automatically at boot using fstab, the other doesn’t. But if you run “sudo mount -a” after boot, it works.

Here’s what’s probably going on:

First, the network might not be ready when the system tries to mount the share during boot. You can fix that by adding these options to your fstab entry: _netdev and x-systemd.automount. That tells the system to wait for the network or delay the mount until the folder is accessed.

Second, check the credentials file you’re using. Make sure it’s owned by root and not world-readable. The permissions should be 600.

Third, the system might just be trying to mount too early. Adding the options above usually solves that.

Lastly, you can check system logs with the command journalctl -b | grep mount to see what the error is.

Let me know if you want a workaround using a startup script or systemd service.

Thank you very much for your suggestions. As it turned out, after many hours of screwing around, I found a work-around. I did try _netdev and x-systemd.automount without success. The non-working computer is in fact a bit slower and _netdev should have taken care of that. I also started out without a credentials file by putting the username and password into the fstab file. A few hours ago I lucked out by using the ‘user’ option in the fstab command line.
I still haven’t got a clue why one computer runs just fine but the other doesn’t. Both computers run the same version of Ubuntu, the same user is logging in from both computers, in both cases the user is a member in the same groups and the log-in’s go to the same share in the NAS. It seems to be a permission related issue (since the ‘user’ option worked) but I do not know why.
I appreciate your help!