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

Serverless Deploy/Package error "EPERM: operation not permitted, scandir" #5013

Closed
GhostfromTexas opened this issue May 31, 2018 · 7 comments
Labels

Comments

@GhostfromTexas
Copy link

Description

Deploying or packaging a serverless project causes the error...

"EPERM: operation not permitted, scandir 'C:\Users\GhostfromTexas\Desktop\BMT\backend\packages\synapse.build\node_modules'"

This has all of a sudden started happening on all our Windows computers. We've rolled back our repo to revisions that did deploy correctly as well as updated serverless to latest version, as well as changed node versions. Can not get past this issue.

I've found 2 others online that have recently had the same issue. Maybe a Windows update?

The problem seems to be related to the symbolic linking of the node_modules folder inside the .build folder. The folder appears to be linked as a file instead of a folder. On Windows if you do "mklink" without the "/D" option on a directory, you'll get the same result.

We've gone back to projects that we haven't touched in months and they cannot deploy either. We're not sure what's wrong at this point. This is why our assumption was a Windows update changed something related to symbolic linking that maybe "FS" might work differently under the hood.. not sure.

Here is a snapshot of what the .build folder looks like when it fails.

https://gyazo.com/a79faf1a1e14478d295cff4d8040cbca

Enabling SLS_DEBUG=* yields the following output...

Serverless: Load command run
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command emit
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Compiling with Typescript...
Serverless: Using local tsconfig.json
Serverless: Warning: "rootDir" from local tsconfig.json is overriden
C:/Users/GhostfromTexas/Desktop/BMT/backend/packages/synapse/source/controllers/AdminProblemTypesController.ts (139,38): 'req' is declared but its value is never read.
C:/Users/GhostfromTexas/Desktop/BMT/backend/packages/synapse/source/controllers/AdminProblemTypesController.ts (139,60): 'res' is declared but its value is never read.
C:/Users/GhostfromTexas/Desktop/BMT/backend/packages/synapse/source/controllers/AdminProblemTypesController.ts (143,44): 'req' is declared but its value is never read.
C:/Users/GhostfromTexas/Desktop/BMT/backend/packages/synapse/source/controllers/AdminProblemTypesController.ts (143,66): 'res' is declared but its value is never read.
Serverless: Typescript compiled.
Serverless: Packaging service...
Serverless: Excluding development dependencies...

Error --------------------------------------------------

EPERM: operation not permitted, scandir 'C:\Users\GhostfromTexas\Desktop\BMT\backend\packages\synapse.build\node_modules'

 For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

Stack Trace --------------------------------------------

Error: EPERM: operation not permitted, scandir 'C:\Users\GhostfromTexas\Desktop\BMT\backend\packages\synapse.build\node_modules'
at Package.resolveFilePathsAll (C:\node\v8.9.4\node_modules\serverless\lib\plugins\package\lib\packageService.js:113:48)
at Package.packageAll (C:\node\v8.9.4\node_modules\serverless\lib\plugins\package\lib\packageService.js:67:17)
at BbPromise.all.then (C:\node\v8.9.4\node_modules\serverless\lib\plugins\package\lib\packageService.js:58:21)
From previous event:
at Package.packageService (C:\node\v8.9.4\node_modules\serverless\lib\plugins\package\lib\packageService.js:56:43)
From previous event:
at Object.package:createDeploymentArtifacts [as hook] (C:\node\v8.9.4\node_modules\serverless\lib\plugins\package\package.js:67:10)
at BbPromise.reduce (C:\node\v8.9.4\node_modules\serverless\lib\classes\PluginManager.js:372:55)
From previous event:
at PluginManager.invoke (C:\node\v8.9.4\node_modules\serverless\lib\classes\PluginManager.js:372:22)
at PluginManager.spawn (C:\node\v8.9.4\node_modules\serverless\lib\classes\PluginManager.js:390:17)
at Deploy.BbPromise.bind.then.then (C:\node\v8.9.4\node_modules\serverless\lib\plugins\deploy\deploy.js:123:50)
From previous event:
at Object.before:deploy:deploy [as hook] (C:\node\v8.9.4\node_modules\serverless\lib\plugins\deploy\deploy.js:113:10)
at BbPromise.reduce (C:\node\v8.9.4\node_modules\serverless\lib\classes\PluginManager.js:372:55)
From previous event:
at PluginManager.invoke (C:\node\v8.9.4\node_modules\serverless\lib\classes\PluginManager.js:372:22)
at PluginManager.run (C:\node\v8.9.4\node_modules\serverless\lib\classes\PluginManager.js:403:17)
at variables.populateService.then (C:\node\v8.9.4\node_modules\serverless\lib\Serverless.js:102:33)
at runCallback (timers.js:789:20)
at tryOnImmediate (timers.js:751:5)
at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
at Serverless.run (C:\node\v8.9.4\node_modules\serverless\lib\Serverless.js:89:74)
at serverless.init.then (C:\node\v8.9.4\node_modules\serverless\bin\serverless:42:50)
at

Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com

Your Environment Information -----------------------------
OS: win32
Node Version: 8.9.4
Serverless Version: 1.27.3

@HyperBrain
Copy link
Member

Hi @GhostfromTexas , can you double check if the problem comes from Serverless and is not already present in npm after the Windows update?
Can you post your npm version and your Windows version (i.e. if you run the 1709 or the 1803 releases?).

@GhostfromTexas
Copy link
Author

GhostfromTexas commented Jun 1, 2018

The problem happens specifically when I run sls package and it's putting things in the .build folder. I'm not sure what role npm plays in that build process at all.

NPM Version: 5.6.0, standard NPM with node 8.9.4

Windows Version: (1803 17134.81) https://gyazo.com/779551fff06ff193287b6fccc7f07a1e

@JohnyCilohokla
Copy link

And I'm on NPM 5.7.1 with node v8.9.4, Windows version 1803. Same problem.

@GhostfromTexas
Copy link
Author

Here is another post of someone having the exact same issue we have, and only recently.

https://forum.serverless.com/t/windows-10-package-deploy-errors/4602

@GhostfromTexas
Copy link
Author

GhostfromTexas commented Jun 1, 2018

Turns out the issue might be related to a typescript plugin we use with serverless, not serverless itself. Apologize!

serverless/serverless-plugin-typescript#100

For those interested in this issue that might be searching for answers :)

Haven't confirmed though

@ThomasVuillaume
Copy link

Turns out the issue might be related to a typescript plugin we use with serverless, not serverless itself. Apologize!

prisma/serverless-plugin-typescript#100

For those interested in this issue that might be searching for answers :)

Haven't confirmed though

Just saw your post, I was having the same issue (Window 10 in Developper Mode, with Node 8.12, serverless@1.31.0 / serverless-plugin-typescript@1.1.5, running the shell in Administrator mode).
Just hard-modified the serverless-plugin-typescript with this PR (still not merged) and it worked...

Good luck

@pmuens
Copy link
Contributor

pmuens commented Jan 18, 2019

Thanks for opening @GhostfromTexas 👍

Looks like it's a plugin issue so I'll close this for now.

@pmuens pmuens closed this as completed Jan 18, 2019
@pmuens pmuens added the bug label Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants