serverless-google-cloudfunctions icon indicating copy to clipboard operation
serverless-google-cloudfunctions copied to clipboard

skip cleanup of files that don't match the regex

Open Matthew-Smith opened this issue 5 years ago • 2 comments

We had an issue where we had added a couple files to our bucket which was used by serverless

The error we saw:

Type Error ---------------------------------------------
 
  Cannot read property '4' of null
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     OS:                     linux
     Node Version:           10.16.0
     Serverless Version:     1.44.1
 
ERROR: Job failed: command terminated with exit code 1

basically, file.name.match(/(serverless)\/(.+)\/(.+)\/(\d+)-(.+)\/(.+\.zip)/)[4] was failing because foo.js did not match the regex (returns null)

Matthew-Smith avatar Jun 04 '19 20:06 Matthew-Smith

any plans for merging this fix?

I had to add the main.py file directly into the root of the artifact zip. Getting the same error.

eLRuLL avatar May 20 '20 17:05 eLRuLL

I found the same error and with the suggestion the problem was fixed to me testing on local. These changes solves the problem in Issue: https://github.com/serverless/serverless-google-cloudfunctions/issues/228

pethersonmoreno avatar Jan 06 '21 15:01 pethersonmoreno