nervous-systems / serverless-cljs-plugin

Serverless plugin for Clojurescript deployment w/ cljs-lambda
The Unlicense
75 stars 10 forks source link

Artifact name mis-interpolated #41

Open daemianmack opened 5 years ago

daemianmack commented 5 years ago

Hey there! I'm following the instructions in the README without any tweaks, using the lein template as described and am getting an odd error trying to upload the artifact.

src> lein new serverless-cljs serverless-cljs-example
src> cd serverless-cljs-example
serverless-cljs-example> lein deps
serverless-cljs-example> SLS_DEBUG=* AWS_PROFILE=<MY-PROFILE> serverless deploy
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
[...]
Serverless: [AWS s3 200 0.243s 0 retries] putObject({ Body:
   <Buffer 7b 22 41 57 53 54 65 6d 70 6c 61 74 65 46 6f 72 6d 61 74 56 65 72 73 69 6f 6e 22 3a 22 32 30 31 30 2d 30 39 2d 30 39 22 2c 22 44 65 73 63 72 69 70 74 ... 3944 more bytes>,
  Bucket:
   'serverless-cljs-example-serverlessdeploymentbuck-lqiyoq34buwi',
  Key:
   'serverless/serverless-cljs-example/dev/1553968044501-2019-03-30T17:47:24.501Z/compiled-cloudformation-template.json',
  ContentType: 'application/json',
  Metadata:
   { filesha256: 'k9Rs/1BMSyWQNTvj6FEXACL+PSeNaW0vi3Hi7FHR6yk=' } })
Serverless: Uploading artifacts...

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

  ENOENT: no such file or directory, stat '/Users/daemian/src/serverless-cljs-example/.serverless/Users/daemian/src/serverless-cljs-example/.serverless/serverless-cljs-example.zip'

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

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

Error: ENOENT: no such file or directory, stat '/Users/daemian/src/serverless-cljs-example/.serverless/Users/daemian/src/serverless-cljs-example/.serverless/serverless-cljs-example.zip'
    at Object.statSync (fs.js:871:3)
    at BbPromise.map (/usr/local/Cellar/serverless/1.39.0/libexec/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/uploadArtifacts.js:118:24)

You can see in the above that the artifact path is duplicated...

/Users/daemian/src/serverless-cljs-example/.serverless/Users/daemian/src/serverless-cljs-example/.serverless/serverless-cljs-example.zip

but that file is actually at:

/Users/daemian/src/serverless-cljs-example/.serverless/serverless-cljs-example.zip

Finding Issue #34 I tried the --lumo deploy flag but encountered the same issue.

I also tried updating the generated project.clj to reference :npm {:dependencies [[serverless-cljs-plugin "0.2.2"]]} instead of the generated "0.1.2", but no dice.

OS version: Mac OSX 10.13.6 NPM version: 6.7.0 serverless version: 1.39.0

daemianmack commented 5 years ago

I did an in-place hack to instrument the ./node_modules/serverless-cljs-plugin/index.js file with some debug log statements and when I re-ran the serverless deploy the above error didn't occur, and after much IAM fiddling I was able to successfully deploy.

Not sure if that instrumentation caused some cache to expire, but I suppose we can close this?

Thanks!