Serverless: rmdir _meta/_tmp fails on deploy

Created on 20 Jun 2016  ·  3Comments  ·  Source: serverless/serverless

Hi,

I'm on OS X and I'm running serverless 0.5.6.
Randomly I get the following error when running either sls function deploy --all or sls dash deploy:

/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:61
        fn = function () { throw arg; };
                           ^
Error: ENOTEMPTY: directory not empty, rmdir '/Users/cspeer/Development/Atameo/api/_meta/_tmp'
    at Error (native)
From previous event:
    at FunctionDeploy._removeTmpFolder (/usr/local/lib/node_modules/serverless/lib/actions/FunctionDeploy.js:305:20)
From previous event:
    at FunctionDeploy.functionDeploy (/usr/local/lib/node_modules/serverless/lib/actions/FunctionDeploy.js:104:10)
From previous event:
    at /usr/local/lib/node_modules/serverless/lib/Serverless.js:211:25
    at Array.reduce (native)
    at Serverless._execute (/usr/local/lib/node_modules/serverless/lib/Serverless.js:210:26)
    at Object.actions.(anonymous function) [as functionDeploy] (/usr/local/lib/node_modules/serverless/lib/Serverless.js:429:20)
    at /usr/local/lib/node_modules/serverless/lib/actions/DashDeploy.js:234:26
From previous event:
    at DashDeploy

My guess is that it's got something to do with osx's .DS_STORE files, but not sure.

Cheers,
Chris

Most helpful comment

the workaround is to deploy one function at at time,
ie : my deployment script

cwd=$(pwd)
serverless resources deploy --all -s dev
find . -maxdepth 3 -type f  -name "package.json"  -not -iwholename "./node_modules*"  -not -iwholename "./"  -not -iwholename "./lib/*"  -not -iwholename "./tests/*"  -not -iwholename "./package.json" -print0 | while IFS= read -r -d $'\0' line; do
    DIR=$(dirname "$line")
    echo "processing : cd $DIR/"
    cd $DIR/ && serverless function deploy --prune --number 1  -s dev && cd $cwd
done

All 3 comments

it looks like due to the use of : fse.removeAsync() on line 305 in FunctionDeploy.js
changing it to fse.remove () fixes it

the workaround is to deploy one function at at time,
ie : my deployment script

cwd=$(pwd)
serverless resources deploy --all -s dev
find . -maxdepth 3 -type f  -name "package.json"  -not -iwholename "./node_modules*"  -not -iwholename "./"  -not -iwholename "./lib/*"  -not -iwholename "./tests/*"  -not -iwholename "./package.json" -print0 | while IFS= read -r -d $'\0' line; do
    DIR=$(dirname "$line")
    echo "processing : cd $DIR/"
    cd $DIR/ && serverless function deploy --prune --number 1  -s dev && cd $cwd
done

Hi, thank you for reaching out to us! At this point we've stopped working on 0.5 of Serverless to fully focus on V1.0 that we're currently working on. Therefore we're not taking any changes for 0.5 and do not plan any future releases at this point. We only have a limited set of resources and just need to make sure we're putting everything we have into our next release (and can provide great long term support and backwards compatibility from then on). Hope you understand.

We would love to get your feedback on V1 of the framework and I'm happy to walk you through any questions to make sure its all working great for you.

Was this page helpful?
0 / 5 - 0 ratings