HaveAGitGat / Tdarr

Tdarr - Distributed transcode automation using FFmpeg/HandBrake + Audio/Video library analytics + video health checking (Windows, macOS, Linux & Docker)
Other
3.06k stars 96 forks source link

LocalFlowPlugins error in paths #1078

Closed quadcom closed 2 months ago

quadcom commented 2 months ago

Please put plugin requests/bugs at: https://github.com/HaveAGitGat/Tdarr_Plugins

Describe the bug To workaround the bug that resides in "ffmpegCommandRemoveStreamByProperty" (https://github.com/HaveAGitGat/Tdarr_Plugins/issues/562), I copied the functional version of the index.js file and added that to the LocalFlowPlugins dir. Errors reported that the system was looking for the index.js contained inside an "index.js" folder.

}
[2024-09-11T15:06:40.503] [ERROR] Tdarr_Server - Error: Cannot find module '/app/server/Tdarr/Plugins/FlowPlugins/LocalFlowPlugins/ffmpegCommandRemoveStreamByProperty/1.0.1/index.js/index.js'
Require stack:
- /app/Tdarr_Server/srcug/plugins/noop.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
at resolveFileName (/app/Tdarr_Server/node_modules/resolve-from/index.js:29:39)
at resolveFrom (/app/Tdarr_Server/node_modules/resolve-from/index.js:43:9)
at module.exports (/app/Tdarr_Server/node_modules/resolve-from/index.js:46:41)
at module.exports (/app/Tdarr_Server/node_modules/import-fresh/index.js:14:19)
at searchFlowPlugins (/app/Tdarr_Server/srcug/plugins/flowPluginFuncs.js:1:2684)
at async /app/Tdarr_Server/srcug/api/mainApi.js:1:8726{
"code": "MODULE_NOT_FOUND",
"requireStack": [
"/app/Tdarr_Server/srcug/plugins/noop.js"
]

As a test I relocated the index.js file inside of an index.js folder. The Flow Builder recognized the file and I could build the flow as intended. image

However, running the flow now returns an error stating it cannot find the index.js file in that flow step.

1   2024-09-11T17:56:38.265Z whCunSQzF:Node[InternalNode]:Worker[damp-doe]:[Step W02] Loading flow

2   2024-09-11T17:56:38.266Z whCunSQzF:Node[InternalNode]:Worker[damp-doe]:Item from queue, creating flow

3   2024-09-11T17:56:38.266Z whCunSQzF:Node[InternalNode]:Worker[damp-doe]:Creating workDir: /temp/tdarr-workDir-node-Modd7DDXN-worker-damp-doe-ts-1726091794303

4   2024-09-11T17:56:38.267Z whCunSQzF:Node[InternalNode]:Worker[damp-doe]:No plugins or edges for library selected flowId:Iss5PuycM. You can see the flowId in the URL bar when browsing flows
2024-09-11T22:00:36.706886625Z [2024-09-11T18:00:36.706] [INFO] Tdarr_Node - verbose:Tagging video res:"/media/Flicks/10 Years (2012)/10 Years (2012) {imdb-tt1715873} [Remux-1080p][DTS-HD MA 5.1][EN][8bit][AVC][EN]-LEGi0N.mkv"

2024-09-11T22:00:36.725882242Z [2024-09-11T18:00:36.725] [ERROR] Tdarr_Node - Error: Plugin does not exist:/app/Tdarr_Node/assets/app/plugins/FlowPlugins/LocalFlowPlugins///1.0.1/index.js/index.js

2024-09-11T22:00:36.725919226Z            Please make sure plugin id inside plugin file matches plugin file name.

2024-09-11T22:00:36.725924307Z            

2024-09-11T22:00:36.725927360Z     at validatePlugin (/app/Tdarr_Node/srcug/workers/getFlowPlugins.js:1:2426)

2024-09-11T22:00:36.725930508Z     at async addFlowToStateHandler (/app/Tdarr_Node/srcug/workers/getFlowPlugins.js:1:3136)

2024-09-11T22:00:36.725933518Z     at async getFlowPlugins (/app/Tdarr_Node/srcug/workers/getFlowPlugins.js:1:3646)

2024-09-11T22:00:36.725936589Z     at async process.<anonymous> (/app/Tdarr_Node/srcug/workers/worker1.js:1:41862){}

2024-09-11T22:00:36.726491652Z [2024-09-11T18:00:36.726] [ERROR] Tdarr_Node - Error: Cannot find module ''

2024-09-11T22:00:36.726509869Z Require stack:

2024-09-11T22:00:36.726515407Z - /app/Tdarr_Node/srcug/workers/noop.js

2024-09-11T22:00:36.726519331Z     at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)

2024-09-11T22:00:36.726540865Z     at resolveFileName (/app/Tdarr_Node/node_modules/resolve-from/index.js:29:39)

2024-09-11T22:00:36.726545527Z     at resolveFrom (/app/Tdarr_Node/node_modules/resolve-from/index.js:43:9)

2024-09-11T22:00:36.726549283Z     at module.exports (/app/Tdarr_Node/node_modules/resolve-from/index.js:46:41)

2024-09-11T22:00:36.726553112Z     at module.exports (/app/Tdarr_Node/node_modules/import-fresh/index.js:14:19)

2024-09-11T22:00:36.726557211Z     at addFlowToStateHandler (/app/Tdarr_Node/srcug/workers/getFlowPlugins.js:1:3182)

2024-09-11T22:00:36.726561545Z     at async getFlowPlugins (/app/Tdarr_Node/srcug/workers/getFlowPlugins.js:1:3646)

2024-09-11T22:00:36.726565692Z     at async process.<anonymous> (/app/Tdarr_Node/srcug/workers/worker1.js:1:41862){

2024-09-11T22:00:36.726569444Z   "code": "MODULE_NOT_FOUND",

2024-09-11T22:00:36.726573161Z   "requireStack": [

2024-09-11T22:00:36.726576630Z | 0=/ 1=a 2=p 3=p 4=/ 5=T 6=d 7=a 8=r 9=r 10=_ 11=N 12=o 13=d 14=e 15=/ 16=s 17=r 18=c 19=u 20=g 21=/ 22=w 23=o 24=r 25=k 26=e 27=r 28=s 29=/ 30=n 31=o 32=o 33=p 34=. 35=j 36=s 

2024-09-11T22:00:36.726580238Z   ]

2024-09-11T22:00:36.726583616Z }

2024-09-11T22:00:36.753952164Z [2024-09-11T18:00:36.753] [INFO] Tdarr_Node - verbose: 

I copied the flow JS and created a new flow in case the flow itself had become corrupted. Same issue observed.

I deleted the container and rebuilt it from a fresh image. The same behaviour returned.

To Reproduce I'm not sure how to reproduce it.

Expected behavior If using a localflowplugin it is supposed to be processed like any other plugin.

files.zip

Please provide the following information:

-Worker error [can be found on the 'Tdarr' tab by pressing the 'i' button on a failed item in the staged file section or in the transcode error section at the bottom]

Additional context Add any other context about the problem here.

UnknownWitcher commented 2 months ago

When adding plugins, you need to mirror the community plugins, so /ffmpegCommand/ is what should have been your first folder in the /LocalFlowPlugins/ and inside that would have been the plugin folder/version/index.js