/bin/find: stat() error <File> : No such file or directory

Hi,

I am getting below error in Solaris 10 SPARC when trying to issue a search on /var/tmp partition

Below is the query

/bin/find /var/tmp/ -type f -atime +1 

Below is the result

/bin/find: stat() error <File> : No such file or directory

Hello,

can you post your PATH

echo $PATH

clean it (temporary)

PATH=/usr/sbin:/usr/bin:/bin:/sbin

test your command

and if your have the same problem post the result of this command

truss -aef -rall -wall find /var/tmp -type f -atime +1

Is this error intermittent? It may be seeing a file in the directory but not getting a chance to stat it before it's deleted, which makes sense for /tmp/.

This error is regular, as the cronjob runs every day, to find the files in that directory (i.e) /var/tmp. Is there anything can be done to identify the issue?

Following mat_solaris truss suggestion would be a good start.

mat_solaris,

As requested i have cleaned up PATH temporarily but still i am getting the same error.

I have attached the file for the below command as requested.

truss -aef -rall -wall find /var/tmp -type f -atime +1 

Please assist.

There is a file named "file-03450608-14620.jpg" that was either removed between the directory entries list read and the file status read or which appears but doesn't exist due to a corrupted file system.

28673:  getdents64(4, 0xFF1E0000, 8192)                 = 48
28673:  lstat64("file-03450608-14620.jpg", 0xFFBFF520) Err#2 ENOENT

Thank you for the reply. Please let me know what can be done in order to resolve this issue.

Hello,

YES prash358 :wink:

i think that it's filesystem problem or just file problem :stuck_out_tongue:

you have problem with this file "/var/tmp/http-tmpfiles/file-03450608-14620.jpg"

28673:  fstat64(2, 0xFFBFE2C8)                          = 0
find28673:      write(2, " f i n d", 4)                         = 4
: stat() error 28673:   write(2, 0x0001436E, 15)                        = 15
28673:     :   s t a t ( )   e r r o r  
/var/tmp/http-tmpfiles/file-03450608-14620.jpg28673:   write(2, 0x00028F7D, 47)                        = 47
28673:     / v a r / t m p / h t t p - t m p f i l e s / p h o t o - 0 3 4
28673:     5 0 6 0 8 - 1 4 6 2 0 . j p g
: 28673:        write(2, " :  ", 2)                             = 2
No such file or directory28673: write(2, 0xFF2D0112, 25)                        = 25
28673:     N o   s u c h   f i l e   o r   d i r e c t o r y

test these propositions:

  • you use user other than root (can you execute you "find" command with root user
  • can you check if this "/var/tmp/http-tmpfiles/file-03450608-14620.jpg" file existe (check it with ls, lsattr)
  • can you check if other process use the file (fuser, lsof)
  • can you umount your /var/tmp and run fsck on it :smiley:
  • the last solution it's to delete this file and execute your find (but you can do this in the first if it's urgent)
    (if you cannot delete this file, find her i-node and delete it by her i-node)
    (i can give you these command if you want)

I am unable to find this file on the machine.

use "ls -li" command if you don't have result run fsck on your filesystem, you need to unmount your filesystem

Is the file name reported in the error message always the same when you run the find command ?

If i want to run fsck on mirrored partition, what exactly do i need to follow?

I need to run fsck on /var and it is mirrored partition. Please assist.

Before going the fsck way, have you check if the file name reported in the error message is always the same when you run the find command ?

Yes every time i do a find the file name is same. This issue has been started since last 2 months.

---------- Post updated 06-07-13 at 02:54 PM ---------- Previous update was 06-06-13 at 03:09 PM ----------

Can i run fsck on mounted partition, if yes what steps do i need to follow?

Please assist.

Not a good idea: if there are open files, you would get other corruptions!
umount ensures that there are no open files.
Please give us

df /var/tmp

to show where the file system is mounted.

Thank you for your reply.

unix@test1 >df /var/tmp
/var               (/dev/md/dsk/d140  ):12856214 blocks   970075 files

No. You need to boot in single user mode or from an alternate media.

As you are running SPARC hardware, you can type under the openboot prompt:

boot -m milestone=none

PS: next time you install a Solaris box, choose ZFS ...

can i run

OK boot cdrom -s

in single user mode and then run

fsck -Y -F ufs /dev/md/dsk/d140

Please assist.

hello,

look at the jlliagre proposition or user "boot -s" in prompt ok.
the boot from cdrom is not needed in your case.