CasparCG / media-scanner

A service used with CasparCG Server software for scanning media located on the server. Queried with query and thumbnail commands through CasparCG Server using AMCP.
https://casparcg.com
GNU Lesser General Public License v3.0
31 stars 33 forks source link

TLS causes error if scanning large amount of files #32

Open peterssonanton opened 5 years ago

peterssonanton commented 5 years ago

Using TLS command causes some clients to disconnect from the caspar server. For example a node server using casparcg-connection (https://www.npmjs.com/package/casparcg-connection).

The issue seems to be caused by this line in media-scanner/src/app.js :33 const rows = await recursiveReadDirAsync(config.paths.template)

There seems to be some sort of timeout when it has to scan a lot of files and causes a socket disconnect, but still returns status OK.

Possibly related error message: errormediascanner4

We use several node services like this and all disconnect at the same time when this error occurs, not just the one sending the command (caspar client works though).

To reproduce:

ronag commented 5 years ago

This is why this was moved out of CasparCG server. This way of listing files does simply not work when you have thousands of files... I would suggest you implement your own node service and perform listing through e.g. HTTP instead of through CasparCG.

ronag commented 5 years ago

Or... don't have soo many files in the templates folder

dotarmin commented 5 years ago

@peterssonanton Add lots of files to casparcg templates path (30,000 +)

Why having that much templates? I'm not sure we have that much. But this could also be the same problem with issue #30 on the other hand. We have to look into this.

Good job @peterssonanton

peterssonanton commented 5 years ago

Its not all templates, but many of our servers are configured to use the caspar root folder as templates path, so the media scanner has to scan all those files including media, images and whatever.

taurojo commented 3 years ago

I have exactly the same problem. When scanning a network drive it generates the same problem and cannot detect or access the network folder. We have the entire repository in the same folder and subfolders.