HaveAGitGat / Tdarr_Plugins

Tdarr Plugins
GNU General Public License v3.0
131 stars 148 forks source link

replaceOriginalFile Flow Plugin: Error: EAGAIN: resource temporarily unavailable #603

Closed jacroe closed 1 month ago

jacroe commented 5 months ago

I'm running Tdarr 2.17.01 in a Docker container on an Ubuntu box. The computer that runs Tdarr is a different machine than where my media files are stored. Tdarr accesses those files through an SMB mount.

Occasionally, with particularly large files (50 GB+), Tdarr will error out with messages similar to Error: EAGAIN: resource temporarily unavailable, unlink '/film/Coraline_(2009)/Coraline (2009) - Remux-2160p.mkv'. On smaller files (~30-40 GB), it consistently moves files without errors.

Attached is the job report. Let me know if I can provide any more details.

tFZ9RI6WC-log.txt

HaveAGitGat commented 1 month ago

Yeah that's an odd one. It's failed on this code on line 113 from the error:

https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/FlowPlugins/CommunityFlowPlugins/file/replaceOriginalFile/1.0.0/index.js#L113

Which is here in the uncompiled ts code:

https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/FlowPluginsTs/CommunityFlowPlugins/file/replaceOriginalFile/1.0.0/index.ts#L83

Seems the network/disk is blocked so can either retry or try a different method, will look into it.

HaveAGitGat commented 1 month ago

I've made some file operation changes here which should hopefully fix the issue for you, reopen if needed: https://github.com/HaveAGitGat/Tdarr_Plugins/pull/653

jacroe commented 1 month ago

I've retried again with a few files, and it now seems inconsistent. Which is a step-up honestly. In case there can be any more improvements:

A Failure: Qi6lWFfvE-log.txt

And A Success: WQSzG2IE3-log.txt

jacroe commented 1 month ago

@HaveAGitGat I can't manually re-open, but let me know if I need to open a new issue

HaveAGitGat commented 1 month ago

@jacroe I'm not sure there's anything I can do about this. It's a 48+ GB file which is taking 20+ minutes to copy and during the copy the destination file system is becoming unavailable (maybe it's something else is doing a lot of disk activity causing this etc).

Suggestion may be to put the cache location on the same disk as the original file so that it can simply do a move instead of copy.

Or could do a retry loop to retry the copy 1 time:

image

{
  "name": "Basic HEVC Video Flow",
  "description": "Basic HEVC Video Flow",
  "tags": "",
  "flowPlugins": [
    {
      "name": "Input File",
      "sourceRepo": "Community",
      "pluginName": "inputFile",
      "version": "1.0.0",
      "id": "pE6rU7gkW",
      "position": {
        "x": 758.5809635618224,
        "y": 117.19206188888086
      },
      "fpEnabled": true
    },
    {
      "name": "Check if hevc",
      "sourceRepo": "Community",
      "pluginName": "checkVideoCodec",
      "version": "1.0.0",
      "id": "91b7IrsEc",
      "position": {
        "x": 672.4549563302081,
        "y": 253.11148102973914
      },
      "fpEnabled": true
    },
    {
      "name": "Start",
      "sourceRepo": "Community",
      "pluginName": "ffmpegCommandStart",
      "version": "1.0.0",
      "id": "4Swd6qzvc",
      "position": {
        "x": 489.25252076795084,
        "y": 370.51229288382495
      },
      "fpEnabled": true
    },
    {
      "name": "Execute",
      "sourceRepo": "Community",
      "pluginName": "ffmpegCommandExecute",
      "version": "1.0.0",
      "id": "450g167D8",
      "position": {
        "x": 488.72295602997406,
        "y": 699.5034828311435
      },
      "fpEnabled": true
    },
    {
      "name": "Set Video Encoder",
      "sourceRepo": "Community",
      "pluginName": "ffmpegCommandSetVideoEncoder",
      "version": "1.0.0",
      "id": "8B_6pRd_U",
      "position": {
        "x": 488.5270135748424,
        "y": 477.83202026423606
      },
      "fpEnabled": true
    },
    {
      "name": "Replace Original File",
      "sourceRepo": "Community",
      "pluginName": "replaceOriginalFile",
      "version": "1.0.0",
      "id": "4fkfOyR3l",
      "position": {
        "x": 820.4549563302082,
        "y": 742.2114810297393
      },
      "fpEnabled": true
    },
    {
      "name": "Set Container",
      "sourceRepo": "Community",
      "pluginName": "ffmpegCommandSetContainer",
      "version": "1.0.0",
      "id": "TtKXi3Q7h",
      "position": {
        "x": 488.21110165973323,
        "y": 570.3064821931456
      },
      "fpEnabled": true
    },
    {
      "name": "Check Flow Variable",
      "sourceRepo": "Community",
      "pluginName": "checkFlowVariable",
      "version": "1.0.0",
      "id": "tXeJSkvJ8",
      "position": {
        "x": 1083.2156149435268,
        "y": 793.7449862305285
      },
      "fpEnabled": true,
      "inputsDB": {
        "variable": "{{{args.variables.user.retry}}}",
        "value": "true"
      }
    },
    {
      "name": "Set Flow Variable",
      "sourceRepo": "Community",
      "pluginName": "setFlowVariable",
      "version": "1.0.0",
      "id": "k2LofTH-Z",
      "position": {
        "x": 1279.875680281636,
        "y": 666.4037207685099
      },
      "fpEnabled": true,
      "inputsDB": {
        "variable": "retry",
        "value": "true"
      }
    },
    {
      "name": "Fail Flow",
      "sourceRepo": "Community",
      "pluginName": "failFlow",
      "version": "1.0.0",
      "id": "4qq52wm5K",
      "position": {
        "x": 1058.6517168624928,
        "y": 913.6984528023914
      },
      "fpEnabled": true
    },
    {
      "name": "Reset Flow Error",
      "sourceRepo": "Community",
      "pluginName": "resetFlowError",
      "version": "1.0.0",
      "id": "8SMX1X6JO",
      "position": {
        "x": 1279.9292101549822,
        "y": 715.687553527187
      },
      "fpEnabled": true
    }
  ],
  "flowEdges": [
    {
      "source": "pE6rU7gkW",
      "sourceHandle": "1",
      "target": "91b7IrsEc",
      "targetHandle": null,
      "id": "HhF4rw2DZ"
    },
    {
      "source": "91b7IrsEc",
      "sourceHandle": "2",
      "target": "4Swd6qzvc",
      "targetHandle": null,
      "id": "jJizyFUcr"
    },
    {
      "source": "4Swd6qzvc",
      "sourceHandle": "1",
      "target": "8B_6pRd_U",
      "targetHandle": null,
      "id": "3Df7Xoy93"
    },
    {
      "source": "450g167D8",
      "sourceHandle": "1",
      "target": "4fkfOyR3l",
      "targetHandle": null,
      "id": "rE5Dsh9KM"
    },
    {
      "source": "91b7IrsEc",
      "sourceHandle": "1",
      "target": "4fkfOyR3l",
      "targetHandle": null,
      "id": "W2nVG7ts5"
    },
    {
      "source": "8B_6pRd_U",
      "sourceHandle": "1",
      "target": "TtKXi3Q7h",
      "targetHandle": null,
      "id": "epqtLsPuG"
    },
    {
      "source": "TtKXi3Q7h",
      "sourceHandle": "1",
      "target": "450g167D8",
      "targetHandle": null,
      "id": "ljOeP0cAZ"
    },
    {
      "source": "4fkfOyR3l",
      "sourceHandle": "err1",
      "target": "tXeJSkvJ8",
      "targetHandle": null,
      "id": "kBvCloTM-"
    },
    {
      "source": "tXeJSkvJ8",
      "sourceHandle": "1",
      "target": "4qq52wm5K",
      "targetHandle": null,
      "id": "9GMGAsDjp"
    },
    {
      "source": "tXeJSkvJ8",
      "sourceHandle": "2",
      "target": "k2LofTH-Z",
      "targetHandle": null,
      "id": "VfCvS9-kA"
    },
    {
      "source": "k2LofTH-Z",
      "sourceHandle": "1",
      "target": "8SMX1X6JO",
      "targetHandle": null,
      "id": "v2ZgMkUR9"
    },
    {
      "source": "8SMX1X6JO",
      "sourceHandle": "1",
      "target": "4fkfOyR3l",
      "targetHandle": null,
      "id": "j_VZeMQ8x"
    }
  ]
}