r/sysadmin•
Sys_man

One of the weirder errors I have encountered; could use some input. Something to do with an SMB share

I have a folder of pdfs & xlsx's named <customer number>-Processed.(pdf/xlsx)

Meaning there is one pdf and one xlsx for each customer number.

The folder is an SMB share on a linux box

This error popped up when running a VBA macro, but is reproducible in powershell: for one particular entity, customer number '785', one file of another customer number is returned as well when you run get-childitem -filter 785*

ie:

get-childitem -filter 785*

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----      11/03/2020  9:17 a.m.          18393 777-Processed.xlsx
-a----      14/02/2020  2:35 p.m.         114161 785-Processed.pdf
-a----      11/03/2020  9:17 a.m.          21088 785-Processed.xlsx

Now it gets really weird:

If I copy those files to a local folder and run the same, I don't get that extra 777-Processed.xlsx. Everything is fine.

  • I have tried editing/changing/replacing that 777-processed.xlsx, and the 785 ones but 777 still shows up in the results.
  • It only happens with 785*, no others.
  • Looking at the folder on the linux machine ls -l 785* returns correct results.
  • Permissions for the files are the same.
  • If I copy the files to another folder within the SMB share I see the error.

I have no idea where to look now.

Some more weird stuff:

  • This weird behavior is not reproduced if I run it in Powershell Core 7.0. Only in 5.1. (and via the Dir() function in VBA)
  • I have a folder with last year's stuff in there, and 785 messes up again, only this time it's not 777 that it returns, it's the pdf of client# 412. Bizarre.

Posted Mar 10, 2020, 9:01 PM UTC · edited

34
Silent331•

The filter I believe filters the entire path, not just the file name. Any 785* further up the folder chain?

2
Sys_manOP•

No, no number in the path at all. I did just test dir 785* and that works correctly.

The problem is is that the wrong result is showing up in a VBA macro. It's just faster to test in powershell since I can reproduce it there.

1
ZAFJB•

Random thought 777 Linux file permission?

1
Sys_manOP•

yeah, but it's 785 that I'm searching for. Also, I found another folder where it's happening but this time the incorrect file return is for number 412. Truly weird

1