question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No locks available on NFS filesystem

See original GitHub issue

Checklist

  • I’m reporting a bug unrelated to a specific site
  • I’ve verified that I’m running yt-dlp version 2022.03.08.1. (update instructions)
  • I’ve checked that all provided URLs are alive and playable in a browser
  • I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
  • I’ve searched the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I’ve read the guidelines for opening an issue

Description

Since the last version, when I try to download a video on a NFS filesystem, I have an error.

I don’t have this error when I download the video on an ext4 filesystem, then moving it to the NFS FS with mv.

Verbose log

$ yt-dlp -vU https://www.youtube.com/watch?v=BaW_jenozKc
[debug] Command-line config: ['-vU', 'https://www.youtube.com/watch?v=BaW_jenozKc']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, err utf-8, pref UTF-8
[debug] yt-dlp version 2022.03.08.1 [c0c2c57d3]
[debug] Python version 3.10.2 (CPython 64bit) - Linux-5.16.13-arch1-1-x86_64-with-glibc2.35
[debug] exe versions: ffmpeg 5.0 (setts), ffprobe 5.0, rtmpdump 2.4
[debug] Optional libraries: brotlicffi, Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
Latest version: 2022.03.08.1, Current version: 2022.03.08.1
yt-dlp is up to date (2022.03.08.1)
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=BaW_jenozKc
[youtube] BaW_jenozKc: Downloading webpage
[youtube] BaW_jenozKc: Downloading android player API JSON
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] BaW_jenozKc: Downloading 1 format(s): 248+251
[debug] Invoking downloader on "https://rr3---sn-n4g-ouxs.googlevideo.com/videoplayback?expire=1646955035&ei=uzUqYtqnEMSXvdIPwZCeiAo&ip=77.201.194.164&id=o-AEOMSTRbnz2DoolXl4RvHVG2aZH_bUUqs2GWJlUAIhbZ&itag=248&source=youtube&requiressl=yes&mh=Rf&mm=31%2C29&mn=sn-n4g-ouxs%2Csn-n4g-jqbe6&ms=au%2Crdu&mv=m&mvi=3&pl=23&initcwndbps=1832500&vprv=1&mime=video%2Fwebm&gir=yes&clen=988479&dur=9.833&lmt=1544741703689523&mt=1646933097&fvip=6&keepalive=yes&fexp=24001373%2C24007246&c=ANDROID&txp=5432432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAPzRbbfYO_7FNwXwBW2azGJr6IOVoyKSR4e8qTNWytvvAiA4hDzvK-gvGPe5r0Q7zYiM5tKa3zrXjmj_fIbAuvBLTw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgLOhih97SPFzdVoFQk0Td4-QF_B88fyd7aCkHOKTAwGQCIQCaQ-r5_PujKmshHctCBB2Rps0-R_8JsVNok6sGc4xP0g%3D%3D"
ERROR: unable to open for writing: [Errno 37] No locks available
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/yt_dlp/utils.py", line 2169, in _lock_file
    fcntl.flock(f,
OSError: [Errno 37] No locks available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/yt_dlp/downloader/http.py", line 277, in download
    ctx.stream, ctx.tmpfilename = self.sanitize_open(
  File "/usr/lib/python3.10/site-packages/yt_dlp/downloader/common.py", line 220, in inner
    return func(self, *args, **kwargs)
  File "/usr/lib/python3.10/site-packages/yt_dlp/downloader/common.py", line 237, in sanitize_open
    return sanitize_open(filename, open_mode)
  File "/usr/lib/python3.10/site-packages/yt_dlp/utils.py", line 678, in sanitize_open
    stream = locked_file(filename, open_mode, block=False).open()
  File "/usr/lib/python3.10/site-packages/yt_dlp/utils.py", line 2236, in open
    return self.__enter__()
  File "/usr/lib/python3.10/site-packages/yt_dlp/utils.py", line 2209, in __enter__
    _lock_file(self.f, exclusive, self.block)
  File "/usr/lib/python3.10/site-packages/yt_dlp/utils.py", line 2176, in _lock_file
    fcntl.lockf(f,
OSError: [Errno 37] No locks available


[debug] Invoking downloader on "https://rr3---sn-n4g-ouxs.googlevideo.com/videoplayback?expire=1646955035&ei=uzUqYtqnEMSXvdIPwZCeiAo&ip=77.201.194.164&id=o-AEOMSTRbnz2DoolXl4RvHVG2aZH_bUUqs2GWJlUAIhbZ&itag=251&source=youtube&requiressl=yes&mh=Rf&mm=31%2C29&mn=sn-n4g-ouxs%2Csn-n4g-jqbe6&ms=au%2Crdu&mv=m&mvi=3&pl=23&initcwndbps=1832500&vprv=1&mime=audio%2Fwebm&gir=yes&clen=142292&dur=9.841&lmt=1506055557712479&mt=1646933097&fvip=6&keepalive=yes&fexp=24001373%2C24007246&c=ANDROID&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAOc-HOwi-iDH4fOJY7NTZdat-OI55SysvVtBne5HMbgRAiEAqCePlCDfEqdCCzJjOqYcCQZsCAUHGvcogRWSL5tBj1U%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgLOhih97SPFzdVoFQk0Td4-QF_B88fyd7aCkHOKTAwGQCIQCaQ-r5_PujKmshHctCBB2Rps0-R_8JsVNok6sGc4xP0g%3D%3D"
ERROR: unable to open for writing: [Errno 37] No locks available
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/yt_dlp/utils.py", line 2169, in _lock_file
    fcntl.flock(f,
OSError: [Errno 37] No locks available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/yt_dlp/downloader/http.py", line 277, in download
    ctx.stream, ctx.tmpfilename = self.sanitize_open(
  File "/usr/lib/python3.10/site-packages/yt_dlp/downloader/common.py", line 220, in inner
    return func(self, *args, **kwargs)
  File "/usr/lib/python3.10/site-packages/yt_dlp/downloader/common.py", line 237, in sanitize_open
    return sanitize_open(filename, open_mode)
  File "/usr/lib/python3.10/site-packages/yt_dlp/utils.py", line 678, in sanitize_open
    stream = locked_file(filename, open_mode, block=False).open()
  File "/usr/lib/python3.10/site-packages/yt_dlp/utils.py", line 2236, in open
    return self.__enter__()
  File "/usr/lib/python3.10/site-packages/yt_dlp/utils.py", line 2209, in __enter__
    _lock_file(self.f, exclusive, self.block)
  File "/usr/lib/python3.10/site-packages/yt_dlp/utils.py", line 2176, in _lock_file
    fcntl.lockf(f,
OSError: [Errno 37] No locks available

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
dirkfcommented, Mar 11, 2022

Which is why the daemon that handles NLM has to be running (as in your linked reference), as in my comment above.

1reaction
ohnonotcommented, Mar 12, 2022

I can confirm the above comment; a simple systemctl start rpc-statd.service was enough to solve the problem. Make sure to enable the service if that helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NFS client receives 'Error (37): No locks available' when trying ...
NFS client can lock a file using NFSv4.x; Attempted file locks receive Error (37): No locks available; Packet captures show no NLM LOCK ......
Read more >
[SOLVED] nfsv4 gives "No locks available" - LinuxQuestions.org
Hello, I keep getting the error message "No locks available" on my Linux clients, when running Firefox or calibre (E-Book-Reader), just to.
Read more >
Operation failed due to No locks available error - IBM
Cause. There are known issues with NFS v3. The NFSv3 process occasionally exits with 'No locks available' when NFS server crashes. Environment.
Read more >
Unable to obtain lock on NFS files - UNIX and Linux Forums
... ORA-27086: unable to lock file - already in use Linux-x86_64 Error: 37: No locks available Additional information: 10.
Read more >
Operations on a File System Fail With Error: 37: No Locks ...
Troubleshoot operations failure on a file system that produces Error: 37: No Locks Available. Symptom: Operations on the file system ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found