Unable to open file after copy to FreeNAS

Status
Not open for further replies.

Eniac74

Dabbler
Joined
Jan 9, 2015
Messages
41
Background
I have just installed two new 4TB HDD:s (mirror) due to insufficient free space on the old ones. The old 2TB HDD:s constitute Volume1 and the new ones Volume2. Following this I have copied all files from Volume1 to an identical structure on Volume2. I copied using command 'cp - R' in the FreeNAS shell. There is probably a prettier solution to my migration of files, via Rsync or so I guess, but that is not my principal concern at this point.

The setup is essentially:
1. UserComputer
2. RemoteComputer
3. FreeNAS
4. AirportExtreme (TimeCapsule)

Where FreeNAS and RemoteComputer is connected via ethernet cable to AirportExtreme, and UserComputer is connected via Wifi to AirportExtreme.

Problem
In addition to above I also had files on RemoteComputer which I wanted to copy to FreeNAS. From UserComputer (Wifi connected) I logged in to the FreeNAS shell in order to transfer movie files (mkv) from RemoteComputer. I used the following command:

scp -r User@RemoteComputerIP:/FileLocationOnRemotecomputer/Filename* /mnt/FreeNAS/DestinationFolder

This seems to have worked fine for the first batch of files, but for a subsequent single file the transfer went fine (on the face of it), but I am unable to open it from the FreeNAS location using Finder (OSX 10.11.2, i.e. El Capitan). File is visible, but when I double-click it and VLC tries to execute it I receive the message:

File reading failed
VLC could not open the file (No such file or directory ).

Your input can't be opened
VLC is unable to open the MRL

I AM still able to open the file from its original location on RemoteComputer (from UserComputer), so it is not a question of original sin, but rather something in the transfer or FreeNAS.
At first I was able to delete the file (via Finder) in so much that I did not receive an error message, however, the file remained. I also checked via the FreeNAS shell and the file was still there. Now, after having written this ticket, I was suddenly able to remove the file via Finder, but upon checking in the FreeNAS shell it was still there. And now it is back in Finder too.

To add to the problem picture - I yesterday mass transferred a big number of movie files (from Volume1 to Volume2 using the cp command) prior to the above operation. And I found that a few files had incorrect 'Kind' ('Type' in Windows I believe), e.g. two mpg-files where portrayed as Folder and hence unable to open with VLC. Today, those two files seem correct, i.e. portrayed as MPEG and possible to open with VLC.

Questions
As I have transferred a lot of files I am in no position to click on each file in this manner to verify the correctness. So...does anybody recognize the problem, or have a solution suggestion? Can FreeNAS act strange in this way following a mass transfer of files, but eventually stabilize?
It probably should be mentioned that following the mass transfer I cross-checked the number of files in and size of the top datasets with subfolders and they corresponded, so everything looked fine on the face of it.

Noteworthy is also that I today cleared the Finder cache in order to zero any issues with indexing (not sure that this would solve it, but that is what I have done still the same).

I tried to include all relevant info, but if something is missing, do not hesitate to ask and I will complement.
 

Eniac74

Dabbler
Joined
Jan 9, 2015
Messages
41
UPDATE - on unplayable file

OK, so I have isolated the problem - the 'scp' command seems to have a major problem with file names containing letters other than the 26 in the English alphabet. However, never does it tell you so in the process, so you are left to believe the transfer went fine. The problem file in question contained an 'ä' in the file name and that does apparently not work, as I have tried replacing the 'ä' with an 'a' and then I can play the file after transfer.
This pothole has also been verified with music files I transferred in the same manner yesterday - if a folder name contains any letters other than the 26 letters, all files in it are "can't be found" or just will not play, the same goes for individual files in a folder which adheres to the English alphabet.

That it is the scp command that is the problem is verified because I transferred the very same problem file (with the 'ä' in the filename) with Finder to FreeNAS and that worked fine. However, it seems to only be when copying over the network, because I tried to copy problem files from Volume1 to Volume2 (both on FreeNAS box) with both 'cp' and 'scp' and in both instances it worked fine.

So, does anybody have a better way of copying over the network, i.e. from computer to FreeNAS? Or am I left to copying these movie and music files via Finder, in order to get them in usable form on FreeNAS?
(Just to avoid this drifting into a linguistic discussion; No, to rename all the files is not an option.)
 

Mr_N

Patron
Joined
Aug 31, 2013
Messages
289
Umm a network share with cifs?
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Well surely, there is a solution to this problem, or all of Europe would be up in arms. I am sure it's a matter of configuring the client and/or scp correctly to handle these filenames.

If you didn't want to figure out what, exactly, the problem was, then, why not just zip your files up, without compression, and send the zip file? Then, your wonky weird Euro-letters won't be an issue.

Code:
zip -mr0 CrazyFinnishDeathMetal.zip *

something like that. Repeat as needed.

Boom done.

Edit: Slight problem of course; "zip" is not part of a base FreeNAS install. That part of the problem is left as a solution to the reader.
 

Eniac74

Dabbler
Joined
Jan 9, 2015
Messages
41
Umm a network share with cifs?

FreeNAS and RemoteComputer is set up with AFP share only, UserComputer with both AFP and SMB activated. Not sure if the last computer's setting actually matters, as it only acts as a window to the other two in this instace. But maybe I'm wrong.
As both 'scp' and 'cp' worked fine when copying from Volume1 to Volume2, my most recent thought is that maybe it has something to do with the 'ssh' command misbehaving in some way (or needs a setting) - I assume that the 'scp' command implicitly uses 'ssh' when used as described above.

If you didn't want to figure out what, exactly, the problem was, then, why not just zip your files up, without compression, and send the zip file? Then, your wonky weird Euro-letters won't be an issue.

Sounds like an option, although you have pointed out a problem in the process. Will look into that though. What does the zero do in '-mr0'?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
UPDATE - on unplayable file

OK, so I have isolated the problem - the 'scp' command seems to have a major problem with file names containing letters other than the 26 in the English alphabet. However, never does it tell you so in the process, so you are left to believe the transfer went fine. The problem file in question contained an 'ä' in the file name and that does apparently not work, as I have tried replacing the 'ä' with an 'a' and then I can play the file after transfer.
This pothole has also been verified with music files I transferred in the same manner yesterday - if a folder name contains any letters other than the 26 letters, all files in it are "can't be found" or just will not play, the same goes for individual files in a folder which adheres to the English alphabet.

That it is the scp command that is the problem is verified because I transferred the very same problem file (with the 'ä' in the filename) with Finder to FreeNAS and that worked fine. However, it seems to only be when copying over the network, because I tried to copy problem files from Volume1 to Volume2 (both on FreeNAS box) with both 'cp' and 'scp' and in both instances it worked fine.

So, does anybody have a better way of copying over the network, i.e. from computer to FreeNAS? Or am I left to copying these movie and music files via Finder, in order to get them in usable form on FreeNAS?
(Just to avoid this drifting into a linguistic discussion; No, to rename all the files is not an option.)
For CIFS you can play around with the DOS charset / UNIX charset under "services" -> "CIFS". To fix things for the CLI, I think you can set a locale that uses UTF-8. Here's a good starting point: https://forums.freenas.org/index.ph...not-displayed-in-ssh.10590/page-2#post-103886
 
Status
Not open for further replies.
Top