Nuxt.js: npm run build failed [Unable to update lock within the stale threshold]

Created on 22 Mar 2019  ยท  7Comments  ยท  Source: nuxt/nuxt.js

Version

v2.4.0

Reproduction link

https://nuxtjs.org

Steps to reproduce

I am using CodeBuild for our deployment from last 2 months. But when I build today then it gets failed. I tried many times. Here is the log for the same:

nuxt build
[04:17:14] [FATAL] Lock is already released
at callback (node_modules/proper-lockfile/lib/lockfile.js:241:60)
at Promise (node_modules/proper-lockfile/lib/adapter.js:39:9)
at new Promise ()
at args (node_modules/proper-lockfile/lib/adapter.js:30:25)
at NuxtCommand.lockRelease [as _lockRelease] (node_modules/@nuxt/utils/dist/utils.js:139:11)
at NuxtCommand.releaseLock (node_modules/@nuxt/cli/dist/cli-chunk.js:244:18)
at NuxtCommand.run (node_modules/@nuxt/cli/dist/cli-chunk.js:159:18)
at
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ โ”‚
โ”‚ โœ– Nuxt Fatal Error โ”‚
โ”‚ โ”‚
โ”‚ Error: Lock is already released โ”‚
โ”‚ โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: nuxt build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-03-22T04_17_14_897Z-debug.log

What is expected ?

Since It was working earlier but not now.

What is actually happening?

Since It was working earlier but not now.

This bug report is available on Nuxt community (#c8893)
bug-report

Most helpful comment

This is a duplicate of #5324

The pr's @manniL links to only removes the fatal error, but the lock could still become compromised which would show a warning. Why this happens so often is still not really clear, but from what I have been able to debug it could be anything like:

  • _using Node <=v9_
    v10/v11 have seen major performance improvements, but v10 is LTS so for production env its advised to run that. I have successfully reproduced that a lock always fails with v9, but never with v10/v11
  • _slow IO performance_ (possibly)
    When during the webpack build the system is busy it looks like the stale check on the lock can fail. I have been unable to reproduce this consistently as it seems to be quite hard to limit/block IO for a process while debugging. At first I thought it might have to do with high cpu-usage, but I was unable to trigger the lock compromised warning while blocking the webpack build with a while loop for 1 minute. So cpu iowaits are still a suspect of causing the lock warning to show

All 7 comments

This is really weird when I deleted my local node_moudule and npm install; npm run build failed. I tried 2.4.0, 2.4.5, 2.5.1. Please do needful I have some released to do.

Screenshot from 2019-03-22 11-21-55

This have been driving me crazy for the last two hours and I've been looking for someone with the same issue. Following.

I've got this too, but I can work-around it with "nuxt build --no-lock"

I've got this too, but I can work-around it with "nuxt build --no-lock"

This is a valid workaround for now.

https://github.com/nuxt/nuxt.js/pull/5347 and https://github.com/nuxt/nuxt.js/pull/5320 might have fixed that โ˜บ๏ธ

cc @pimlie

This is a duplicate of #5324

The pr's @manniL links to only removes the fatal error, but the lock could still become compromised which would show a warning. Why this happens so often is still not really clear, but from what I have been able to debug it could be anything like:

  • _using Node <=v9_
    v10/v11 have seen major performance improvements, but v10 is LTS so for production env its advised to run that. I have successfully reproduced that a lock always fails with v9, but never with v10/v11
  • _slow IO performance_ (possibly)
    When during the webpack build the system is busy it looks like the stale check on the lock can fail. I have been unable to reproduce this consistently as it seems to be quite hard to limit/block IO for a process while debugging. At first I thought it might have to do with high cpu-usage, but I was unable to trigger the lock compromised warning while blocking the webpack build with a while loop for 1 minute. So cpu iowaits are still a suspect of causing the lock warning to show

Duplicate of #5324

on my localhost it is evry thing gut but on Ubuntu 18.04 server its same issue, ( npm run build ) not working, i use NUXTjs :(
is there any solution ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikekidder picture mikekidder  ยท  3Comments

bimohxh picture bimohxh  ยท  3Comments

lazycrazy picture lazycrazy  ยท  3Comments

vadimsg picture vadimsg  ยท  3Comments

uptownhr picture uptownhr  ยท  3Comments