Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache copy Fails as File Does Not Exist #333

Closed
zachg99 opened this issue Jan 27, 2021 · 8 comments
Closed

Cache copy Fails as File Does Not Exist #333

zachg99 opened this issue Jan 27, 2021 · 8 comments

Comments

@zachg99
Copy link

zachg99 commented Jan 27, 2021

Describe the bug
Two video files completed the transcode process then ended up saying the copy failed. If I hit info it says:

Error: ENOENT: no such file or directory, stat

Then points to the cache folder. This uses the CPU transcoding.

To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Desktop (please complete the following information):

  • OS: Synology - Docker
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@jasonsansone
Copy link

jasonsansone commented Jan 27, 2021

This was also detailed in #318 (here)

The problem is that the coding for moving files is contained within Tdarr_Server and not Tdarr_Node. The server is attempting to move files from the local cache on another machine, but Tdarr_Server as no access or ability to do so. Only the node and its Tdarr_Node binary can see or access the local cache directory. My workaround was to make the transcode cache on a network accessible share so that both machines, ie the server and node, could access the transcode cache directory. This likely isn't the intended behavior, but a carryover from v1 when things weren't distributed. This also isn't preferable since it keeps all IOPS on the network location as opposed to the local cache which is presumably SSD, NVMe, or even a RAM disk.

@wsegatto
Copy link

Are the files larger than 2GB?
nodejs/node#30085

@jasonsansone
Copy link

I would need to change my transcode directory back to check, but highly doubtful. I encode to x265, so my files are typically under 1gb for a 40min TV episode. Feature length BluRay varies and would exceed 2gb. I can say everything failed when I used a transcode cache directory (regardless of any size that I noticed) which was local to my node. Everything has worked subsequent to change the transcode cache to a location visible to all nodes (it isn't actually SMB or NFS since I am running CephFS...).

@zachg99
Copy link
Author

zachg99 commented Jan 27, 2021

Ahh, thank you for the explanation, it helps a lot. I think I see my issue, I have the cache folder specified in the server container but not the node container so I believe the node is doing the logical equivalent of sending the file to /dev/null .

I have a lot to learn about v2.

This file is 1.6GB, and it's all local to the node/server, I don't have a 2nd machine setup yet.

The transcode is running now I'll close once it completes.

image

@jasonsansone
Copy link

I am not an expert on Docker (not my personal preference but it is popular), but I would map to a persistent storage outside the containers. It appears that would be within your /volume1/video directory which you mapped to /media.

@zachg99
Copy link
Author

zachg99 commented Jan 27, 2021

Yeah, basically i needed to add the ${ROOT}/tdarr/cache:/temp to the node. I think the node was writing to it's /temp, but because it wasn't mapped in the node container what it was writing was basically invisible to everything else that wasn't that node container (including the server container). So, it finished up and said something like "hey server, file transcoded you can find it in /temp" but it was the node's local /temp not a shared folder that the server could see so the server got pissed and said "hey there's no file in /temp..." and threw an error.

Anyway, I see the file in the cache folder now (after mapping and recreating the container) so I think it should be good to go. Next thing to verify is that i have it setup correctly so that it's able to do HW encoding using QSV. The odd thing for this file is it says it's doing a GPU transcode which makes me think it's doing software transcoding but that's for another potential issue.

@zachg99
Copy link
Author

zachg99 commented Jan 27, 2021

Closing as the transcode worked. Make sure you map /temp, /media, and /configs in both the server and node containers of docker.

@zachg99 zachg99 closed this as completed Jan 27, 2021
@rchovan
Copy link

rchovan commented Nov 20, 2022

Hi, I have this issue in latest version 2.00.18 [19th April 2022]

1 2022-11-20T21:13:09.080Z gPJqQigkL:[Step S02] Beginning move/copy operation
2 2022-11-20T21:13:09.081Z gPJqQigkL:Calculating old and new sizes of the following files
3 2022-11-20T21:13:09.081Z gPJqQigkL:/media/tmp/Tears_400_x265.mp4
4 2022-11-20T21:13:09.081Z gPJqQigkL:Tears_400_x265-TdarrCacheFile-01EHO2d1bO.mkv
5 2022-11-20T21:13:09.081Z gPJqQigkL:Old size 0.0006575202569365501. New size 0
6 2022-11-20T21:13:09.081Z gPJqQigkL:Folder to folder conversion is off
7 2022-11-20T21:13:09.081Z gPJqQigkL:New file path /media/tmp/Tears_400_x265-TdarrCacheFile-c6bOexVA21.mkv
8 2022-11-20T21:13:09.081Z gPJqQigkL:Ensuring output folder path exists /media/tmp
9 2022-11-20T21:13:10.081Z gPJqQigkL:Calculating cache file size in bytes
10 2022-11-20T21:13:10.082Z gPJqQigkL:0
11 2022-11-20T21:13:10.082Z gPJqQigkL:Attempting to move cache file to output folder, method 1
12 2022-11-20T21:13:10.082Z gPJqQigkL:File move error: Error: EXDEV: cross-device link not permitted, rename 'Tears_400_x265-TdarrCacheFile-01EHO2d1bO.mkv' -> '/media/tmp/Tears_400_x265-TdarrCacheFile-c6bOexVA21.mkv'
13 2022-11-20T21:13:10.082Z gPJqQigkL:File move error: Cache file Tears_400_x265-TdarrCacheFile-01EHO2d1bO.mkv could not be accessed (0 bytes)
14 2022-11-20T21:13:10.083Z gPJqQigkL:Attempting to move cache file to output folder, method 2
15 2022-11-20T21:13:10.083Z gPJqQigkL:File move error: Cache file Tears_400_x265-TdarrCacheFile-01EHO2d1bO.mkv could not be accessed (0 bytes)
16 2022-11-20T21:13:10.083Z gPJqQigkL:Attempting to copy
17 2022-11-20T21:13:11.084Z gPJqQigkL:File copy error: Error: ENOENT: no such file or directory, lstat '/app/Tdarr_Server/Tears_400_x265-TdarrCacheFile-01EHO2d1bO.mkv'
18 2022-11-20T21:13:12.084Z gPJqQigkL:Moving/Copying item [-error-]: Cache file Tears_400_x265-TdarrCacheFile-01EHO2d1bO.mkv could not be accessed (0 bytes)
19 2022-11-20T21:13:12.084Z gPJqQigkL:Performing clean up on file: /media/tmp/Tears_400_x265-TdarrCacheFile-c6bOexVA21.mkv
20 2022-11-20T21:13:12.085Z gPJqQigkL:Can retry copying in staging section on Tdarr tab

Both server and node have access to media, cache and temp

This is my docker-compose file.

version: '3'
services:
  tdarr:
    container_name: tdarr
    image: ghcr.io/haveagitgat/tdarr:latest
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /data/:/media/
      - /data/tmp:/temp 
      - /docker_data/tdarr/server:/app/server 
      - /docker_data/tdarr/configs:/app/configs 
      - /docker_data/tdarr/logs:/app/logs 
      - /docker_data/tdarr/cache:/app/cache
    environment:
      - webUIPort=8265
      - serverPort=8266
      - PUID=1000
      - PGID=1000
    restart: always
#    devices:
#      - /dev/dri:/dev/dri
    network_mode: bridge
    ports:
      - 127.0.0.1:8092:80
      - 192.168.2.5:8265:8265
      - 192.168.2.5:8266:8266
    logging:
       driver: "json-file"
       options:
         max-size: "10m"
         max-file: "5"

  tdarr-node:
    container_name: tdarr-node
    image: ghcr.io/haveagitgat/tdarr_node:latest
    privileged: true
    restart: unless-stopped
    network_mode: service:tdarr
    environment:
      - PUID=1000
      - PGID=1000
      - UMASK_SET=002
      - nodeID=MainNode
      - serverIP=127.0.0.1
      - serverPort=8266
      - LIBVA_DRIVER_NAME=iHD
      - LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /data/:/media/
      - /data/tmp:/temp 
      - /docker_data/tdarr/node:/app/Tdarr_Node 
      - /docker_data/tdarr/configs:/app/configs 
      - /docker_data/tdarr/logs:/app/logs 
      - /docker_data/tdarr/cache:/app/cache
    devices:
      - /dev/dri:/dev/dri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants