# Error: failed to acquire build lock

**URL:** <https://discourse.gohugo.io/t/error-failed-to-acquire-build-lock/48625>\
**Category:** support\
**Created:** [March 2, 2024, 9:34pm UTC](https://discourse.gohugo.io/t/error-failed-to-acquire-build-lock/48625 "2024-03-02T21:34:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Acjas2020](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/acjas2020/32/21488_2.png) [@Acjas2020](https://discourse.gohugo.io/u/Acjas2020)\
**Post date:** [March 2, 2024, 9:34pm UTC](https://discourse.gohugo.io/t/error-failed-to-acquire-build-lock/48625/1 "2024-03-02T21:34:45Z")

</div>

Hi guys, running the command ‘hugo server --noBuildLock’ seem to be okay. But the creation of new content using the command 'hugo new \<sample.md\> is having error with this Error: failed to acquire a build loc. Any idea how to resolve this?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [March 2, 2024, 9:52pm UTC](https://discourse.gohugo.io/t/error-failed-to-acquire-build-lock/48625/2 "2024-03-02T21:52:21Z")

</div>

Can you please describe your setup?

---

<div class="post-metadata">

**Author:** ![Acjas2020](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/acjas2020/32/21488_2.png) [@Acjas2020](https://discourse.gohugo.io/u/Acjas2020)\
**Post date:** [March 3, 2024, 12:06am UTC](https://discourse.gohugo.io/t/error-failed-to-acquire-build-lock/48625/3 "2024-03-03T00:06:53Z")

</div>

Im running my setup in my phone using termux, and this hugo version - ‘hugo v0.123.7+extended android/arm64 BuildDate=unknown ver’.

 ![Screenshot_2024-03-03-08-06-31-65_84d3000e3f4017145260f7618db1d683](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/b/3/b37aab1f8adcfd13cb3eceab72f57d6fd62f69f9.jpeg)

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [March 3, 2024, 12:13am UTC](https://discourse.gohugo.io/t/error-failed-to-acquire-build-lock/48625/4 "2024-03-03T00:13:59Z")

</div>

I looked at the code:

- The --noBuildLock flag is not available to use with `hugo new`
- Even if it were, the locking logic for creating new content is not conditional upon that flag

The only workaround is to manually create the content (e.g., `touch sample.md`) then add front matter.

You’re welcome to [create a proposal](https://github.com/gohugoio/hugo/issues/new?assignees=&labels=Proposal%2C+NeedsTriage&projects=&template=feature_request.md&title=), but even if accepted I suspect its priority will be exceedingly low.

---

<div class="post-metadata">

**Author:** ![Saturday-morning](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/saturday-morning/32/23681_2.png) [@Saturday-morning](https://discourse.gohugo.io/u/Saturday-morning)\
**Post date:** [January 6, 2025, 2:49pm UTC](https://discourse.gohugo.io/t/error-failed-to-acquire-build-lock/48625/5 "2025-01-06T14:49:47Z")

</div>

我尝试了一下，应该是文件权限问题。在Termux 的文件目录内运行（至少在proot-distro里面）没有问题。

you can run it in termux src (not in the sdcard src)

# Makefile

```Makefile
all: run

run:
        hugo --gc --minify && zip -r hugo ./public && cp hugo.zip ../hugo
# add a link: the src in sdcard ⇒ ./hugo

```
