EISDIR on invoke local of aws-kotlin-jvm-gradle

I’m attempting to invoke the hello function from the aws-kotlin-jvm-gradle template, and getting an EISDIR (“error is directory”, i.e. code expects file but finds directory)

Any ideas?

$  lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04 LTS
Release:	20.04
Codename:	focal

$ java --version
openjdk 11.0.7 2020-04-14 LTS
OpenJDK Runtime Environment Corretto-11.0.7.10.1 (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.7.10.1 (build 11.0.7+10-LTS, mixed mode)
$ serverless create --template aws-kotlin-jvm-gradle --path aws-kotlin-jvm-gradle
...
$ ./gradlew build
...
$ serverless invoke local -f hello
Serverless: Load command interactiveCli
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command config:tabcompletion
Serverless: Load command config:tabcompletion:install
Serverless: Load command config:tabcompletion:uninstall
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 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 config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command upgrade
Serverless: Load command uninstall
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Load command output
Serverless: Load command output:get
Serverless: Load command output:list
Serverless: Load command param
Serverless: Load command param:get
Serverless: Load command param:list
Serverless: Load command studio
Serverless: Load command dev
Serverless: Invoke invoke:local
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Packaging service...
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage
 
  Error --------------------------------------------------
 
  Error: EISDIR: illegal operation on a directory, open '/home/jlatham/workspace/aws-kotlin-jvm-gradle/.serverless/invokeLocal/artifact/kotlin/'
      at /home/jlatham/.nvm/versions/node/v12.18.2/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:433:19
  From previous event:
      at AwsInvokeLocal.invokeLocalDocker (/home/jlatham/.nvm/versions/node/v12.18.2/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:432:8)
      at AwsInvokeLocal.invokeLocal (/home/jlatham/.nvm/versions/node/v12.18.2/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:230:17)
  From previous event:
      at Object.invoke:local:invoke [as hook] (/home/jlatham/.nvm/versions/node/v12.18.2/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:38:57)
      at /home/jlatham/.nvm/versions/node/v12.18.2/lib/node_modules/serverless/lib/classes/PluginManager.js:476:55
  From previous event:
      at PluginManager.invoke (/home/jlatham/.nvm/versions/node/v12.18.2/lib/node_modules/serverless/lib/classes/PluginManager.js:476:22)
      at /home/jlatham/.nvm/versions/node/v12.18.2/lib/node_modules/serverless/lib/classes/PluginManager.js:511:24
  From previous event:
      at PluginManager.run (/home/jlatham/.nvm/versions/node/v12.18.2/lib/node_modules/serverless/lib/classes/PluginManager.js:511:8)
      at /home/jlatham/.nvm/versions/node/v12.18.2/lib/node_modules/serverless/lib/Serverless.js:131:33
  From previous event:
      at Serverless.run (/home/jlatham/.nvm/versions/node/v12.18.2/lib/node_modules/serverless/lib/Serverless.js:118:74)
      at /home/jlatham/.nvm/versions/node/v12.18.2/lib/node_modules/serverless/bin/serverless.js:80:26
      at processImmediate (internal/timers.js:456:21)
      at process.topLevelDomainCallback (domain.js:137:15)
  From previous event:
      at Object.<anonymous> (/home/jlatham/.nvm/versions/node/v12.18.2/lib/node_modules/serverless/bin/serverless.js:80:4)
      at Module._compile (internal/modules/cjs/loader.js:1138:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
      at Module.load (internal/modules/cjs/loader.js:986:32)
      at Function.Module._load (internal/modules/cjs/loader.js:879:14)
      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
      at internal/main/run_main_module.js:17:47
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              12.18.2
     Framework Version:         1.74.1
     Plugin Version:            3.6.15
     SDK Version:               2.3.1
     Components Version:        2.31.12

I get something similar with a Java maven app…

❯ java --version
openjdk 11.0.8 2020-07-14 LTS
OpenJDK Runtime Environment Corretto-11.0.8.10.1 (build 11.0.8+10-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.8.10.1 (build 11.0.8+10-LTS, mixed mode)

❯ SLS_DEBUG=* sls invoke local --f getRates
Serverless: Load command interactiveCli
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command config:tabcompletion
Serverless: Load command config:tabcompletion:install
Serverless: Load command config:tabcompletion:uninstall
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 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 config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command upgrade
Serverless: Load command uninstall
Serverless: Load command prune
Serverless: Load command offline
Serverless: Load command offline:start
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Load command output
Serverless: Load command output:get
Serverless: Load command output:list
Serverless: Load command param
Serverless: Load command param:get
Serverless: Load command param:list
Serverless: Load command studio
Serverless: Load command dev
Serverless: [AWS cloudformation 200 0.263s 0 retries] describeStacks({ StackName: 'sls-api-gateway' })
Serverless: Invoke invoke:local
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: [AWS s3 200 0.277s 0 retries] headBucket({ Bucket: 'flashparking-sls-dev' })
Serverless: Using deployment bucket 'flashparking-sls-dev'
Serverless: [AWS s3 200 0.234s 0 retries] getBucketEncryption({ Bucket: 'flashparking-sls-dev' })
Serverless: [AWS s3 200 0.228s 0 retries] getBucketVersioning({ Bucket: 'flashparking-sls-dev' })
Serverless: Packaging service...
Serverless: Invoke aws:package:finalize
AWS Pseudo Parameters
Skipping automatic replacement of regions with account region!
Serverless: Invoke aws:common:moveArtifactsToPackage

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

  Error: ENOENT: no such file or directory, open '/Users/mperry/dev/mobile-services/services/rates-api/.serverless/invokeLocal/artifact/META-INF/'
      at /snapshot/serverless/lib/plugins/aws/invokeLocal/index.js:433:19
  From previous event:
      at AwsInvokeLocal.invokeLocalDocker (/snapshot/serverless/lib/plugins/aws/invokeLocal/index.js:432:8)
      at AwsInvokeLocal.invokeLocal (/snapshot/serverless/lib/plugins/aws/invokeLocal/index.js:230:17)
  From previous event:
      at Object.invoke:local:invoke [as hook] (/snapshot/serverless/lib/plugins/aws/invokeLocal/index.js:38:57)
      at /snapshot/serverless/lib/classes/PluginManager.js:483:55
  From previous event:
      at PluginManager.invoke (/snapshot/serverless/lib/classes/PluginManager.js:483:22)
      at /snapshot/serverless/lib/classes/PluginManager.js:518:24
  From previous event:
      at PluginManager.run (/snapshot/serverless/lib/classes/PluginManager.js:518:8)
      at /snapshot/serverless/lib/Serverless.js:133:33
  From previous event:
      at Serverless.run (/snapshot/serverless/lib/Serverless.js:120:74)
      at /snapshot/serverless/bin/serverless.js:87:26
      at processImmediate (internal/timers.js:456:21)
      at process.topLevelDomainCallback (domain.js:137:15)
  From previous event:
      at Object.<anonymous> (/snapshot/serverless/bin/serverless.js:87:4)
      at Module._compile (pkg/prelude/bootstrap.js:1320:22)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1156:10)
      at Module.load (internal/modules/cjs/loader.js:984:32)
      at Function.Module._load (internal/modules/cjs/loader.js:877:14)
      at Function.Module.runMain (pkg/prelude/bootstrap.js:1375:12)
      at internal/main/run_main_module.js:17:47

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

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              12.18.1
     Framework Version:         1.75.0 (standalone)
     Plugin Version:            3.6.16
     SDK Version:               2.3.1
     Components Version:        2.32.0