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

scanner error without network connection #50

Closed DerMatze87 closed 4 years ago

DerMatze87 commented 4 years ago

If I use my CasparCG Server 2.3.0 without an network connection, the scanner node process throws errors and I couldn't use cls an other scanner function on server. How can I solve this problem?

[2020-05-21T15:36:35.502Z] ERROR (scanner/8476 on DESKTOP-S80MFEC): err: { "type": "Error", "message": "getaddrinfo ENOENT localhost:8000", "stack": "Error: getaddrinfo ENOENT localhost:8000\n at Object._errnoException (util.js:1024:11)\n at errnoException (dns.js:55:15)\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)", "code": "ENOENT", "errno": "ENOENT", "syscall": "getaddrinfo", "hostname": "localhost", "host": "localhost", "port": "8000", "status": 500 }

LRTNZ commented 4 years ago

Hi there. Could you please add the full log? I cannot see anything there relating to what is causing the issue from inside the scanner itself.

DerMatze87 commented 4 years ago

Here is the full output from scanner.

[2020-05-21T15:48:50.307Z] INFO (scanner/9880 on DESKTOP-S80MFEC): caspar: { "config": "./casparcg.config" } paths: { "template": "template/", "media": "C:\Users\Mathias\Desktop\Media_For_Caspar/", "font": "./font", "ffmpeg": "ffmpeg.exe", "ffprobe": "ffprobe.exe", "log": "log/", "data": "data/" } scanner: { "paths": "C:\Users\Mathias\Desktop\Media_For_Caspar/" } thumbnails: { "width": 256, "height": -1 } isProduction: false logger: { "level": "trace", "name": "scanner", "prettyPrint": true } http: { "port": 8000 } type: "literal" ALLUSERSPROFILE: "C:\ProgramData" APPDATA: "C:\Users\Mathias\AppData\Roaming" AppsRoot: "D" CommonProgramFiles: "C:\Program Files\Common Files" CommonProgramFiles(x86): "C:\Program Files (x86)\Common Files" CommonProgramW6432: "C:\Program Files\Common Files" COMPUTERNAME: "DESKTOP-S80MFEC" ComSpec: "C:\WINDOWS\system32\cmd.exe" DriverData: "C:\Windows\System32\Drivers\DriverData" HOMEDRIVE: "C:" HOMEPATH: "\Users\Mathias" LOCALAPPDATA: "C:\Users\Mathias\AppData\Local" LOGONSERVER: "\\DESKTOP-S80MFEC" NUMBER_OF_PROCESSORS: "4" OneDrive: "C:\Users\Mathias\OneDrive" OneDriveConsumer: "C:\Users\Mathias\OneDrive" OS: "Windows_NT" Path: "C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;C:\Users\Mathias\AppData\Local\Microsoft\WindowsApps;C:\Users\Mathias\AppData\Local\atom\bin;C:\Users\Mathias\AppData\Local\Microsoft\WindowsApps;;C:\Users\Mathias\AppData\Local\Programs\Microsoft VS Code\bin" PATHEXT: ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC" PROCESSOR_ARCHITECTURE: "AMD64" PROCESSOR_IDENTIFIER: "Intel64 Family 6 Model 142 Stepping 9, GenuineIntel" PROCESSOR_LEVEL: "6" PROCESSOR_REVISION: "8e09" ProgramData: "C:\ProgramData" ProgramFiles: "C:\Program Files" ProgramFiles(x86): "C:\Program Files (x86)" ProgramW6432: "C:\Program Files" PROMPT: "$P$G" PSModulePath: "C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules" PUBLIC: "C:\Users\Public" SESSIONNAME: "Console" SystemDrive: "C:" SystemRoot: "C:\WINDOWS" TEMP: "C:\Users\Mathias\AppData\Local\Temp" TMP: "C:\Users\Mathias\AppData\Local\Temp" USERDOMAIN: "DESKTOP-S80MFEC" USERDOMAINROAMINGPROFILE: "DESKTOP-S80MFEC" USERNAME: "Mathias" USERPROFILE: "C:\Users\Mathias" windir: "C:\WINDOWS" : [] $0: "C:\Users\Mathias\Desktop\CasparCG Server 2.3.0\scanner.exe C:\snapshot\media-scanner\src\index.js" [2020-05-21T15:48:50.323Z] INFO (scanner/9880 on DESKTOP-S80MFEC): Checking for dead media (node:9880) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: getaddrinfo ENOENT localhost:8000 (node:9880) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. [2020-05-21T15:48:50.822Z] ERROR (scanner/9880 on DESKTOP-S80MFEC): err: { "type": "Error", "message": "getaddrinfo ENOENT localhost:8000", "stack": "Error: getaddrinfo ENOENT localhost:8000\n at Object._errnoException (util.js:1024:11)\n at errnoException (dns.js:55:15)\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)", "code": "ENOENT", "errno": "ENOENT", "syscall": "getaddrinfo", "hostname": "localhost", "host": "localhost", "port": "8000", "status": 500 } [2020-05-21T15:48:50.947Z] ERROR (scanner/9880 on DESKTOP-S80MFEC): err: { "type": "Error", "message": "getaddrinfo ENOENT localhost:8000", "stack": "Error: getaddrinfo ENOENT localhost:8000\n at Object._errnoException (util.js:1024:11)\n at errnoException (dns.js:55:15)\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)", "code": "ENOENT", "errno": "ENOENT", "syscall": "getaddrinfo", "hostname": "localhost", "host": "localhost", "port": "8000", "status": 500 } [2020-05-21T15:48:51.115Z] ERROR (scanner/9880 on DESKTOP-S80MFEC): err: { "type": "Error", "message": "getaddrinfo ENOENT localhost:8000", "stack": "Error: getaddrinfo ENOENT localhost:8000\n at Object._errnoException (util.js:1024:11)\n at errnoException (dns.js:55:15)\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)", "code": "ENOENT", "errno": "ENOENT", "syscall": "getaddrinfo", "hostname": "localhost", "host": "localhost", "port": "8000", "status": 500 } [2020-05-21T15:48:51.256Z] ERROR (scanner/9880 on DESKTOP-S80MFEC): err: { "type": "Error", "message": "getaddrinfo ENOENT localhost:8000", "stack": "Error: getaddrinfo ENOENT localhost:8000\n at Object._errnoException (util.js:1024:11)\n at errnoException (dns.js:55:15)\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)", "code": "ENOENT", "errno": "ENOENT", "syscall": "getaddrinfo", "hostname": "localhost", "host": "localhost", "port": "8000", "status": 500 }

LRTNZ commented 4 years ago

Right, so afaik with nodejs, no network interface = not able to use the network stack. So what you will need to do, is to setup a loopback adaptor so that node can bind to a 'network interface' - see here for details: https://preparingwindows.com/microsoft-loopback-adapter-windows-10/

Also, see the changes I made in my IPv6 fix PR (that needs to be merged in still), apply those to your source code, and rebuild. Otherwise you may find it tries to bind to an IPv6 port in the loopback.

DerMatze87 commented 4 years ago

Thanks, the solution with loopback adaptor works fine.

LRTNZ commented 4 years ago

Thanks, the solution with loopback adaptor works fine.

@DerMatze87 Great to hear!
Would you be happy to close this issue now?