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

.hugo_build.lock: too many open files #49

Open
romeocontrol opened this issue Oct 9, 2023 · 6 comments
Open

.hugo_build.lock: too many open files #49

romeocontrol opened this issue Oct 9, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@romeocontrol
Copy link

Hallo,
working with visualStudioCode on macOS
hugo v0.118
Error: error building site: failed to acquire a build lock: open /Users/.../hugobricks/.hugo_build.lock: too many open files

Any error on my side?
Thank you for answering!
RT

@jhvanderschee
Copy link
Owner

jhvanderschee commented Oct 12, 2023

I have never seen that before... did you manage to fix it? You can probably just delete that file.

@jhvanderschee jhvanderschee added the bug Something isn't working label Oct 12, 2023
@romeocontrol
Copy link
Author

OK,
building the complete site with hugo command works w/o error.
starting the hugo server makes the error. Deleting of /.hugo_build.lock w/o effect.

imac27-2020@iMac27-2020 hugobricks % hugo
Start building sites …
hugo v0.119.0-b84644c008e0dc2c4b67bd69cccf87a41a03937e+extended darwin/amd64 BuildDate=2023-09-24T15:20:17Z VendorInfo=brew

               | EN

-------------------+------
Pages | 83
Paginator pages | 0
Non-page files | 0
Static files | 104
Processed images | 60
Aliases | 1
Sitemaps | 2
Cleaned | 0

Total in 8807 ms

command: hugo server
Watching for changes in /Users/imac27-2020/Documents/hugo-sonnenhaus/hugobricks/{content,data,static,themes}
Watching for config changes in /Users/imac27-2020/Documents/hugo-sonnenhaus/hugobricks/config.yaml
Start building sites …
hugo v0.119.0-b84644c008e0dc2c4b67bd69cccf87a41a03937e+extended darwin/amd64 BuildDate=2023-09-24T15:20:17Z VendorInfo=brew

Built in 0 ms
Error: error building site: failed to acquire a build lock: open /Users/imac27-2020/Documents/hugo-sonnenhaus/hugobricks/.hugo_build.lock: too many open files

@romeocontrol
Copy link
Author

https://www.docsy.dev/docs/getting-started/#workaround
This works, but is probably not persistant.
sudo launchctl limit maxfiles 65535 200000
ulimit -n 65535
sudo sysctl -w kern.maxfiles=200000
sudo sysctl -w kern.maxfilesperproc=65535

@jhvanderschee
Copy link
Owner

Is this fixed? Seems like a Hugo bug, not theme specific...

@romeocontrol
Copy link
Author

Hallo,
had to pause my project.
updated hugo to: hugo v0.121.1-00b46fed8e47f7bb0a85d7cfc2d9f1356379b740+extended darwin/amd64 BuildDate=2023-12-08T08:47:45Z VendorInfo=brew
error still in place
I think, it is not a hugo bug but a problem with the system due to a too large number of open files.
Wer do these many files come from?
sudo launchctl limit maxfiles 65535 200000
still helps.
Merry chrisstmas for the all of you!
RT

@marcushaupt
Copy link

Hello,

I've the same issue using MacOS 14.2.1 (23C71) and vscode on Apple Silicon. I don't have a solution for that problem. But the workaround I'm currently using is to avoid the automatic rebuild. I simply use the command: hugo server --buildFuture --watch=false.

This isn't ideal since you will lose one of the biggest advantages of Hugo. But at least I can use the theme, which is more important for me than having automatic rebuilds at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants