"bad interpreter: Input/output error"

Jeff atrocity at wywh.com
Sun Jan 14 16:31:11 UTC 2024


[group response to multiple posters below to avoid sending too much mail]

<p>On 1/13/24 18:12, Karl Auer wrote:</p>

 > So you tested with a script on a local disk and it worked?

Yes.

 > Also, check whether the NAS mount is *actually* flagged noexec,
 > regardless of what you think it is or what flags are used to mount it.
 > Put a harmless executable on the NAS (like cat or echo) and try to
 > execute it off the NAS...

I tried it with echo and it did indeed fail:

./echo
bash: ./echo: Input/output error

Or alternatively:

bash ./echo
./echo: ./echo: cannot execute binary file

sudo bash ./echo
./echo: ./echo: cannot execute binary file

Different error messages...interesting, but I don't know what to make of it.

 > Also interested in how you are mounting the NAS - is it NFS, CIFS,
 > something else? Sorry if I messed that in earlier messages.

It's a TrueNAS server mounted CIFS:

//192.168.1.12/WD8TBNAS03    /mnt/WD8TBNAS03    cifs 
_netdev,rw,exec,credentials=/home/administrator/.credentials/.freenas,uid=administrator,gid=administrator,iocharset=utf8,vers=3.0 
0 0

 > Also also - is there any chance that another mount is somehow shadowing
 > your expected mount?

I don't think so. I haven't had a reason to even touch fstab until 
explicitly adding the "exec" shown above yesterday. That replaced 
"mfsymlinks" that I apparently put in there a long time ago for reasons 
I no longer remember. I pretty much never do mounts via the command line.

On 1/13/24 22:48, Jon LaBadie wrote:

 > I'd suggest checking each of the directories in the path to the
 > script, i.e. each of:
 >
 > /mnt/WD8TBNAS03/Documents/ShellScripts

drwxr-xr-x 2 <user> <group>         0 Jan 14 07:49 ShellScripts

 > /mnt/WD8TBNAS03/Documents

drwxr-xr-x  2 <user> <group>  0 Jan 14 07:40  Documents

 > /mnt/WD8TBNAS03

drwxr-xr-x  2 <user> <group>  0 Jan  6 09:03 WD8TBNAS03

 > /mnt

drwxr-xr-x  2 <user> <group>  0 Jan  6 09:03 WD8TBNAS03

 > /

drwxr-xr-x  21 root root   21 Aug  1 12:47 mnt

I thought maybe having /mnt/ owned by root:root might be a clue (though 
it's always been that way), but even this failed:

sudo /mnt/WD8TBNAS03/Documents/ShellScripts/test.py
[sudo] password for <user>:
sudo: unable to execute /mnt/WD8TBNAS03/Documents/ShellScripts/test.py: 
Input/output error

 > Another confirmation of directory problems would be to
 > temporarily add each of the above directories to your
 > PATH variable:

I already have the script directories in the path and have been able to 
execute them simply using the script name without full qualification for 
years.

 > Move test.py to "/" and check for expected behavior.

It works.

 > Move it then to /mnt and recheck.

It works.

On 1/14/24 03:59, Colin Watson wrote:

 > "Input/output error" usually means a physical issue with the hardware
 > (not a permission error, as some other replies have claimed). The
 > output of "dmesg" may have more detailed error messages; in general you
 > should probably be considering the possibility of disk failure.

It's an up to date TrueNAS Core server with mirrored drives. In fact, in 
a non-planned bit of overkill (long story), the pool with the scripts is 
actually a three-drive mirror. The web interface is giving me no 
indication of any problems whatsoever. I just rebooted it on the off 
chance that would help, but nothing changed.

Two other computers connected to the same server have also been 
executing the same scripts for years and are still able to do so.

On 1/14/24 06:03, Little Girl wrote:

 > I'd be curious about the permissions of the ShellScripts directory

drwxr-xr-x 2 <user> <group>         0 Jan 14 07:49 ShellScripts

 > but would also keep in mind that incorrect permissions may be the
 > result of a hardware issue and should be investigated accordingly.

Yikes! I wouldn't even know where to start on that one. I'm not seeing 
any other indication of any problems at all, just the sudden loss of the 
ability to execute a script without the overhead of having to specify 
the program that executes it first...and only on this one computer, not 
on either of the two others accessing the same files.

On 1/14/24 06:15, Karl Auer wrote:

 > Have we yet seen the result of running a script with a shebang on the
 > local disk? I might have missed that.

Yes, it works fine:

$ ./test.py
Does this work?

I just made a tiny little test script (test.sh) in my home directory 
that consists entirely of:

#!/bin/bash
python3 /mnt/WD8TBNAS03/Documents/ShellScripts/test.py

And it works fine. So again, scripts *can* be executed from the NAS, but 
the shebang line isn't honored, forcing me to explicitly state *what* 
executes the script.

I'm starting to wonder if the only way I can deal with this is to sulk 
and/or pout. :)





More information about the ubuntu-users mailing list