.serverless cache folder

It appears that when deploying, serverless creates a local folder called “cache” under the “.serverless” folder. When I upgrade to the latest version of serverless and try to deploy, I get the following error:

 
  EACCES: permission denied, open '/Users/[user folder]/.serverless/cache/b98f37a031412deca57fca296e99e192b43eeb58d68eab38f025169f54a85d3e/autocomplete.json'

I have not been able to update serverless for a while because of this. I am stuck on version 1.36.1 because of this issue.

I understand that this is a permission problem but I am not sure why the cache folder is being created with permissions that don’t allow the user access, and why this doesn’t happen with lower versions of serverless.

2 Likes

I am also getting the same issue after switching my laptop.

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

Error: EACCES: permission denied, open ‘/Users/piyushpriyadarshi/.serverless/cache/9dbeef5c2a323c7894723902a2ede3c050dab433d5304382400c7e9043f34920/autocomplete.json’

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

Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: Issues · serverless/serverless · GitHub
Issues: *************************

Your Environment Information ---------------------------
Operating System: darwin
Node Version: 14.15.4
Framework Version: 2.20.0
Plugin Version: 4.4.2
SDK Version: 2.3.2
Components Version: 3.5.1

Anyways, after using sudo command, I am able to run this.

sudo sls offline start --port 3000

Still can’t deploy due to permission issues in the .cache folder. Grant permissions to the folder does not help because new files are created there during the deploy without the right permissions. Also, using sudo is not an option for me because it prevent me do access docker daemon.

It started to happen when I tried to package python modules using serverless-python-requirements plugin.